You did manage to make it work but that's not really the way you want to do it. 
 You need something more dynamic in your JSP than a hard-coded context root.  
If, for example, you change the context root, you will have to change the 
hardcoded path in every img tag.  Yuck!

Instead, you should compute the context root in a JSP expression like this:
<img src="<%= request.getContextPath() %>/images/home_header.jpg">

By programmatically determining the context root, you can redeploy this JSP 
with ANY legal context root and the img reference will still work.  The 
"request" object is a freebie:  it is one of the several "implicit objects" 
automatically available in every JSP.  Its data type is
javax.servlet.http.HttpServletRequest and extends from 
javax.servlet.ServletRequest

You might want to look this one up because it gives access to many useful 
things in JSPs like the http session, the query string, the path info, cookies, 
and the all important security thing called the Principal.

Get it?

Spoon

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872489#3872489

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872489


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to