This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes JSP---> Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP---> Struts" Watch "JSP---> Struts" New topic
Author

JSP---> Struts

Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152
Hi,
I have a jsp home.jsp, which includes another jsp, header.jsp (<%@ include file="NEWheader.jsp" %> . My included JSP contains code which needs to be executed in order to display some data on that included page.Now I am converting both of my JSP's to Struts(creating all the related classes as well). Now when my main jsp is loaded (home.jsp) an action is called. But how should I call another action to display information on my included JSP.

This include jsp is included in all my jsp pages.
Please Help
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
There are a number of different ways to approach this. It would be helpful to know more about what the included JSP does. Does it have a form with a submit button, does it just display information?


Merrill
Consultant, Sima Solutions
Mauricio Caceres
Greenhorn

Joined: Jul 21, 2005
Posts: 4
Hi,
do you try with Tiles??


Attentively,<br />Mauricio C�ceres Herrera
Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152
ya that's what i have done. Its working fine. Actually my incuded JSP was also displaying lots of data, including hyperlinks. Neways, I have used tiles for now.
Is their ne other way as well to achieve this in struts?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Tiles is probably your best option. Sometimes, if there's only a little data in the included jsp, such as the title of the page, it's convenient just to keep it as an included JSP and pass the information as a parameter with the include. But with a lot of data, tiles is definitely the best option.
Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152
One more thing. Though we are going with tiles. I have a question on the same. I have placed my <body> element in my main template jsp(which will contain all other jsp's header, footer, menu and content). Now how to call js methods on body onload as each 'content' jsp will have his own onload method.
 
jQuery in Action, 2nd edition
 
subject: JSP---> Struts