Why is Javascript called Javascript, if it has nothing to do with Java?

MIME Issue: When RequestDispatcher is used to forward a request from a Servlet to a JSP page, the CSS and Javascript of that JSP page aren't loading. How to fix this ?

  • Error Msg: Upon Element Inspection in Mozilla 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. Is it bcoz before forwarding the request I did this... response.setContentType("text/html;charset=UTF-8") ?? How can I load my CSS and Javascript during Request forwarding ??

  • Answer:

    Try to clean the browser before loading the page for now I remember the php thing we have used as ob_start() function and ob_end_clean() as well as ob_flush() like functions to clean and load the fresh things according to new data.

Shivdhwaj Pandey at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.