Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use <s:url> or use <jsp:include>

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I am new and interested in Struts 2, apologize that perhaps I should do more research it myself. But if anyone can offer any opinions, it would be awesome.

If I want to like include company banner on my app and maybe inherit the style from company site by writing or pasting the least amount of code, should I use <s:url> or should I use <jsp:include> ?

by the way, where should I place the included file to be consider the best practice in modern Web Application. My initial guess is a subfolder under /WEB_INF/

thanks for the input
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're misunderstanding the use of the s:url tag. This tag does nothing more than create a variable that is a formatted URL that could then be used by some other tag or scriptlet. It doesn't actually include any content on the page. If you want to include something on each page, then a jsp:include would work. You also have the option of using Struts Tiles.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic