-
1. Re: mapping in web.xml - general question..
jsents Dec 19, 2001 1:45 PM (in response to yehonatan_mozes)I am not sure this is the best practice but we have set up our web app something like this
Web App
**CSS /for style Sheet
**Images / for Images
**jScript / for JavaScript
**pages / for our JSP's
**Web-INF /
****Classes
******com.. // this is all of our servlets and fronted classes
****lib //extra classes
****tld //tag stuff
In our code our URL or Web.xml entries go to Servlets for the most part. The servlet then forwards to a JSP for the display. The address remains whatever was setup in the Web.xml name and not the jsp name and path or the servlet name and path. Now to include images and things of the nature we do the following line of code
<input type="image" name="Select Address" border="0" alt="Select Address" src="<%=request.getContextPath()%>/images/administration/buttons/b_right_arrow.gif" height=17 width=17>
The reason we use the request.getContextPath() is because that value changes from Web server to server and avoids the use of ../.. to get to the right directory. Also we have not put our JSP's in dir that have the com.?.? setup.
I hope this helps some
Thanks
Josh