On 8/21/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> 
> I'm finally getting a little bit of time to look at Shale, with the
> intent of doing the Mailreader app under it as I offered to do a few
> weeks back... although I was thinking of writing a blog app instead
> since I wanted to re-do mine anyway, but that is neither here nor there :)
> 
> I'm looking at the use cases app, as that seemed like the logical place
> to begin... there's quite a bit in there, it's a bit overwhelming to
> start, and, after just a few minutes of browsing, I have a question
> already :)
> 
> Looking at index.jsp, I see a forward to usecases.faces.  My question
> is, where is that mapping defined?  It's obviously winding up at
> usecases.jsp, and I can see that .faces is mapped to FacesServlet in
> web.xml, so it's straight-forward to an extent, but I'm not seeing in
> the config files were something akin to a Struts path to /usecases is
> defined.  I assumed it would be in faces-config.xml, but unless I'm
> really missing something, it's not (by the way, I *DO* assume I'm
> missing something there!).
> 

How nice of you to start with an easy one :-).

If you take a look at the /WEB-INF/web.xml resource for this app,
you'll see that FacesServlet (the front controller provided by JSF) is
mapped to the "*.faces" URL pattern.  Therefore, it will receive this
request and turn it into a rendering of usecases.jsp ... but not until
*after* it has established an appropriate JSF lifecycle (including a
FacesContext instance) so that all the rest of the machinery has
access to it.

The gory details are in Chapter 10 of the JSF spec, although the
various books on JSF will cover this in a more
accessible-to-developers manner.  But this turns out to be a JSF
thing, not a Shale thing, so it's worth learning how it works.

Note that JSF, like Struts, is perfectly comfortable with either
prefix mapping ("/faces/*") or extension mapping ("*.faces").  When
you use JSF components like <h:form> to set up where a form submit
goes to, you won't even need to know what mapping is being used ...
but if the mapping were changed in this particular app, the relative
URL in index.jsp would need to be changed.

> Thanks!
> 
> --
> Frank W. Zammetti

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to