0

We've been trying to troubleshoot why our application built using JSF 1.2 seems to be rendering the HTML source code instead of rendering the page as expected. We are using PrettyFaces to pretty up the URL. Mozilla Firebug shows an occasional Content-Type response header of "text/plain" for the web-pages but when we refresh the same page, it shows up okay with a Content-Type of "text/html".

We have also included an explicit response.setContentType("text/html") in the response filter just to be sure.

  1. IE 9.0: Works fine most of the time, but has occasional problems
  2. IE 8.0: Has issues a lot of the time, sometimes it works, sometimes it doesn't
  3. Safari (Windows) and Chrome 20: Has issues a lot of the time, sometimes it works, sometimes it doesn't

HTML source code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="/js/include.js"></script>
        <script type="text/javascript" src="/js/tabs.js"></script>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

.htaccess

Order allow,deny
Allow from all
IndexIgnore *

Any help to resolve this issue would be appreciated.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Stoodius
  • 11
  • 2

1 Answers1

0

This doesn't sound like an issue with PrettyFaces, because PF does not change the content type of the rendered output. I think this sounds like you may be using an incorrect or @ViewId in your pretty-config.

I'd start by making sure that you are forwarding to the proper view-id that will be handled by the faces servlet. If you forward to the JSF view file without invoking the faces servlet (e.g. /faces/, not /actual/view/)

This omission would result in the behavior you are describing.

Does this help? ~Lincoln

Lincoln
  • 3,151
  • 17
  • 22