[jboss-user] [JBoss Seam] - When are components created?
SmokingAPipe
do-not-reply at jboss.com
Sun Aug 20 04:35:30 EDT 2006
I created a very simple component like this:
| @Name("requestBean")
| @Scope(ScopeType.EVENT)
| public class RequestBean {
| private static final Logger logger = Logger.getLogger("RequestBean");
|
| public RequestBean() {
| logger.info("Created a request bean!");
| }
|
| private String affiliateId;
|
| @RequestParameter
| public String getAffiliateId() {
| return affiliateId;
| }
|
| public void setAffiliateId(String affiliateId) {
| logger.info("Setting the affiliate id param: " + affiliateId);
| this.affiliateId = affiliateId;
| }
|
| }
|
It would seem that, because the scope is EVENT, this bean would need to be instantiated for every single seam request, and yet I never see it get instantiated. Various other beans do get instantiated, and I'm not sure how Seam decides.
Also, what is the use of the @RequestParameter annotation? I've put in in various beans (stateful, stateless, entity, JavaBeans, etc) and it never gets called. Is there a way to get access to request parameters?
All I want to do is have it so that if a user shows up at the site, the affiliateId (which is in a GET parameter) gets saved in a cookie. Shouldn't be this hard but I can't figure out how to even access the parameter within Seam, or even get Seam to instantiate my component.
Any suggestions welcome.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966297#3966297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966297
More information about the jboss-user
mailing list