Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSP---> Struts

 
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
 
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?
 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic