*
The moose likes Struts and the fly likes How to include contents of a JSP into other JSP file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to include contents of a JSP into other JSP file?" Watch "How to include contents of a JSP into other JSP file?" New topic
Author

How to include contents of a JSP into other JSP file?

Pras Tiwari
Ranch Hand

Joined: Nov 07, 2005
Posts: 186
Hi,
In my STRUTS Based web application there are two files Viewcart.jsp & MemberLogin.jsp. Now ViewCart.JSP file has formbean & Action Associated with it. & when I am trying to access contents of ViewCart.jsp through typing in browser address bar "viewcart.do" I can view All the contents of viewcart.JSP Successfully. Now My MemberLogin.jsp Has also its own formbean & action class. Now I want to include Viewcart.jsp into my MemberLogin.jsp
I tried with following code into body of my MemberLogin.jsp:-
==============
<jsp:include action="/viewcart" />
==============

But couldn't succeed.
How should I solve above problem?
Can I use type of "viewcart" action as "org.apache.struts.IncludeAction"?
If yes then how? Is there any other solution to this?

Please tell me .
Thanx in advance.
Prash


********Deserve Before You Desire********
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If your're going to use the jsp:include tag, the syntax would be:

<jsp:include page="viewcart.do" /> The jsp:include tag is a standard JSP tag and doesn't know anything about Struts actions.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to include contents of a JSP into other JSP file?