Is it possible to override the default Content-Type for the response in a JSPServlet:service call?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Oscar_B
Posted On:   Thursday, August 25, 2005 04:32 AM

Im overriding a JspServlet service(request, response) method, in which I want to set the response.ContentType. I have the following code: public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("DEBUG: service call for " + request.getRequestURI()); response.setContentType("text/xml"); super.service(request, response); } Now its seems to work fine for files smaller than 8kb but it goes wrong for files larger than 8 kb. Anyone have any ideas what might go wrong here, or even if this is a valid construction because I somewhat guessed this should work?    More>>

Im overriding a JspServlet service(request, response) method, in which I want to set the response.ContentType.

I have the following code:

			
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
System.out.println("DEBUG: service call for " + request.getRequestURI());
response.setContentType("text/xml");
super.service(request, response);
}


Now its seems to work fine for files smaller than 8kb but it goes wrong for files larger than 8 kb.

Anyone have any ideas what might go wrong here, or even if this is a valid construction because I somewhat guessed this should work?

   <<Less
About | Sitemap | Contact