Hi Gavin,

now I wrote me a little filter which extracts request scoped variables from a 
URL and forwards to some target page.

I.e. from a URL "http://www.example.com/products/12345.xhtml"; a request 
variable 'productId' with value '12345' is extracted and the request is 
forwarded to /showProduct.xhtml.
The product reference I use in showProduct.xhtml via EL is created by a 
@Factory annotated method that uses a 'productId' attribute of the same class 
to know which product to load.

This works fine when the productId is injected in the class with the @In 
annotation but not when I use the @RequestParameter annotation - which I would 
prefer because I'm not sure if the @In solution would be threadsafe - because 
the 'productId' is in the attribute map and not in the parameter map of the 
request. Further there's no method to add an additional parameter.

So the possible solutions I can think of are:

1. add a wrapper around every request in the filter - I don't like that because 
it would be quite an overhead just to set these parameters

2. use @In(scope=EVENT) - I'm not sure if there would be any impacts on 
performance / scalability

3. we get a @RequestAttribute annotation (like the @RequestParameter but for 
the attribute map of the request)

4. It is somehow possible to pass parameters to a factory method - i like that 
one but found no examples for it, is it possible?

So: how would you solve that and would there be any difference between 2nd and 
3rd?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988491#3988491

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988491
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to