Re: Re: RedirectAction Help!
I have it working now. Not sure what exactly fixed it but I upgraded struts to 2.2.3. I also changed yourForm to formId to be consistent. Thanks for the help! I sure am learning alot! Teresa On May 13, 2011 1:33pm, Marcus Bond wrote: I was having similar issues recently using an older version of struts2 (can't remember which unfortunately) and I upgraded to 2.2.3 which seems to work fine.. fyi the first example I have is below where selectedUserId is set on the action I redirect to with the value from user.getId passed as the value so the url ends up as /listUsers?selectedUserId=69 updateUserAction" method="update"> listUsersparam> ${user.id} This is the same as yours pretty much.. I presume you've double checked that there is a value set for yourForm when you then do the redirect? Perhaps it's worth debugging through the code or trying it out with a newer struts version? On 13/05/2011 18:05, tdmcgin...@gmail.com wrote: Eric, I have never used pastebin before but I created my project files out there and here is the link: http://pastebin.com/u/tdmcginley The problem is getting from startInformation.jsp begin button to questions with the formid. In event I list the URL's that I start with and what they look like. I appreciate any assistance I can get to get this working. Teresa On May 13, 2011 8:12am, Eric Lentz eric.le...@sherwin.com> wrote: > I'll take any suggestions to get this working. Your code snippet lacks important details that would help me answer your question. Use pastebin or a like service and include a minimal running example and then perhaps I can help. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: RedirectAction Help!
I was having similar issues recently using an older version of struts2 (can't remember which unfortunately) and I upgraded to 2.2.3 which seems to work fine.. fyi the first example I have is below where selectedUserId is set on the action I redirect to with the value from user.getId passed as the value so the url ends up as /listUsers?selectedUserId=69 listUsers ${user.id} This is the same as yours pretty much.. I presume you've double checked that there is a value set for yourForm when you then do the redirect? Perhaps it's worth debugging through the code or trying it out with a newer struts version? On 13/05/2011 18:05, tdmcgin...@gmail.com wrote: Eric, I have never used pastebin before but I created my project files out there and here is the link: http://pastebin.com/u/tdmcginley The problem is getting from startInformation.jsp begin button to questions with the formid. In event I list the URL's that I start with and what they look like. I appreciate any assistance I can get to get this working. Teresa On May 13, 2011 8:12am, Eric Lentz wrote: > I'll take any suggestions to get this working. Your code snippet lacks important details that would help me answer your question. Use pastebin or a like service and include a minimal running example and then perhaps I can help. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Re: RedirectAction Help!
> The problem is getting from startInformation.jsp begin button to questions with the formid. When you hit begin from startInformation.jsp, you are submitting a form to beginQuestions which is acting on actions.survey.Listing. startInformation.jsp has a hidden field of form_id: Listing has a field called "yourForm" "form_id" and "yourForm" do not match. Could this be your problem? - Eric
Re: Re: RedirectAction Help!
Eric, I have never used pastebin before but I created my project files out there and here is the link: http://pastebin.com/u/tdmcginley The problem is getting from startInformation.jsp begin button to questions with the formid. In event I list the URL's that I start with and what they look like. I appreciate any assistance I can get to get this working. Teresa On May 13, 2011 8:12am, Eric Lentz wrote: > I'll take any suggestions to get this working. Your code snippet lacks important details that would help me answer your question. Use pastebin or a like service and include a minimal running example and then perhaps I can help.
Re: RedirectAction Help!
> I'll take any suggestions to get this working. Your code snippet lacks important details that would help me answer your question. Use pastebin or a like service and include a minimal running example and then perhaps I can help.
Re: RedirectAction Help!
I have a few examples of this working fine, will post this evening when I'm home M On 13/05/2011 13:57, tdmcgin...@gmail.com wrote: I didn't think I could send parameters with the chain? I am really trying to pass the an id from one action to another. I'll take any suggestions to get this working. Teresa On May 13, 2011 6:48am, jagdeep singh wrote: Use result type chain for example "HelloWorld" On Fri, May 13, 2011 at 4:39 PM, Teresa McGinley tdmcgin...@gmail.com>wrote: > I'm using Tomcat. > > Sent from my iPod > > On May 12, 2011, at 6:08 PM, Jeffrey Black jeffrey.bl...@yahoo.com> > wrote: > > > Hi Teresa. > > > > By "container" I meant Tomcat, Jetty, et al. > > > > Are you leveraging Spring for DI needs? > > > > Best, > > > > jb > > > > Sent from my iPad > > Follow me on Twitter @jeffblack360 > > > > > > On May 12, 2011, at 12:10 PM, tdmcgin...@gmail.com wrote: > > > >> Jeff, > >> > >> I am running struts 2.2.1 > >> > >> I also created this with Spring 3.0, although I am not sure I need > spring. > >> > >> Teresa > >> > >> On May 11, 2011 11:32pm, Jeffrey Black jeffrey.bl...@yahoo.com> wrote: > >>> Teresa, > >> > >> > >> > >>> FWIW, I have apps that utilize redirectAction (ie > ServletActionRedirectResult) without issue. > >> > >> > >> > >>> Just curious, what version of Struts2 are you running and what > container are you using? > >> > >> > >> > >>> Best, > >> > >> > >> > >>> jb > >> > >> > >> > >> > >> > >>> > >> > >>> From: Teresa McGinley tdmcgin...@gmail.com> > >> > >>> To: user@struts.apache.org > >> > >>> Sent: Tuesday, May 10, 2011 6:01 PM > >> > >>> Subject: RedirectAction Help! > >> > >> > >> > >>> 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... > >> > >> > >> > >>> http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > >> > >> > >> > >>> startInformation.jsp has a button that calls redirect: > >> > >> > >> > >> > >> > >>> ... > >> > >> > >> > >> > >> > >> > >> > >>> struts.xml > >> > >> > >> > >> > >> > >> > >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >> > >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> > >> > >> > >> > >> > >> > >> > >>> prod --> > >> > >> > >> > >> > >> > >> > >>> method="display"> > >> > >>> /views/survey/Listing.jsp > >> > >> > >> > >> > >> > >> > >> > >> > >>> name="success">/views/survey/startInformation.jsp > >> > >> > >> > >> > >> > >> > >>> method="beginQuestions"> > >> > >> > >> > >>> Questions > >> > >>> true > >> > >>> ${yourForm} > >> > >> > >> > >> > >> > >> > >> > >> > &g
Re: Re: RedirectAction Help!
I didn't think I could send parameters with the chain? I am really trying to pass the an id from one action to another. I'll take any suggestions to get this working. Teresa On May 13, 2011 6:48am, jagdeep singh wrote: Use result type chain for example "HelloWorld" On Fri, May 13, 2011 at 4:39 PM, Teresa McGinley tdmcgin...@gmail.com>wrote: > I'm using Tomcat. > > Sent from my iPod > > On May 12, 2011, at 6:08 PM, Jeffrey Black jeffrey.bl...@yahoo.com> > wrote: > > > Hi Teresa. > > > > By "container" I meant Tomcat, Jetty, et al. > > > > Are you leveraging Spring for DI needs? > > > > Best, > > > > jb > > > > Sent from my iPad > > Follow me on Twitter @jeffblack360 > > > > > > On May 12, 2011, at 12:10 PM, tdmcgin...@gmail.com wrote: > > > >> Jeff, > >> > >> I am running struts 2.2.1 > >> > >> I also created this with Spring 3.0, although I am not sure I need > spring. > >> > >> Teresa > >> > >> On May 11, 2011 11:32pm, Jeffrey Black jeffrey.bl...@yahoo.com> wrote: > >>> Teresa, > >> > >> > >> > >>> FWIW, I have apps that utilize redirectAction (ie > ServletActionRedirectResult) without issue. > >> > >> > >> > >>> Just curious, what version of Struts2 are you running and what > container are you using? > >> > >> > >> > >>> Best, > >> > >> > >> > >>> jb > >> > >> > >> > >> > >> > >>> > >> > >>> From: Teresa McGinley tdmcgin...@gmail.com> > >> > >>> To: user@struts.apache.org > >> > >>> Sent: Tuesday, May 10, 2011 6:01 PM > >> > >>> Subject: RedirectAction Help! > >> > >> > >> > >>> 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... > >> > >> > >> > >>> http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > >> > >> > >> > >>> startInformation.jsp has a button that calls redirect: > >> > >> > >> > >> > >> > >>> ... > >> > >> > >> > >> > >> > >> > >> > >>> struts.xml > >> > >> > >> > >> > >> > >> > >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >> > >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> > >> > >> > >> > >> > >> > >> > >>> prod --> > >> > >> > >> > >> > >> > >> > >>> method="display"> > >> > >>> /views/survey/Listing.jsp > >> > >> > >> > >> > >> > >> > >> > >> > >>> name="success">/views/survey/startInformation.jsp > >> > >> > >> > >> > >> > >> > >>> method="beginQuestions"> > >> > >> > >> > >>> Questions > >> > >>> true > >> > >>> ${yourForm} > >> > >> > >> > >> > >> > >> > >> > >> > >> > >>> /views/survey/Questions.jsp > >> > >> > >> > >> > >> > >> > >> > >> &g
Re: RedirectAction Help!
Use result type chain for example "HelloWorld" On Fri, May 13, 2011 at 4:39 PM, Teresa McGinley wrote: > I'm using Tomcat. > > Sent from my iPod > > On May 12, 2011, at 6:08 PM, Jeffrey Black > wrote: > > > Hi Teresa. > > > > By "container" I meant Tomcat, Jetty, et al. > > > > Are you leveraging Spring for DI needs? > > > > Best, > > > > jb > > > > Sent from my iPad > > Follow me on Twitter @jeffblack360 > > > > > > On May 12, 2011, at 12:10 PM, tdmcgin...@gmail.com wrote: > > > >> Jeff, > >> > >> I am running struts 2.2.1 > >> > >> I also created this with Spring 3.0, although I am not sure I need > spring. > >> > >> Teresa > >> > >> On May 11, 2011 11:32pm, Jeffrey Black wrote: > >>> Teresa, > >> > >> > >> > >>> FWIW, I have apps that utilize redirectAction (ie > ServletActionRedirectResult) without issue. > >> > >> > >> > >>> Just curious, what version of Struts2 are you running and what > container are you using? > >> > >> > >> > >>> Best, > >> > >> > >> > >>> jb > >> > >> > >> > >> > >> > >>> > >> > >>> From: Teresa McGinley tdmcgin...@gmail.com> > >> > >>> To: user@struts.apache.org > >> > >>> Sent: Tuesday, May 10, 2011 6:01 PM > >> > >>> Subject: RedirectAction Help! > >> > >> > >> > >>> 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... > >> > >> > >> > >>> http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > >> > >> > >> > >>> startInformation.jsp has a button that calls redirect: > >> > >> > >> > >> > >> > >>> ... > >> > >> > >> > >> > >> > >> > >> > >>> struts.xml > >> > >> > >> > >> > >> > >> > >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >> > >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> > >> > >> > >> > >> > >> > >> > >>> prod --> > >> > >> > >> > >> > >> > >> > >>> method="display"> > >> > >>> /views/survey/Listing.jsp > >> > >> > >> > >> > >> > >> > >> > >> > >>> name="success">/views/survey/startInformation.jsp > >> > >> > >> > >> > >> > >> > >>> method="beginQuestions"> > >> > >> > >> > >>> Questions > >> > >>> true > >> > >>> ${yourForm} > >> > >> > >> > >> > >> > >> > >> > >> > >> > >>> /views/survey/Questions.jsp > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >>> exerpt from Listing.java > >> > >> > >> > >>> 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 QuestionListing.java > >> > >> > >> > >>> I have a getter/setter for formId > >> > >> > >> > >>> public String execute() { > >> > >>> currentQuestion = (services.getQuestionsByForm(getFormId())); > >> > >>> return SUCCESS; > >> > >>> } > >> > >> > >> > >>> public String display() { > >> > >>> setCurrentQuestion(services.getQuestionsByForm(getFormId())); > >> > >>> return NONE; > >> > >>> } > >> > >>> public void setFormId(Long formId) { > >> > >>> this.formId = formId; > >> > >>> } > >> > >> > >> > >>> public Long getFormId() { > >> > >>> return formId; > >> > >>> } > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Regards, Jagdeep
Re: RedirectAction Help!
I'm using Tomcat. Sent from my iPod On May 12, 2011, at 6:08 PM, Jeffrey Black wrote: > Hi Teresa. > > By "container" I meant Tomcat, Jetty, et al. > > Are you leveraging Spring for DI needs? > > Best, > > jb > > Sent from my iPad > Follow me on Twitter @jeffblack360 > > > On May 12, 2011, at 12:10 PM, tdmcgin...@gmail.com wrote: > >> Jeff, >> >> I am running struts 2.2.1 >> >> I also created this with Spring 3.0, although I am not sure I need spring. >> >> Teresa >> >> On May 11, 2011 11:32pm, Jeffrey Black wrote: >>> Teresa, >> >> >> >>> FWIW, I have apps that utilize redirectAction (ie >>> ServletActionRedirectResult) without issue. >> >> >> >>> Just curious, what version of Struts2 are you running and what container >>> are you using? >> >> >> >>> Best, >> >> >> >>> jb >> >> >> >> >> >>> >> >>> From: Teresa McGinley tdmcgin...@gmail.com> >> >>> To: user@struts.apache.org >> >>> Sent: Tuesday, May 10, 2011 6:01 PM >> >>> Subject: RedirectAction Help! >> >> >> >>> 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... >> >> >> >>> http://localhost:8080/IUNSurvey/survey/Questions.action?formId= >> >> >> >>> startInformation.jsp has a button that calls redirect: >> >> >> >> >> >>> ... >> >> >> >> >> >> >> >>> struts.xml >> >> >> >> >> >> >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >> >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> >> >> >> >> >> >> >>> prod --> >> >> >> >> >> >> >>> method="display"> >> >>> /views/survey/Listing.jsp >> >> >> >> >> >> >> >> >>> name="success">/views/survey/startInformation.jsp >> >> >> >> >> >> >>> method="beginQuestions"> >> >> >> >>> Questions >> >>> true >> >>> ${yourForm} >> >> >> >> >> >> >> >> >> >>> /views/survey/Questions.jsp >> >> >> >> >> >> >> >> >> >> >> >>> exerpt from Listing.java >> >> >> >>> 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 QuestionListing.java >> >> >> >>> I have a getter/setter for formId >> >> >> >>> public String execute() { >> >>> currentQuestion = (services.getQuestionsByForm(getFormId())); >> >>> return SUCCESS; >> >>> } >> >> >> >>> public String display() { >> >>> setCurrentQuestion(services.getQuestionsByForm(getFormId())); >> >>> return NONE; >> >>> } >> >>> public void setFormId(Long formId) { >> >>> this.formId = formId; >> >>> } >> >> >> >>> public Long getFormId() { >> >>> return formId; >> >>> } > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: RedirectAction Help!
Hi Teresa. By "container" I meant Tomcat, Jetty, et al. Are you leveraging Spring for DI needs? Best, jb Sent from my iPad Follow me on Twitter @jeffblack360 On May 12, 2011, at 12:10 PM, tdmcgin...@gmail.com wrote: > Jeff, > > I am running struts 2.2.1 > > I also created this with Spring 3.0, although I am not sure I need spring. > > Teresa > > On May 11, 2011 11:32pm, Jeffrey Black wrote: >> Teresa, > > > >> FWIW, I have apps that utilize redirectAction (ie >> ServletActionRedirectResult) without issue. > > > >> Just curious, what version of Struts2 are you running and what container are >> you using? > > > >> Best, > > > >> jb > > > > > >> > >> From: Teresa McGinley tdmcgin...@gmail.com> > >> To: user@struts.apache.org > >> Sent: Tuesday, May 10, 2011 6:01 PM > >> Subject: RedirectAction Help! > > > >> 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... > > > >> http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > > > >> startInformation.jsp has a button that calls redirect: > > > > > >> ... > > > > > > > >> struts.xml > > > > > > >> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >> "http://struts.apache.org/dtds/struts-2.0.dtd";> > > > > > > >> prod --> > > > > > > >> method="display"> > >> /views/survey/Listing.jsp > > > > > > > > >> name="success">/views/survey/startInformation.jsp > > > > > > >> method="beginQuestions"> > > > >> Questions > >> true > >> ${yourForm} > > > > > > > > > >> /views/survey/Questions.jsp > > > > > > > > > > > >> exerpt from Listing.java > > > >> 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 QuestionListing.java > > > >> I have a getter/setter for formId > > > >> public String execute() { > >> currentQuestion = (services.getQuestionsByForm(getFormId())); > >> return SUCCESS; > >> } > > > >> public String display() { > >> setCurrentQuestion(services.getQuestionsByForm(getFormId())); > >> return NONE; > >> } > >> public void setFormId(Long formId) { > >> this.formId = formId; > >> } > > > >> public Long getFormId() { > >> return formId; > >> } - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Re: RedirectAction Help!
Jeff, I am running struts 2.2.1 I also created this with Spring 3.0, although I am not sure I need spring. Teresa On May 11, 2011 11:32pm, Jeffrey Black wrote: Teresa, FWIW, I have apps that utilize redirectAction (ie ServletActionRedirectResult) without issue. Just curious, what version of Struts2 are you running and what container are you using? Best, jb From: Teresa McGinley tdmcgin...@gmail.com> To: user@struts.apache.org Sent: Tuesday, May 10, 2011 6:01 PM Subject: RedirectAction Help! 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... http://localhost:8080/IUNSurvey/survey/Questions.action?formId= startInformation.jsp has a button that calls redirect: ... struts.xml "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd";> prod --> method="display"> /views/survey/Listing.jsp name="success">/views/survey/startInformation.jsp method="beginQuestions"> Questions true ${yourForm} /views/survey/Questions.jsp exerpt from Listing.java 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 QuestionListing.java I have a getter/setter for formId public String execute() { currentQuestion = (services.getQuestionsByForm(getFormId())); return SUCCESS; } public String display() { setCurrentQuestion(services.getQuestionsByForm(getFormId())); return NONE; } public void setFormId(Long formId) { this.formId = formId; } public Long getFormId() { return formId; }
Re: RedirectAction Help!
Teresa, FWIW, I have apps that utilize redirectAction (i.e. ServletActionRedirectResult) without issue. Just curious, what version of Struts2 are you running and what container are you using? Best, jb From: Teresa McGinley To: user@struts.apache.org Sent: Tuesday, May 10, 2011 6:01 PM Subject: RedirectAction Help! 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... http://localhost:8080/IUNSurvey/survey/Questions.action?formId= startInformation.jsp has a button that calls redirect: ... struts.xml http://struts.apache.org/dtds/struts-2.0.dtd";> /views/survey/Listing.jsp /views/survey/startInformation.jsp Questions true ${yourForm} /views/survey/Questions.jsp exerpt from Listing.java 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 QuestionListing.java I have a getter/setter for formId public String execute() { currentQuestion = (services.getQuestionsByForm(getFormId())); return SUCCESS; } public String display() { setCurrentQuestion(services.getQuestionsByForm(getFormId())); return NONE; } public void setFormId(Long formId) { this.formId = formId; } public Long getFormId() { return formId; }
Re: RedirectAction Help!
Hi, My experience say not always just getter & setters works. So try to use ActionContext -> get context -> getvalue stack. set or ActionContext -> get context -> getvalue stack. push If only problem is formId not available to OGNL during redirect. There any be some other issue which needs more investigation . On Wed, May 11, 2011 at 4:31 AM, Teresa McGinley wrote: > 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... > > http://localhost:8080/IUNSurvey/survey/Questions.action?formId= > > startInformation.jsp has a button that calls redirect: > > > ... > > > > struts.xml > > > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >"http://struts.apache.org/dtds/struts-2.0.dtd";> > > > > > > method="display"> >/views/survey/Listing.jsp > > > > name="success">/views/survey/startInformation.jsp > > > method="beginQuestions"> > >Questions >true >${yourForm} > > > > >/views/survey/Questions.jsp > > > > > > exerpt from Listing.java > >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 QuestionListing.java > > I have a getter/setter for formId > >public String execute() { >currentQuestion = (services.getQuestionsByForm(getFormId())); >return SUCCESS; >} > >public String display() { >setCurrentQuestion(services.getQuestionsByForm(getFormId())); >return NONE; >} >public void setFormId(Long formId) { >this.formId = formId; >} > >public Long getFormId() { >return formId; >} > -- With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
RedirectAction Help!
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... http://localhost:8080/IUNSurvey/survey/Questions.action?formId= startInformation.jsp has a button that calls redirect: ... struts.xml http://struts.apache.org/dtds/struts-2.0.dtd";> /views/survey/Listing.jsp /views/survey/startInformation.jsp Questions true ${yourForm} /views/survey/Questions.jsp exerpt from Listing.java 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 QuestionListing.java I have a getter/setter for formId public String execute() { currentQuestion = (services.getQuestionsByForm(getFormId())); return SUCCESS; } public String display() { setCurrentQuestion(services.getQuestionsByForm(getFormId())); return NONE; } public void setFormId(Long formId) { this.formId = formId; } public Long getFormId() { return formId; }