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 Calling struts action from a jsp page 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 "Calling struts action from a jsp page" Watch "Calling struts action from a jsp page" New topic

Calling struts action from a jsp page

jishnu dasgupta
Ranch Hand

Joined: Mar 11, 2011
Posts: 103

I have the below code in my jsp page,popUpWrapper.jsp:

where request.getParameter(), gets the jsp page which is appended with URL of popUpWrapper.jsp.

For example

if i have the below code:

then abc.jsp, is included inside PopUpWrapper.jsp.

The issue with this, is it works fine, when i pass a jsp page as a parameter.
However in some cases i have to pass a url like

where, has a mapping in struts-config.xml, from where it gets redirected to an Action class, which in turn determines, what jsp page to be displayed.

When i pass such URL in my PopUpWrapper.jsp, the jsp:include tries to find page, in its namespace, to display, instead of redirecting to Action class from struts config. AS a result, i get the page not found error.

Please advice on how to proceed for such URLS, where the Action class needs to be hit.

Note: i need to put this jsp, inside the PopUpWrapper.jsp. I had tried with requestDispatcher, but that didnt help me include inside PopUpWrapper.jsp.

If debugging is the process of removing bugs, then programming must be the process of putting them in. -- Edsger Dijkstra

subject: Calling struts action from a jsp page
Similar Threads
Passing values between two JSPs
How to get jsp:param
problem passing param in included page when using filter
Simple examples of JSP
Problem -exception Stream closed: -in including an action response into a jsp page.