deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de>
Subject Re: Project Stage in JSF and DeltaSpike - 2nd
Date Mon, 25 Nov 2013 14:33:59 GMT
timing issue.

At the time @Startup beans get triggered, all the CDI booting is long time done already!

LieGrue,
strub




>________________________________
> From: Rainer Schön <rainer.schoen.dev@gmail.com>
>To: users@deltaspike.apache.org 
>Sent: Monday, 25 November 2013, 12:20
>Subject: Re: Project Stage in JSF and DeltaSpike - 2nd
> 
>
>Hi Mark
>
>Thanks for your reply. I fiddled a little bit about this problem. The best way I think,
is to set the values for ProjectStage (DS + JSF) into the JNDI environment. There you have
both at the same place. I tried to set then the desired value programmatically before the
JSF app is startet but in the web tier (ConextListener or "StartupServlet" with priority 1
and JSF servlet with priority 2) one is always to late to set the value in time. The solution
is to set up a @Singleton @Startup ejb and set the JNDI value for the JSF ProjectStage in
its @PostConstruct method (works in WAR and EAR deployments to GF4). This solution has the
advantage to have control which DS stage should comply to which JSF stage.
>
>But Alas, the devil is in the details! DS does not pick up its ProjectStage from JNDI
(java:comp/env/deltaspike/ProjectStage). Where could be the problem here?
>
>Regards, Rainer
>
>  
>Am 21.11.2013 13:09, schrieb Mark Struberg:
>
>>
>>
>> Hi!
>>
>> The JSF spec does not really define environment properties for defining the ProjectStage.
As per the JSF spec (parts are only documented in the API!) there are only the following 2
ways to define the JSF ProjectStage:
>> * JNDI java:comp/env/jsf/ProjectStage
>> * web.xml servlet param javax.faces.PROJECT_STAGE
>>
>> Apache MyFaces does also pick up the ProjectStage from the environment via '-Dfaces.PROJECT_STAGE=..'
and via JNDI. See [1] for more info.
>> I'm not sure whether Mojarra picks up those settings as well.
>>
>>
>>
>> The configuration which gets picked up in DeltaSpike itself is:
>>
>> * all ConfigResolver locations (JNDI + env + system + deltaspike properties, + custom
ConfigResolvers)
>>
>>
>> Currently only the following configuration gets picked up
>> * org.apache.deltaspike.ProjectStage
>>
>> I'm not sure if we already have a JIRA issue for it, but the plan is to 'extend'
this behaviour within the ds-jsf-impl to also pick up the JSF locations (except web.xml I'd
say). I bet there is some hacking needed on the core-impl to allow for this to happen.
>> Any opinions?
>>
>> LieGrue,
>> strub
>>
>>
>>
>>
>>
>> [1] https://issues.apache.org/jira/browse/MYFACES-2545
>>
>>
>>> ________________________________
>>> From: Rainer Schön <rainer.schoen.dev@gmail.com>
>>> To: users@deltaspike.apache.org
>>> Sent: Thursday, 21 November 2013, 11:42
>>> Subject: Project Stage in JSF and DeltaSpike - 2nd
>>>
>>>
>>> As a follower of the DRY principle, I would like to support Harald Wellmann's
post of October 10th, to which there was no answer:
>>>
>>>>>
>>> Is there an easy way to propagate the JSF project stage into
>>> DeltaSpike, or vice versa?
>>> <<
>>>
>>> Any idea is appreciated.
>>>
>>> Thanks and regards, Rainer
>>>
>>>
>>>
>>>
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message