On-session-creation access to Contexts, HttpServletRequest, Hibernate Session (e.g.
@Startup+@Create in session-scoped bean) - now works partially
--------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3365
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3365
Project: Seam
Issue Type: Feature Request
Affects Versions: 2.1.0.BETA1
Environment: Tomcat 6.x / all supported platforms
Reporter: Przemyslaw Jaskierski
This is a follow up to linked bug report JBSEAM-3273. Filling this as requested by Shane.
Example scenario: Developer wants to initialize or fetch from database properties for user
who has just created a http session. Developer can grab a cookie from request, identify
user using it and read basic properties to customize user experience by initializing some
session-scoped beans which determine application behavior.
@Startup-annotated-session-scoped-bean's @Create method is IMHO a good place for this.
It would be great if it was resolved for Seam 2.1 release, as this version brings
redesigns in many crucial parts. Some slight lifecycle altering can possibly be needed.
Currently this can be achieved but only in a hacky way, using workaround in Seam 2.1.
According to Shane, Seam makes no guarantee that it works, anyway. In Seam 2.1 you have to
add <web:identity-filter disabled="true"/> to components.xml to have
something similar possible (this workaround was suggested by Shane in resolution to linked
JBSEAM-3273). This was possible in Seam 2.x without this workaround, but Dan's
IdentityFilter introduction in Seam 2.1 made it cease working.
To sum this up, it would be great if there was a way to make this possible in one place:
a. Executed _exactly_once_ at http session creation
b. access to cookies, request parameters etc. (e.g. FacesContext.getCurrentInstance() or
ServletContexts.getInstance().getRequest())
c. Session and other contexts available for setting up beans for every user activity from
now on.
d. managed hibernate session available
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira