Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP---> Struts

 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mauricio Caceres
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
do you try with Tiles??
 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic