Archive

Posts Tagged ‘grails JSF2’

JSF2 and Grails 2.01 problems

April 20, 2012 Leave a comment

have huge problems getting JSF and Grails 2.01 working in dev mode.

first the JSF2 plugin doesnt work for grails 2+ see posts
and

tried deconstructing what it was trying to do – but ended up trying to build my own simple plugin and include spring faces/webflow and get mojarra 2.1.7 working with grails.

huge problems – but it appears alot of it is the fact that the embedded Tomcat container can’t work properly – keep getting errors whihc i’ve posted onto the nabble forums.

However got desperate the other day and generated a WAR and deployed to tomcat 7 outside of STS/embedded mode – and it kinda worked. so the issues are in grails itself and embedded tomcat.

couple of things to note of the way –

you have to programmatically change the web.xml in the plugin descriptors doWithWebDescriptor closure.

if you provide a web.xml in the WEB-INF directory as a starter – it gets ignored. Note sure where grails keeps its internal templated version

second point to note is that Grails will normally configure a listener

   <listener>
    <listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
    </listener>
  

if you look to google you’ll see that this extends org.springframework.web.context.ContextLoaderListener

so you dont have to configure the spring context loader for webflow as grails effectively does that for you and presumably calls the superclass constructor so you dont need to register this listerner twice – you’ll get a error if you do about duplicate registrations in web.xml.

in addition grails 2.01 in the build config you need to set the following to generate

grails.servlet.version = “3.0”

to generate the web 3_0 formatted headers

Advertisements
Categories: Grails Tags:
%d bloggers like this: