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
Related Q & A:
- How safe is a career as a CNA in a nursing home?Best solution by Yahoo! Answers
- How do i find a profile of a person with a yahoo mail address?Best solution by Yahoo! Answers
- How do I save a video from a CD to a computer?Best solution by Yahoo! Answers
- How to forward e-mail to a group from a single e-mail address?Best solution by Webmasters
- How do I forward a COPY of an email from a certain contact to another address?Best solution by support.office.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.