Thanks Simon,

I had overlooked the Extensions Filter page on the site.  Having read
it, I've a much better understanding about what it's doing.

However, when I add the necessary parts to my Web.xml, my app breaks.
I've watched the FINE logging entries go by in my console when I start
the app.  It gets as far as starting the server, but then it
inexplicably quits and the browser shows a 404 error.  It's as if the
Faces Servlet is never called to action.  

I wonder if it has something to do with my extensions.  I'm not using
any .faces or .jsf extensions.  All of my files are .jsp exertions.
Should I be using a different server mapping?

Another thought I had is if the problem is with my jsf libraries.  I'm
using the jsf-api.jar and the jsf-impl.jar.  Am I required to use the
myfaces implementations to make it work?

Thanks for your advice,

JR

-----Original Message-----
From: Simon Kitching [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 13, 2005 3:12 PM
To: MyFaces Discussion
Subject: Re: Bewildered by JSCookMenu

James Reynolds wrote:
> I would love to use the JSCookMenu, but I'm apparently too dumb to 
> make it work.  I started out with these steps:
> 
> 1. Grabbed the latest nightly build.
> 2. Set up a menu file with the component using a standard theme.
> 3. Included the menu file in my page via <jsp:include>.
> 
> The page loads fine, but the menu is not visible.  Viewing the page 
> source reveals the JavaScript, but the browser throws a "cmDraw is not

> defined" error.
> 
> After browsing the archives, I found mentions of the <filter> and 
> <filter-mapping> entries for an Extensions Filter in my web.xml, so I 
> copied those portions verbatim from the "simple.war" web app.
> 
> When I run the app, I get a "page not found" error.  The only thing 
> I've noticed out of the ordinary in the console output is "FINE: Found

> no URL patterns mapping to FacesServlet"
> 
> I'm wondering if the filter mapping of: /faces/* is conflicting with 
> my servlet mapping of the same.

You might find this link useful:
   http://myfaces.apache.org/tomahawk/extensionsFilter.html

What you want is for a request to come into the servlet engine, go
through the Extensions Filter (which sets up a fake response object),
then go to the faces servlet. When the jsp page gets processed the
jscookMenu tag stores some "requests" to generate <script> tags into
page-scope fields in the servlet-request. When the faces servlet
finishes the Extensions Filter post-processes the response by inserting
the requested script tags into the response just before the </head> tag.

So what you see is exactly what would be expected if you hadn't set up
the servlet or filter mappings correctly.

Note that filters and servlets can happily be mapped to the same URL
patterns (in fact, that's the whole point).

I hope this helps.

Regards,

Simon

Reply via email to