struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Teresa McGinley <>
Subject RedirectAction Help!
Date Tue, 10 May 2011 23:01:49 GMT
I am trying to send an id from one action to another and it seems to be
sending a null.  Please assist and I am really at my wits end with this.
How do I get the formId from the Listing to the QuestionListing?

startInformation has a yourForm=41, when I click the Begin button I get the
redirect to Questions.action with a null formId as shown...


startInformation.jsp has a button that calls redirect:

<s:form action="beginQuestions">
<s:submit type="submit" value="Begin" align="right"/>


<?xml version="1.0" encoding="UTF-8" ?>
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

    <constant name="struts.devMode" value="true" /> <!-- set to false for
prod -->

    <package name="" namespace="/survey" extends="struts-default">
        <action name="Listing" class="actions.survey.Listing"
            <result name="none">/views/survey/Listing.jsp</result>

        <action name="startInformation" class="actions.survey.Listing">

        <action name="beginQuestions" class="actions.survey.Listing"
            <result name="redirect" type="redirectAction">
                <param name="actionName">Questions</param>
                <param name="parse">true</param>
                <param name="formId">${yourForm}</param>

        <action name="Questions" class="actions.survey.QuestionListing">
            <result name="none">/views/survey/Questions.jsp</result>


exerpt from

    public String execute() {
        selectedForm = services.getFormsById(yourForm);
        return SUCCESS;

    public String display() {
        forms = services.getForms();
        return NONE;

    public String beginQuestions() {
        return "redirect";

     * @return the yourForm
    public Long getYourForm() {
        return yourForm;

exerpt from

I have a getter/setter for formId

    public String execute() {
        currentQuestion = (services.getQuestionsByForm(getFormId()));
        return SUCCESS;

    public String display() {
        return NONE;
    public void setFormId(Long formId) {
        this.formId = formId;

    public Long getFormId() {
        return formId;

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message