It shouldn't be big work to create a request bean that does the job of
setting session bean. The same way you set a property of request bean
from #{param.xxx} you can link the request bean to session bean by
setting a managed property in session bean to an EL pointing to session
bean (eg <value>#{someSessionBean}</value>). The most important part is
to ensure the request bean is used upon request by the view. This could
be done by calling a value of request bean.

En l'instant précis du 11/06/07 14:07, MPF s'exprimait en ces termes:
> Hmm ur right ;( 
> argh..bad bad - but the other things (Filter) didnt worked (i dunno why)..
>
>
> David Delbecq-2 wrote:
>   
>> Note: be careful with using this method + session bean, as it will work
>> only once per session, that is the first time bean named qbk will be
>> used in user session. It may be intended behaviour, but most people need
>> a to take into account different value for each request.
>>
>> En l'instant précis du 11/06/07 09:33, MPF s'exprimait en ces termes:
>>     
>>> Well now it works with:
>>> <value>#{param.dbk}</value> 
>>>
>>> thanks to all and best regards
>>>
>>>
>>>
>>> MPF wrote:
>>>   
>>>       
>>>> Hi!
>>>> Well I tried this (but its sound like easy and thats all I need), but
>>>> the
>>>> parameter value is always null!
>>>>
>>>> try to call with following url:
>>>> http://localhost:8080/GatheringPlace/jsp/placeDetail.jsf?dbk=1212
>>>>
>>>> my code:
>>>>
>>>> bean:
>>>> public class PlaceDetailController {
>>>>
>>>>    private String dbk;
>>>>
>>>>    public PlaceDetailController() {
>>>>            // nothing to do
>>>>    }       
>>>>    
>>>>    public String getDbk() {
>>>>            return this.dbk;
>>>>    }
>>>>
>>>>    public void setDbk(final String dbk) {
>>>>            this.dbk = dbk;
>>>>    }
>>>> }
>>>>
>>>> faces config:
>>>> ...
>>>> <managed-bean>
>>>>  <managed-bean-name>placeDetail</managed-bean-name>
>>>>
>>>> <managed-bean-class>at.pcd.wam.technologie.controller.PlaceDetailController</managed-bean-class>
>>>>            <managed-bean-scope>session</managed-bean-scope>
>>>>            <managed-property>
>>>>                    <property-name>dbk</property-name>
>>>>                    <value>#{params.dbk}</value>
>>>>            </managed-property>
>>>> </managed-bean>
>>>> ...
>>>>
>>>>
>>>>
>>>> David Delbecq-2 wrote:
>>>>     
>>>>         
>>>>> Easy way to do it without much complicate front-end code is to use a
>>>>> bean setter to do the initialization job (assuming all you need is the
>>>>> common data initialization case):
>>>>>
>>>>> request:
>>>>> http://server/webapp/something.faces?xyz=abc
>>>>>
>>>>> faces-config.xml:
>>>>> <faces-config>
>>>>>     ..........
>>>>>     <managed-bean>
>>>>>         <managed-bean-name>somebean</managed-bean-name>
>>>>>         <managed-bean-class>
>>>>>             com.company.Bean
>>>>>         </managed-bean-class>
>>>>>         <managed-bean-scope>request</managed-bean-scope>
>>>>>         <managed-property>
>>>>>             <property-name>initialRequest</property-name>
>>>>>             <value>#{params.xyz}</value>
>>>>>         </managed-property>
>>>>>   ..........
>>>>>
>>>>> JSF will automatically evaluate #{params.xyz} upon bean instantiation.
>>>>>
>>>>> MPF a écrit :
>>>>>       
>>>>>           
>>>>>> Hi!
>>>>>> How can I realize that?
>>>>>> My application get called with a link that contains a parameter whom i
>>>>>> need
>>>>>> to load data. Need to write a frontcontroller?how?
>>>>>>
>>>>>> someone can help?
>>>>>>
>>>>>> best regards
>>>>>>   
>>>>>>         
>>>>>>             
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   

Reply via email to