This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
 
subject: How to include contents of a JSP into other JSP file?
 
Similar Threads
Getting error in including JSP file into other JSP file in STRUTS Application??
Cant Access contents of form in forms Action class...
problem in retriving value
Need to populate Form Beanvalues from one JSP to other JSP
Struts 1.1: Help needed with retreiving values from formbean