File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Accessing web resource error (mapping problem) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Accessing web resource error (mapping problem)" Watch "Accessing web resource error (mapping problem)" New topic

Accessing web resource error (mapping problem)

Ramesh kangamuthu
Ranch Hand

Joined: Mar 13, 2007
Posts: 79

I work in an EProduct Catalogue application that accesses different web resources like images,applying styles for jsps.If I start running the application from a welcome page under for example http://localhost:8080/EProductCatalogue/admin/login.jsp it works with applying styles for the page and shows the required images.I used adminPanel.jsp as my template and change the content as and when require by including child jsps. here is my directory structure.

EProductCatalogue web application root directory

admin folder

..other jsps

images folder

..other images

From the adminPanel.jsp file if I call a servlet and return to the template page styles are not applied to the pages where it is used and
image links are broken.I want a unique way to refer the web resource within the web application. Anybody can help me to get rid of this problem.

Best Regards,
Ramesh Kangamuthu
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If I had to guess, I'd say that your relative links are not well formed.

We have a FAQ entry on building links that are relative to the contextPath.
You can read it here:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Accessing web resource error (mapping problem)
It's not a secret anymore!