[
https://issues.jboss.org/browse/SEAMFACES-95?page=com.atlassian.jira.plug...
]
Brian Leathem commented on SEAMFACES-95:
----------------------------------------
Created a @Dependent scoped producer of the String valued project stage.
Note: the producer had to be @Dependent scoped, as @Request scoped caused the error:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to
Start:
name=vfs:///opt/jboss/jboss-6.0.0.Final/server/default/deploy/mavenproject.war_WeldBootstrapBean
state=Create: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001437 Normal
scoped bean class java.lang.String is not proxyable because the type is final or it
contains a final method class java.lang.String.
Make ProjectStage available from EL
-----------------------------------
Key: SEAMFACES-95
URL:
https://issues.jboss.org/browse/SEAMFACES-95
Project: Seam Faces
Issue Type: Feature Request
Components: CDI Integration
Affects Versions: 3.0.0.CR1
Reporter: Dan Allen
Priority: Minor
Fix For: 3.0.0.Final
There is no easy way to reach the project stage from EL, nor can you easily check which
ProjectStage is active. The only way to access the ProjectStage is by referencing the
context parameter directly:
#{initParam['javax.faces.PROJECT_STAGE']}
Seam Faces should make it available as
#{projectStage}
This also makes it possible to check which project stage is active.
#{projectStage eq 'Development'}
Without an implicit projectStage variable, that's not possible via EL, even with
method parameters, because the signature of the comparison method is as follows:
FacesContext#isProjectStage(ProjectStage)
Since enums can't be referenced directly from EL (without an explicit producer),
there is no way to use this method. Thus, it might make sense to expose a project stage
map that allows the enum values to be referenced:
#{projectStages.Development}
Then it would be possible to execute:
#{facesContext.isProjectStage(projectStages.Production)}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira