This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Myfaces - preferred page language (JSP- facelets) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Myfaces - preferred page language (JSP- facelets)" Watch "Myfaces - preferred page language (JSP- facelets)" New topic

Myfaces - preferred page language (JSP- facelets)

Men rai

Joined: May 31, 2011
Posts: 11
I want to build an application using MyFaces.
I downloaded the file tomahawk-examples-1.1.10-bin and I imported the sample myfaces-example-simple20-1.1.10 into netbeans.
My problem is that when I run it, it says that the file div.jsp is no available. My web.xml is as follows:


Thats because in the download menu at project properties - framework - Javaserver Faces - configuration - preferred page language appears JSP. I try to change it to facelets But when I save it stores JSP, when I enter again always appear JSP.

The libraries I'm using are the next ones:


I supose that If I could change the preferred page language to facelets it would work but I don not how.
Does anybody knows how can I do it? I want that when I request an *.jsf page it renders the xhtml page.
Thanks in advance
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

.jsf isn't used as a file extension.

You should have this in your web.xml file:

This lets the servlet know what extension you're using by default in your app. You also need to map the servlet to the URL pattern.

When the request is submitted in these URL formats, it informs the servlet to treat it as a JSF request and proceeds accordingly.
Consider Paul's rocket mass heater.
subject: Myfaces - preferred page language (JSP- facelets)
Similar Threads
Funny exception with StringBuffer with jsf
richfaces integration issue
MyFaces Tomahawk 1.1.7 Examples cannot be run using myfaces-core-1.2.5 lib Error parsing - jsf-core.taglib.xml
at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.getServletMapping