This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Use <s:url> or use <jsp:include> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Use <s:url> or use <jsp:include>" Watch "Use <s:url> or use <jsp:include>" New topic
Author

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

Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use <s:url> or use <jsp:include>
 
Similar Threads
jsp:include
Help with JSTL usage
Select and trigger an action through a link, doesn't populate the value
Problem in Include File
Prob: Struts Tags inside wall tags