You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rama Krishna <kr...@hotmail.com> on 2001/07/16 20:07:13 UTC

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.



Re: quick question : form

Posted by Jeff Trent <jt...@structsoft.com>.
Test message ... please ignore.
  ----- Original Message ----- 
  From: Jeff Trent 
  To: struts-user@jakarta.apache.org 
  Sent: Monday, July 16, 2001 2:46 PM
  Subject: Re: quick question : form


  This is a test message, please ignore.
    ----- Original Message ----- 
    From: Rama KrishnA 
    To: struts-user@jakarta.apache.org ; edeN@jamethial.ath.cx 
    Sent: Monday, July 16, 2001 2:34 PM
    Subject: Re: quicK question : form


    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.



Re: quick question : form

Posted by Jeff Trent <jt...@structsoft.com>.
Test message ... please ignore.
  ----- Original Message ----- 
  From: Jeff Trent 
  To: struts-user@jakarta.apache.org 
  Sent: Monday, July 16, 2001 2:46 PM
  Subject: Re: quick question : form


  This is a test message, please ignore.
    ----- Original Message ----- 
    From: Rama KrishnA 
    To: struts-user@jakarta.apache.org ; edeN@jamethial.ath.cx 
    Sent: Monday, July 16, 2001 2:34 PM
    Subject: Re: quicK question : form


    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.



Re: quick question : form

Posted by Jeff Trent <jt...@structsoft.com>.
This is a test message, please ignore.
  ----- Original Message ----- 
  From: Rama KrishnA 
  To: struts-user@jakarta.apache.org ; edeN@jamethial.ath.cx 
  Sent: Monday, July 16, 2001 2:34 PM
  Subject: Re: quicK question : form


  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.



Re: quick question : form

Posted by Rama Krishna <kr...@hotmail.com>.
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.



RE: quick question : form

Posted by Melissa Rabin <ed...@jamethial.ath.cx>.
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.