1

I'm calling a servlet from a JSP page and setting some Attributes in servlet and finally calling ANOTHER JSP using RequestDispatcher's forward method. The second JSP is loading, showing the attributes that I've passed to it but none of the STYLESHEETS or jQuery/JAVASCRIPT files are loading into the page.

Error Msg: Upon Element Inspection in Mozilla of the forwarded JSP page I'm getting following error msg .

The stylesheet .../java/tutorial/mystyle.css was not loaded because its MIME type, “text/html”, is not “text/css”.

And for javascript its showing SYNTAX ERROR msg.

Without this forwarding if the JSP page is run, both the CSS and JavaScript called on this page are loading.

I've tried adding mime-mapping in my web.xml for css but still its not working.

I tried calling the second JSP page separately without servlet forwarding everything is working fine, stylesheets and javascripts are all loading.

How can I load my CSS and Javascript during Request forwarding ??

Thanks in advance

amukhachov
  • 5,822
  • 1
  • 41
  • 60
Rahul1000
  • 11
  • 4
  • 2
    Get your paths right. Duplicate of [Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP](http://stackoverflow.com/questions/3655316/browser-cant-access-find-relative-resources-like-css-images-and-links-when-cal) – BalusC Oct 22 '13 at 16:59
  • Thanks BalusC, you solved my problem :-) – Rahul1000 Oct 24 '13 at 08:04

0 Answers0