how can i use plain html form tag in struts1 like in my Example

1.8k views Asked by At
<form id="login" action="Login.do" method="post" >
            <h1 id="ff-proof" class="ribbon">Rao & Siddhi &nbsp;&nbsp;</h1>
            <div class="apple">
                <div class="top"><span></span></div>
                <div class="butt"><span></span></div>
                <div class="bite"></div>
            </div>
            <fieldset id="inputs">
                <input id="username" type="text" onblur="if(this.value=='')this.value='User ID';" onfocus="if(this.value=='User ID')this.value='';" value="User ID" />
                <input id="password" type="password" onblur="if(this.value=='')this.value='Password';" onfocus="if(this.value=='Password')this.value='';" value="Password" />
            </fieldset>
            <fieldset id="actions"> 
                <input type="submit" id="submit" value="Login Here"/>
                <p class="option"><a href="#">Forget Password</a>&nbsp;&nbsp;|<a href="#">Registration</a></p>
            </fieldset>
    </form>


   <action-mappings>
    <action input="/JSP/Login.jsp" name="LoginBean" path="/Login"  scope="request"                                                type="com.action.LoginAction">
        <forward name="success" path="/JSP/success.jsp"/>
         <forward name="success" path="/JSP/Error.jsp"/>
    </action>

but it's not working how can this set values in setter getter method

how to call action pojo class,what should i pass in form action tag to call action class,anybody help me plz

1

There are 1 answers

2
Rameez On

Keep your form tag like this:

<form id="login" action="/Login.do" method="post" name="LoginBean" >..</form>

And your action mappings:

<action-mappings>
    <action input="/" name="LoginBean" path="/Login"  scope="request" type="com.action.LoginAction">
        <forward name="success" path="/JSP/success.jsp"/>
         <forward name="success" path="/JSP/Error.jsp"/>
    </action>
</action-mappings>