Announcement Announcement Module
Collapse
No announcement yet.
passing arguments Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • passing arguments

    i have real problem with understanding how exactly arguments are passed between html and java method

    this is what i ve got
    it is simple code

    i want to pass text from input text (at jsp page) to method as argument (or someother way)
    this is part of flow
    Code:
        <view-state id="enter" view="index">
    
            <transition on="submit" to="check"/> 
        </view-state>
    
        <action-state id="check">
            <evaluate expression="login.check(text)"/>
            <transition on="true" to="enter"/> 
            <transition on="false" to="hello"/> 
        </action-state>
    part of jsp page
    Code:
    <form name="Form" method="POST">
    	<fieldset>
    		<legend>Order form</legend>
                    <input type="text" name="text" />
    		<input type="hidden" name="_eventId" value="submit">
    		<input type="submit" value="Go ahead and buy now!"/>
    	</fieldset>
    </form>
    and java code
    Code:
    public class login {
        public String check(String text){
            System.out.println(text+"bbb");// i know this string wont be displayed on site
            return "false";
        }
    }
    i am reading those docs all days but cant understand them ;(
    anyone can tell me how do i do that?

    and second question how do i get params into html
    all i could understand is that i need to use on-render but i am still having troubles with that
    Last edited by qdc; Mar 27th, 2011, 09:03 AM.

  • #2
    If I understand your first question correctly, then you need to make use of EL expressions in your JSP to be able to bind the parameter to your Java code.

    Also, in order to invoke your login method and bind the parameter, you need to define in your flow .xml the class that contains the method and the parameter. This is usually done with the <var> element.

    Comment

    Working...
    X