This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How to call a jsp page from another jsp page in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to call a jsp page from another jsp page in struts" Watch "How to call a jsp page from another jsp page in struts" New topic
Author

How to call a jsp page from another jsp page in struts

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
Hi
How to call a jsp page from another jsp page in struts. basically we dont need to write any action class we will specify the following action element in struts-config.xml

<action
path="/home"
parameter="/index.jsp"
type="org.apache.struts.actions.ForwardAction"
scope="request"
validate="false">
</action>
and in jsp page we will write code with /home... can anyone provide the code to be written in jsp

Thanks in advance
saiprasanna
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just create a link:

<html:link action="/home">Click here</html:link>


Merrill
Consultant, Sima Solutions
sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
Thanks Merrill
but we are not using struts-html taglibs can you specify in normatl html format.

Thanks in advance
saiprasanna
padma jenifer
Greenhorn

Joined: Jul 24, 2006
Posts: 6
i am afraid that i understand your question or not..you can use <a href="html page name" >click here</a>
sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi padma
what you specified is correct in normal situation i.e when we are using MVC 1 architecture.but in struts every request should be specified in struts-config.xml(i.e controller)
regards
saiprasanna
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
<a href="<%=request.getContextPath()%>/home.do">Click</a>
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi ,

Why dont you try

<a href="./home.do">Click<a>

Regards
[ August 10, 2006: Message edited by: A Kumar ]
sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
Thanks Dom & Kumar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call a jsp page from another jsp page in struts
 
Similar Threads
Global forwards in Struts modules
My struts app went crazy on Internet Explorer
new to tiles please help
how to call a specific action
Need to retrieve values from database on page loads.