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.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.