Struts application two submit button

Ads
 

Struts application two submit button

Hai, i'm new in struts application development , My code is

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <title><bean:message key="label.login.title" locale="display"/></title>
    <!-- CSS -->
    <link rel="stylesheet" href="css/main.css" type="text/css" />
    <link rel="stylesheet" href="css/theme.css" type="text/css" />

</head>

<body id="public">

<div id="container">

    <%@ include file="/header_inc.jsp" %>

    <html:form action="/login" method="post" styleClass="javachap topLabel">
        <html:hidden property="action" value="login"/>
        <div class="info">
            <h2><bean:message key="label.login.heading" locale="display" />!</h2>
            <p><bean:message key="label.login.headingCaption" locale="display" />.</p>
        </div>

        <ul>
            <logic:messagesPresent >
                <li id="errorLi">
                    <h3 id="errorMsgLbl"><html:errors locale="display"/></h3>
                </li>
            </logic:messagesPresent>

            <li class="">
                <label for="email" class="desc">
                    <bean:message key="label.email" locale="display" />
                </label>
                <div>
                    <html:text property="email" maxlength="255"
                        tabindex="4" styleClass="field text medium"  style="autocomplete=\"off"/>
                </div>
            </li>

            <li class="" >
                <label for="password" class="desc">
                    <bean:message key="label.password" locale="display" />
                </label>
                <div>
                    <html:password property="password" maxlength="255"
                        tabindex="5" styleClass="field text medium" style="autocomplete=\"off"/>
                </div>
            </li>

            <li class="buttons">
                <html:submit tabindex="6" styleClass="btTxt">
                    <bean:message key="button.label.login" locale="display"/>
                </html:submit>

                 <html:submit tabindex="7" styleClass="btTxt">
                    <bean:message key="button.label.newuser" locale="display"/>
                </html:submit>
            </li>

        </ul>
    </html:form>
</div>

</body>
</html>

Here am using two submit button one is login and another one is new user registration . I want process one button is login purpose and another one new user registration purpose but the form name is "login" only . Any one help please

View Answers

May 5, 2013 at 3:14 PM

Hi ,

In struts we are using LookUpDispatchAction class to handle the form with multiple submit buttons.

Ads









