File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

I agree. Here's the link:
subject: Calling struts action from a jsp page
It's not a secret anymore!