JSF with Facelets broken?

First, thank you so much for SEAM support. This is the number one feature I have been waiting for.

Unfortunately it looks like JSF is no longer working in xhtml facelets pages.

Pages starting like this:
all resources are marked as red (URI is not registered (Setting | IDE Settings | Resources), except the ui facelets tag lib. The JSF and seam libs are added as Module libraries. I have tried creating a new project from scratch and loading a 7.0.3 project. Same result. Loading the project in 7.0.3 works fine. Also, creating a jsp page and using ]]>

also works fine.


Any suggestions?
Thanks and Regards,
Claus

8 comments
Comment actions Permalink

It seems your xhtml files are not recognized as facelets. How do you
configure facelets support? IDEA expects something like

com.sun.facelets.FaceletViewHandler ]]>

in your faces-config.xml.

Also, do you have web facet and jsf facet configured?


0
Comment actions Permalink

Yes, I do have the faceletsviewhandler defined in my faces-config. The project also compiles, deploys and works from inside IDEA. Also, all my Facets are detected correctly including SEAM and WEB facet with JSF 1.2.

But problem is now solved. I had to go into Settings -> filetypes and re-assign *.xhtml to the "Facelets file type" instead of the default XHTML file type. After that everything is fine.
Guess I must have done that for the old IDEA 7 releases also.

In my opinion, it is not very obvious that you need to do this in order to use facelets. Maybe IDEA should auto detect this from the faces-config file?

Regards,
Claus

0
Comment actions Permalink

Yes it should. Have you a JSF facet configured for your web module?


0
Comment actions Permalink

Yes, and IDEA also shows the correct information in the JSF Facet settings (JSF Version = Java Server Faces 1.2 and JSF Implementation = Java Server Faces Reference Implementation).

0
Comment actions Permalink

Dmitry Avdeev wrote:

IDEA expects something like

<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>

in your faces-config.xml.


Uh, oh, that will be a problem when you use trinidad - see
http://wiki.apache.org/myfaces/Facelets_with_Trinidad

With trinidad the facelet view handler is configured in web.xml as
<context-param>
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>

0
Comment actions Permalink

I see. It seems we have no reliable way to auto-detect facelets :( I think
there will be an option like "treat xhtml files as facelets" in jsf facet
configuration. The facelets file type will be most probably dropped.


0
Comment actions Permalink

Hi!

I see. It seems we have no reliable way to auto-detect facelets :( I think
there will be an option like "treat xhtml files as facelets" in jsf facet
configuration. The facelets file type will be most probably dropped.



I thought that too. We have an inherited ViewHandler here, you would
have to check the inheritance too to autodetect facelets.

Doable I think, but an option to override the autodetection would be
nice anyway.

Ciao,
Mario

0
Comment actions Permalink

I too ran into trouble trying to use the trinidad taglibs. Actually for both Tomahawk and Trinidad to function correctly in IntelliJ when developing facelets I had to manually extract the .xml taglib files from the .jar's META-INF folder and put them in my webapps /WEB-INF folder. Also had to then configure the taglibs as a resource and point to the new taglib files.

Would sure be nice if my inclusion of the tomahawk-facelets-taglib.jar and trinidad-impl.jar would allow auto tag completion when working in an .xhtml view!

Edited by: Greg Roll on Aug 7, 2008 9:20 PM

0

Please sign in to leave a comment.