Related Tutorials/Questions & Answers:
Struts application two submit button
Struts application two submit button  Hai, i'm new in struts application development , My code is <%@ taglib uri="http://struts.apache.org...;/html> Here am using two submit button one is login and another one is new
submit button
submit button  <p>hi I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go...; <input type="submit" value="Insert" name="login" /> <
Advertisements
JSP Submit Button
JSP Submit Button  Sir, I have a JSP page with 2 Submit button, both calls doPost method of same servlet. If I click any submit button the text box value get refreshed and set to null or blank, that should not happen. Plz help
image on submit button
image on submit button  i need to set an image on submit button. In javascript we can create a button like.. <a href="javascript:;" class="button...: transparent; cursor: pointer; or input[type=submit] { background: transparent
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Disabling submit button using jQuery
Disabling submit button using jQuery  Hello Sir I want to know - is there any way or approach to disable client side form's "Submit" button. Please give code also.   For all submit buttons, via JQuery, it'd
struts application
struts application  hi, how to retrive data from databse in struts application aand send the retrived data to corresponding form
Struts 2 Radio Button
Struts 2 Radio Button  I have a search functionlaity where i have two radio buttons and I am using Struts2 tag.I want first rado button to be selected by default.But when i select the second radio button and hit on search
struts application
struts application  hi, i can write a struts application in this first i can write enter data through form sidthen it will successfully saved into data base **but now i can apply to some validation to that form fileds
On Click on Submit Button Display Data on Orderlist
On Click on Submit Button Display Data on Orderlist  How can retreive data from database on orderlist on Click on submit Button of same page
struts application
struts application  i want to display name on the browser throgh struts1.2 in java please give me snippet
how to disable submit button after login in jsp
how to disable submit button after login in jsp  Hi, I have an application and when user logs in welcome page is displayed. When user clicks... to disable submit button after login in jsp? Thanks   Hi, You can
Click On Images of Submit Button Perform Action
Click On Images of Submit Button Perform Action  I have login page in which insert of submit button i used image. Therefor on Click of image i have to validate form , link with database and goto the next page
button actions in struts
button actions in struts  in my jsp page i have two buttons add and sub.when i clicking the add button one action is performed and clicking the sub button another action is performed.how i will handle it using struts.i am using
storing details in database on clicking submit button - JSP-Servlet
database on clicking submit button. I am unable to do this.Can u tell me how to code...storing details in database on clicking submit button  I am using JSP in NetBeans and have developed an application form which has fileds naming
Struts application by using eclipse
Struts application by using eclipse  Can we develop struts application by using eclipse ? If no then please provide other development tools, if yes can you mail me the tutorial or provide the same in roseindia
Struts 2 Application
Struts 2 Application Developing user registration application based on Struts 2 Framework This Struts 2 Application is a simple user registration application.... Let's start developing user registration application on Struts 2 framework
How to integrate Struts and Hibernate in an application?
How to integrate Struts and Hibernate in an application?  Hi, I am aware of both Struts and Hibernate framework. So, let's know how to integrate these two frameworks? Good example code will help me a lot. Thanks   
struts hibernate integration application
Struts2 hibernate integration application. In this tutorial we are going to show how to Integrate Struts Hibernate and create an application. This struts... of the struts hibernate integration application example. Description
How to save form fields into the MySql Database without submit button in jsp?
How to save form fields into the MySql Database without submit button in jsp?  I want to store user inputs into the database using javasccript or ajax or jqury but without submit button. Form Contains three fields
struts - application missing something?
struts - application missing something?   Hello I added a parameter... in the struts working and all is great till I close JBoss or the server gets shut down..., struts-config.xml are all updated. I didn't use anything new that hasn't already
SwitchAction Application in struts 1.3.10
SwitchAction Application in struts 1.3.10  Hi,I am working on struts 1.3.10 and I have developed my module using switchaction application...' module. and 'action=/switchpath' is the action path to link struts-config.xml name
Changing from Struts 1.2 to Struts 2.0 in Application
Changing from Struts 1.2 to Struts 2.0 in Application  Hi All, We have a financial application which is running successfully on struts 1.2 and java... latest version of struts 2.0. I want to know following things 1.what
Managing Datasource in struts Application
Managing Datasource in struts Application  Hi i need to know how to do set up of Oracle data base with struts using Data source.I have defined datasource in struts-config.xml as data-sources> <data-source type
jsperexception in struts application
jsperexception in struts application  Iam getting the following error repeatedly can u explain the solution for this? HTTP Status 500 - type Exception report message description The server encountered an internal error
how to by default chceckbox button is selected in struts
how to by default chceckbox button is selected in struts   i want to by default checkbox is selected please help me.. my is follwing <%@taglib uri="/struts-tags" prefix="s" %> in this iterator so many rows are there so
About Struts 2.2.1 Login application
.style1 { margin-left: 80px; } About Struts2.2.1 login application In the most common login application there is  login form which is takes user's id and password in this form and clicks on submit button. Then this id
Java radio buttons and button groups two values
Java radio buttons and button groups two values  hi i have a problem. i have a system to input data from a jform to a mysql database. i have made... is clicked depending on which button was clicked male or female be sent
Java radio buttons and button groups two values
Java radio buttons and button groups two values  hi i have a problem. i have a system to input data from a jform to a mysql database. i have made... is clicked depending on which button was clicked male or female be sent
Struts 2 radio button value problem
Struts 2 radio button value problem  When I use s:radio tag in struts 2, I'm not able to get the selected value using document.getElementById('radioButtonName').value.(Note :- I'm getting proper value in java from jsp) It always

Ads