• 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

Call a struts action from JSP page

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Is it possible that we execute an action from within a JSP page?
Cheers,
Seshu
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actions typically forward to JSP pages, not the other way around. What are you trying to do?
 
Sree Jag
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have to display the fields from two action forms in a single JSP page.
so i'm trying to call the action file from the JSP.
If u have an idea about webwork, then webwork provides an tag called <webwork:action> that calls the action file from the JSP.
Does struts provide any such thing?
Seshu
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's an example:
<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
<form:form action="register.do">
UserName:<form:text property="username"/><br>
enter password:<form assword property="password1"/><br>
re-enter password:<form assword property="password2"/><br>
<form:submit value="Register"/>
</form:form>
[ March 22, 2004: Message edited by: Anthony Watson ]
 
Sree Jag
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But i have to get the variables or fields from that the action in the current jsp page.
The current jsp comes from the execution of a action. I want the result of another action file also in this jsp.
I'm thinking of servlet chaining.
Does Struts suuport the chaining of action execution?
Seshu
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts does support action chaining.
You can access data from a previously submitted action form or data that your action set by getting it out of the request or session in your JSP page.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic