struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Bond <mar...@marcusbond.me.uk>
Subject Re: RedirectAction Help!
Date Fri, 13 May 2011 13:02:10 GMT
I have a few examples of this working fine, will post this evening when 
I'm home

M

On 13/05/2011 13:57, tdmcginley@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 <jagdeepsinghdhiman@gmail.com> 
> wrote:
>> Use result type chain for example
>
>> "HelloWorld"
>
>
>
>
>
>> On Fri, May 13, 2011 at 4:39 PM, Teresa McGinley 
>> tdmcginley@gmail.com>wrote:
>
>
>
>> > I'm using Tomcat.
>
>> >
>
>> > Sent from my iPod
>
>> >
>
>> > On May 12, 2011, at 6:08 PM, Jeffrey Black jeffrey.black@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, tdmcginley@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.black@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 tdmcginley@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-unsubscribe@struts.apache.org
>
>> > > For additional commands, e-mail: user-help@struts.apache.org
>
>> > >
>
>> >
>
>> > ---------------------------------------------------------------------
>
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>
>> > For additional commands, e-mail: user-help@struts.apache.org
>
>> >
>
>> >
>
>
>
>
>
>> -- 
>
>> Regards,
>
>> Jagdeep
>
>
>
>
>
> __________ NOD32 6118 (20110513) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message