JSF & Jetty

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JSF & Jetty

Russell Howe
Has anyone tried Sun's JSF implementation with Jetty?

I'm having a real painful time here. Finally managed to get it to work,
but the f:verbatim tag seems to be broken. There is a note in the JSF
docs saying that some containers don't follow the Servlet spec, and the
problem they talk about seems to apply to Jetty:

"Some versions of some web containers, such as Resin and Oracle App
Server, don't follow the Servlet 2.3 specification rule of calling
ServletContextListener listeners defined in TLD files in the META-INF
directory of a jar. Running a JavaServer Faces technology Web
application in such a container requires you to manually declare the
ServletContextListener instance. The listener-class you need to specify
is com.sun.faces.config.ConfigureListener"

(from
http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.html#issues)

JSF doesn't seem to want to work in Jetty unless I do the above.

Also, I wonder if this is perhaps biting me too:

"If you're using a SunTM ONE Application Server 7.x, Tomcat 4 series
container, or any container that strictly conforms to JSP 1.2, Servlet
2.3, you must use JSTL 1.0 instead of JSTL 1.1."

I wonder if I should be trying MyFaces instead...

--
Russell Howe
[hidden email]

Today's Nemi: http://www.metro.co.uk/img/pix/nemi_may25.jpg


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: JSF & Jetty

Greg Wilkins-5

<rant class="bileblog>

This special case was somehow snuc into the servlet spec
and as far as I can see, the developer that added this to the spec is
the only developer on the entire planet that uses this facility!!!

Now if this facility had been some sort of generic mechanism that any
web framework could use to register listeners - fine and well.  But no,
it is TOTALLY specific to some little used part of JSPs!

Now when JSF started using this feature AND it started causing problems
with almost every container, the JSF developers did not:

 + reveal the secret source code that was causing this error.
 + respond to any emails asking for the above.
 + make any attempt to contact the container developers to report a bug.

But not to worry - because this one particular framework is too lazy
to actually register anything that it requires....  Jetty will now search
every META-INF of every jar it finds in WEB-INF/lib looking for this
special case.   Maybe the JSF developers would like me to put their
garbage out every week as well??

You need to use a recent version of Jetty 5 and make sure that the
<Item>org.mortbay.jetty.servlet.TagLibConfiguration</Item>
is part of the   <Set name="WebApplicationConfigurationClassNames">

But a much better approach would be to totally avoid nonsense
like struts, JSF and almost anything else from the same stable!

</rant>


Russell Howe wrote:

> Has anyone tried Sun's JSF implementation with Jetty?
>
> I'm having a real painful time here. Finally managed to get it to work,
> but the f:verbatim tag seems to be broken. There is a note in the JSF
> docs saying that some containers don't follow the Servlet spec, and the
> problem they talk about seems to apply to Jetty:
>
> "Some versions of some web containers, such as Resin and Oracle App
> Server, don't follow the Servlet 2.3 specification rule of calling
> ServletContextListener listeners defined in TLD files in the META-INF
> directory of a jar. Running a JavaServer Faces technology Web
> application in such a container requires you to manually declare the
> ServletContextListener instance. The listener-class you need to specify
> is com.sun.faces.config.ConfigureListener"
>
> (from
> http://java.sun.com/j2ee/javaserverfaces/docs/ReleaseNotes.html#issues)
>
> JSF doesn't seem to want to work in Jetty unless I do the above.
>
> Also, I wonder if this is perhaps biting me too:
>
> "If you're using a SunTM ONE Application Server 7.x, Tomcat 4 series
> container, or any container that strictly conforms to JSP 1.2, Servlet
> 2.3, you must use JSTL 1.0 instead of JSTL 1.1."
>
> I wonder if I should be trying MyFaces instead...
>



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: JSF & Jetty

Russell Howe
Greg Wilkins wrote:
> <rant class="bileblog>
>
> This special case was somehow snuc into the servlet spec
> and as far as I can see, the developer that added this to the spec is
> the only developer on the entire planet that uses this facility!!!

[snip :)]

> You need to use a recent version of Jetty 5 and make sure that the
> <Item>org.mortbay.jetty.servlet.TagLibConfiguration</Item>
> is part of the   <Set name="WebApplicationConfigurationClassNames">

OK, well I have the recent Jetty 5 so I'll give it a try.

Just for Google's benefit:

<Configure class="org.mortbay.jetty.Server">
  <Set name="WebApplicationConfigurationClassNames">
    <Array type="java.lang.String">
      <Item>org.mortbay.jetty.servlet.TagLibConfiguration</Item>
    </Array>
  </Set>
  <!-- .... -->
</Configure>

Having said that, it looks like Apache's MyFaces implementation doesn't
rely on this daft trick, and requires you to specify the listener in
web.xml. Since the verbatim tag in MyFaces doesn't die with a
NullPointerException, I'm giving MyFaces a go instead of the JSF
'reference implementation'.

> But a much better approach would be to totally avoid nonsense
> like struts, JSF and almost anything else from the same stable!
>
> </rant>

Rant noted :)

I'm going to reserve an open verdict on JSF until I've used it a bit
more. I have David Geary & Cay Horstmann's book "Core JavaServer Faces"
(Sun Microsystems Press) and feel compelled to at least give it a go.
Can't say I was much impressed by David Geary's "Advanced JavaServer
Pages" though.

On the other hand, I did like Marty Hall's "Core Servlets and JavaServer
Pages". It's rather limited in scope, but I find it quite useful. These
are all Sun books with the nifty holograms on the spine and exorbitant
prices :)

I don't think I know anyone who has a nice thing to say about Struts,
that's for sure. Never even looked at it myself, however.

<nitpick>
http://jetty.mortbay.org/javadoc/org/mortbay/jetty/servlet/TagLibConfiguration.html

has a typo :)

s/encapsualtion/encapsulation/
</nitpick>

--
Russell Howe
[hidden email]

Today's Nemi: http://www.metro.co.uk/img/pix/nemi_may25.jpg


-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss