Click to See Complete Forum and Search --> : How to direct "/" directory to site root, not domain root


tnunamak
08-18-2009, 10:57 AM
This is a pretty straightforward question but I'm having trouble finding a solution.

I have a domain and a site, company.com/site. In my webroot I have a folder called images, for example. When I do

"/images/filename"

this maps to

company.com/images/filename

but it needs to map to

company.com/site/images/filename.

I can't find any configuration tag to use in web.xml or something like that, and I'm coding in JSP. I'm using a Glassfish server. How can I fix this?

JavaServlet
08-19-2009, 08:45 PM
Are you calling it? For example you can set it up in web.xml mapping:

<servlet-mapping>
<servlet-name>ServletName</servlet-name>
<url-pattern>/site/images/filename</url-pattern>
</servlet-mapping>