Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Myfaces - preferred page language (JSP- facelets)

 
Men rai
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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:

<welcome-file-list>
<welcome-file>div.jsf</welcome-file>
</welcome-file-list>

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:

libs.MyFaces.classpath=\
${base}/MyFaces/batik-awt-util-1.6-1.jar;\
${base}/MyFaces/batik-ext-1.6-1.jar;\
${base}/MyFaces/batik-gui-util-1.6-1.jar;\
${base}/MyFaces/batik-util-1.6-1.jar;\
${base}/MyFaces/commons-beanutils-1.8.3.jar;\
${base}/MyFaces/commons-codec-1.3.jar;\
${base}/MyFaces/commons-collections-3.2.1.jar;\
${base}/MyFaces/commons-digester-1.8.jar;\
${base}/MyFaces/commons-discovery-0.4.jar;\
${base}/MyFaces/commons-fileupload-1.2.1.jar;\
${base}/MyFaces/commons-io-1.3.2.jar;\
${base}/MyFaces/commons-lang-2.4.jar;\
${base}/MyFaces/commons-logging-1.1.1.jar;\
${base}/MyFaces/commons-validator-1.3.1.jar;\
${base}/MyFaces/jstl-1.2.jar;\
${base}/MyFaces/log4j-1.2.13.jar;\
${base}/MyFaces/myfaces-api-2.0.2.jar;\
${base}/MyFaces/myfaces-impl-2.0.2.jar;\
${base}/MyFaces/oro-2.0.8.jar;\
${base}/MyFaces/standard-1.1.2.jar;\
${base}/MyFaces/tomahawk20-1.1.10.jar;\
${base}/MyFaces/xml-apis-1.0.b2.jar;\
${base}/MyFaces/xmlParserAPIs-2.0.2.jar

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
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic