Servlet Forwarding


Web tier: servlets, JSP, Web frameworks: Servlet Forwarding

  1. Servlet Forwarding (3 messages)

    Does anyone know how to solve this problem?

    I am forwarding to a jsp at the end of the each servlet. But once I get to the jsp, it seems that the relative links don't work. I need to put in the full path to get images to appear and to link with other jsp or html pages.

    Here is what my directory structure looks like:
    c:\webapp\ - all html and jsp files
    c:\webapp\web-inf\classes\ - all java classes

    Any ideas?


    Threaded Messages (3)

  2. Servlet Forwarding[ Go to top ]

    Are you using web server along with Application server to serve static pages and images.
  3. Servlet Forwarding[ Go to top ]

    Yes, I'm using Tomcat for both
  4. Servlet Forwarding[ Go to top ]

    Hello, the solution for your problem is :
    put :
    <base href="http://localhost:8080/yourApplicationName/">
    <img src="./images/someImage.gif" >

    Tell me if it works or not.
    Good Luck