Can't you just add a parameter to the redirect action in you xml file? That way you can 'pass' the sampleString to the redirect action and can display it upon rendering the jsp.
On 4/20/09, Bhaarat Sharma <bhaara...@gmail.com> wrote: > yeah it is a redirectAction :( so now i know why the value for the string is > not there. > > Any workarounds to this issue? > > One I thought of is to set an attribute and retrieve it in the jsp page? > > Thanks > > On Mon, Apr 20, 2009 at 3:57 PM, Dave Newton <newton.d...@yahoo.com> wrote: > >> If it's a "redirectAction" then the action will be re-instantiated. >> >> Dave >> >> >> Bhaarat Sharma wrote: >> >>> sorry about the typo. as i was trying to give an example and not just >>> copy >>> paste the code I made a mistake. >>> >>> This is what I have in my jsp page. >>> >>> <s:property value="sampleString" default="test"/> >>> >>> I have verified whether it is because of a typographical error but it is >>> not. And since you are saying it cant be because I am just calling a >>> particular method in the action class. then I dont know what could be >>> causing this behavior. ... >>> >>> On Mon, Apr 20, 2009 at 3:43 PM, Dave Newton <newton.d...@yahoo.com> >>> wrote: >>> >>> Bhaarat Sharma wrote: >>>> >>>> What I wanted to do was that when user edits something and comes back >>>> to >>>>> the >>>>> listing page, they see a message on top saying id XXX has been >>>>> modified. >>>>> However, I think this is not possible because a method name is >>>>> mentioned >>>>> in >>>>> struts.xml. Is that correct? >>>>> >>>>> No. >>>> >>>> to try it out I added a private member string called successString in >>>> >>>>> EmployeeAction class and created getter/setters for it. Then in doSave >>>>> and >>>>> doDelete methods I added a line that sets the member string. Then on >>>>> the >>>>> listing jsp page. I simple added this line <s:property >>>>> value="successString" >>>>> default="test"/> However, it seems that the jsp page is never getting >>>>> the >>>>> value from getSuccessString method. >>>>> >>>>> Can someone please tell me an approach I can take to overcome this >>>>> problem? >>>>> >>>>> Below are the doSave and doDelete methods. >>>>> >>>>> public String doDelete() { >>>>> empService.deleteEmployee(employee.getEmployeeId()); >>>>> setSampleString("successfully deleted"); >>>>> return SUCCESS; >>>>> } >>>>> >>>>> Here you're calling setSampleString(); in the expository text above >>>>> you >>>> reference a property named "successString". Is that a (repeated) >>>> typographical error? >>>> >>>> Dave >>>> >>>> >>>> --------------------------------------------------------------------- >>>> 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 >> >> > -- Sent from my mobile device --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org