• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Clear Forms

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to clear values after submit without using javascript
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends. I'm assuming you have a session form bean, in Struts 1 (but I have no way of knowing because you didn't TellTheDetails). If that's the case, you can just set the form values to their defaults in the action. Or just don't use a session bean.
 
gokul subramanian
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using struts2 and i found that to initialize the fields load prepare interceptors is to be used. But when i trying this it always printing the null value
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without further information it's impossible to help.
 
gokul subramanian
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it possible that after executing the action then prepare interceptor is to be executed..? if it is possible.

thanks in advance
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*After* executing the action? That would make no sense: prepare() prepares the action to be executed.

It'd be easier if you just posted the code and explained the problem better.
 
gokul subramanian
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have used interceptors as follows


<action name="xx" method="xx" class="xx">
<result name="xx">/xx.jsp</result>
<interceptors-ref="prepare"/>
</action
and implemented the prepare in action as follows
public class xx extends ActionSupport implements Preparable {

public void prepare(){


}

public String xx() throws Exception {

return "xx";

}

}

thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand how the interceptor and preparable works. I'm asking what you're actually trying to *do*, because it makes no sense to want to call an action method after the action runs--after the action runs and the response is returned the action no longer exists: they're instantiated per-request.

What are you actually trying to do?
 
reply
    Bookmark Topic Watch Topic
  • New Topic