Some browsers determine the type of document contained in the response based solely on the Content-Type header of the HTTP response. The servlet container does not provide a Content-Type header for a new response. To correct this problem:
Set the Content-Type to HTML, using the setContentType() function of rwsf::HttpServletResponse in the request handler. The sample below demonstrates setting the response Content-Type to HTML:
void MyServlet::doGet(rwsf::HttpServletRequest& request, rwsf::HttpServletResponse& response) { response.setContentType("text/html"); // Add this line // ... existing code here }
Once the servlet sets the Content-Type to text/html, the browser should correctly display the rendered page.
© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.