-
1. Re: Getting the Seam context in a Filter
pmuir Oct 12, 2007 4:39 PM (in response to nemya)Use the context filter (rtfm) and then use Component.getInstance()
-
2. Re: Getting the Seam context in a Filter
nemya Oct 17, 2007 5:08 AM (in response to nemya)How can I use context filters?
-
3. Re: Getting the Seam context in a Filter
pmuir Oct 17, 2007 10:50 AM (in response to nemya)RT(F)M
-
4. Re: Getting the Seam context in a Filter
nemya Oct 17, 2007 10:52 AM (in response to nemya)RT(F)M ??????
-
-
6. Re: Getting the Seam context in a Filter
nemya Oct 17, 2007 12:03 PM (in response to nemya)I put in web.xml:
but I have an exception:
java.lang.IllegalStateException: No active event context<web:context-filter url-pattern="*.seam"/>
Someone to explain how to use the context filter. -
7. Re: Getting the Seam context in a Filter
shane.bryzak Oct 17, 2007 9:11 PM (in response to nemya)Don't configure the context filter for standard Seam URL's (i.e. *.seam), you need to configure it for your custom servlet. Take a look at the seamspace example, it uses a context filter to provide a content servlet (ContentServlet.java) access to the Seam contexts for the purpose of returning binary image data.
The configuration for this is in web.xml:<servlet> <servlet-name>Content Servlet</servlet-name> <servlet-class>org.jboss.seam.example.seamspace.ContentServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Content Servlet</servlet-name> <url-pattern>/content/*</url-pattern> </servlet-mapping>
and in components.xml:<web:context-filter url-pattern="/content/*"/>
-
8. Re: Getting the Seam context in a Filter
demetrio812 Nov 9, 2007 10:34 AM (in response to nemya)Hi!
I did like in Seam Space and it works for all components except one (the one I need!), I found that the problem is the injecting of FacesContext so if I remove:
@In FacesContext facesContext;
it works...but I need it because I have to read an init parameter (that I put in web.xml).
How can I do?
thanks
Demetrio -
9. Re: Getting the Seam context in a Filter
dustismo Nov 9, 2007 4:47 PM (in response to nemya)FacesContext.getCurrentInstance();
-Dustin