File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call a struts action from JSP page

 
Sree Jag
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is it possible that we execute an action from within a JSP page?
Cheers,
Seshu
 
Anthony Watson
Ranch Hand
Posts: 327
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic