I'm just starting to work with JSF and Facelets and I've put together a very simple page that is just taking a template from another file and inserting some text (just to show that it pulls information from both the template and the calling page)
However whenever I try to view the page in Internet Explorer 7, it attempts to download the page because it doesn't know what it is. After looking around, I learned that IE doesn't render xhtml, which is causing the problem, so my question is this.
How do you get facelets to work properly in Internet Explorer?
I've tried to change the extenstion that faces uses to a variety of things (开发者_JAVA百科.html, .jsf, .magic, ,moreMagic, etc...) but to no avail. Am I missing something very basic, or do I just need to find a different templating/custom tagging framework?
Just for the record, I'm running JBoss-4.2.3.GA, Java EE 5, JSF 1.2, and using IE 7 and myEclipse 7.5. I can't upgrade any of them due to work constraints.
Well it looks like a litte more digging was all I needed, so here's the answer for anybody that hits the same hurdle.
You still access pages as .faces, your web.xml will actually pass it through from .faces to .xhtml and handle it for you
I encountered the same problem with Internet Explorer 8 and Glassfish 3.0.1. However, the solution was different.
In my case, I had to rename my Form Login and Form Error pages to use a .html extension instead of .xhtml. That fixed the problem for me. All other pages are able to use a .xhtml extension without a problem. Here's the working snippet from web.xml:
<login-config>
<auth-method>FORM</auth-method>
<realm-name>file</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/loginError.html</form-error-page>
</form-login-config>
</login-config>
Hope this helps.
精彩评论