[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Re: JSPs shown as text in Firefox (Content-Type: text/plain)
bassman5
do-not-reply at jboss.com
Wed Jan 31 14:34:26 EST 2007
I found my problem, I used
RequestDispatcher dispatcher = context.getRequestDispatcher("/mypage.jsp");
dispatcher.include(request, response);
Which although the jsp had a content type, it was not set in the response.
So I added
response.setContentType("text/html");
and that sorted it.
I later restructed my code to only include a single jsp and changed it to :-
request.getRequestDispatcher("/mypage.jsp").forward(request,response);
That works as expected.
Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008963#4008963
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008963
More information about the jboss-user
mailing list