webtier@glassfish.java.net

Re: [webtier] Way to "Find" Faces Servlet?

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Mon, 4 Jan 2010 17:02:45 -0500

Any good examples out there on how to do this? Any reusable libs that you
know of?

I assume this is the identifier I would be looking for, then grab the
mapping and build a URL, since it's the spec'd (final/un-subclassable)
servlet-class.

<servlet-class>*javax.faces.webapp.FacesServlet*</servlet-class>

Additionally, I have a potentially basic Java question:

Just for confirmation, I can test this when I try it out: Assuming that I'm
using servletContext.getMajorVersion() to detect the current Servlet version
and take appropriate action, since I've never attempted to write a portable
lib between servlet versions... if I reference servlet 3.0, 2.5 APIs will
work in a 3.0 environment (unless deprecated), and make sure no 3.0 APIs are
accessed in 2.5 environments, I should be OK without runtime failures?

Thanks,
--Lincoln


On Mon, Jan 4, 2010 at 12:01 PM, Ryan Lubke <Ryan.Lubke_at_sun.com> wrote:

> If you're using Servlet 3.0, you can use the new programmatic APIs
> available on the ServletContext to
> obtain information on all registered Servlets.
>
> Anything earlier than 3.0, probably means parsing the web.xml yourself.
>
>
> On 1/3/10 12:23 PM, Lincoln Baxter, III wrote:
>
>> I'm trying to figure out a way to dispatch a request to Faces Servlet,
>> but I'm not sure how to discover how Faces Servlet is mapped. Is there
>> any way to do this?
>>
>> Basically, I want to be able to do something like this:
>>
>> 1. Request comes in for /some/url/
>> 2. Filter intercepts /some/url/ and understands that it belongs to Faces
>> 3. Filter forwards request to Faces Servlet (even though Faces Servlet
>> is not mapped to /some/url/ )
>>
>> So that means that I need either a blind forward, or a way of
>> determining some URL that *does* resolve to Faces Servlet. Once the
>> request is in Faces, it does not matter that there is no view file
>> corresponding to the address.
>>
>> Thanks,
>> Lincoln
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"