3 Replies Latest reply on Jun 14, 2007 10:11 AM by Christian Bauer

    Request parameters

    Markus Wolf Newbie

      Is there a way to use request parameters as initials values for a managed bean/component (e.g. a stateful bean)?
      In plain JSF one could specify a managed-property and set #{param.name} as initial value. How do you do this with seam? I've tried to port my application to seam but the initial values are always null.

        • 1. Re: Request parameters
          Pete Muir Master

          Use page parameters or @RequestParameter

          • 2. Re: Request parameters
            Markus Wolf Newbie

            Ok, I could create a simple bean component and specify @In("#{param...}").
            But I get this exception for my bean:

            java.lang.IllegalArgumentException: Can not set java.lang.Integer field de.llynch.kingpin.bean.ConfigBean.campaignId to java.lang.String
             sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
             sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
             sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
             java.lang.reflect.Field.set(Field.java:657)
             org.jboss.seam.util.Reflections.set(Reflections.java:63)
             org.jboss.seam.Component.setFieldValue(Component.java:1555)
             org.jboss.seam.Component.access$500(Component.java:135)
             org.jboss.seam.Component$BijectedField.set(Component.java:2285)
             org.jboss.seam.Component.injectAttributes(Component.java:1368)
             org.jboss.seam.Component.inject(Component.java:1195)
            


            • 3. Re: Request parameters
              Christian Bauer Master

              Pete already gave you the answer.