4 Replies Latest reply on Feb 21, 2008 11:56 PM by bhagyaravi

    How to access param values from ftl?




      I have somthing like  <input type="text" name="value1" value="" /> in my ftl page and i added a action in the xwork-plugin.xml based on submit of this page im planning to get the value of the text box in my action class



      i tried  String value = request.getParameter("value1"); but it gives me null. value is this possible to get the text box value in this way or it require a different systex to do this



      my objectvie here is to create some form and access those values in handler and process them.

        • Re: How to access param values from ftl?





          Well, i got solution for my problem after looking into some of the theme templates to get the value as request parameter i need to use somthing like



          <@ww.textfield theme="simple" name="user_crap_text" size="60" />









            • Re: How to access param values from ftl?

              hi Bala,


              Typically what you'll want to do is create instance variables on your action and then corresponding getter / setter methods, you'll invoke the action using a request like this:


              which will call the input method of your action, giving you the ability to pre-fill the form if you want. In your FTL, again assuming you have the necessary getter / setter methods for your form fields, you'd just have this:

              <input type="text" name="phone" value="${phone?html}" />

              If you haven't already, you should run on over to the WebWork site and give their documentation a once over to get up to speed with WebWork actions.





              1 person found this helpful
                • Re: How to access param values from ftl?

                  Hi AJ,

                      After the post i looked at the WebWork resources to understand the action flow i think i got it now. i used somthing like below to get the params     

                      from the ui



                   <input type="text" name="qtIdea" value="" /> 


                  class MyClass extends JiveActionSupport
                       implements ParameterAware{
                       Map parameters;..........
                       String[] textBoxValue = (String[]) parameters.get("qtIdea"); 


                  Thank you,