Hi,

to apply request parameter to managed bean the scope must be request afaik.


Regards,
   Volker

2007/6/11, MPF <[EMAIL PROTECTED]>:

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
>>
>
>

--
View this message in context: 
http://www.nabble.com/Myfaces---application-calling-by-link-which-include-parameter-tf3889911.html#a11056085
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Reply via email to