struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rama Krishna" <krishko...@hotmail.com>
Subject Re: quick question : form
Date Mon, 16 Jul 2001 18:34:49 GMT
Thanks much Melissa. But, i want to know why it does like this, when i call the reset manually.

rama.
  ----- Original Message ----- 
  From: Melissa Rabin 
  To: struts-user@jakarta.apache.org 
  Sent: Monday, July 16, 2001 11:19 AM
  Subject: RE: quick question : form


  Hi Rama.  One quick & dirty way to solve your problem is to add "success" as a string
to the request object in the perform method of your action class, and add a "<forward-name="success"
path=/originalJsp"> line in your struts-config file (which will return you to the page
you posted the initial request).  Add some jsp code to check if the request attribute is null,
which it will be when you first load the page. After the request is posted and your action
class adds the string to the request (if all goes well), it should finish up by returning
you to your original jsp where you will now see your "success" status message (e.g. <%=
request.getAttribute("status")%>
   
  I hope this helps
   
  Melissa
  Web Engineer
    -----Original Message-----
    From: Rama Krishna [mailto:krishkolli@hotmail.com]
    Sent: Monday, July 16, 2001 2:07 PM
    To: struts-user@jakarta.apache.org
    Subject: quick question : form


    hi all,

    i have a form and when i submit it i perform some action and i forward it to the same
form, but with a message "success". now

    - i want to reset all the fields (set to default value)
    - the url after submission is still xxx.yy?action="save", where as i want the action to
be"create"


    i tried calling reset method before forwarding, it clears all the fields but doesn't show
message "success" and the url is still ?action="save"


    can anyone help me??

    thanks,
    rama.



Mime
View raw message