Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Submit Tag (Form Tag) Example 
 

In this section, we are going to describe the submit tag.

 

Submit Tag (Form Tag) Example

                         

In this section, we are going to describe the submit tag. The submit tag is a UI tag that is used to render a submit button. The submit tag is used with the form tag to provide asynchronous form submissions. The submit can have three different types of rendering:

  • input: renders as html <input type="submit"...>
  • image: renders as html <input type="image"...>
  • button: renders as html <button type="submit"...>

Add the following code snippet into the struts.xml file.
struts.xml

<action name="submitTag">
      <result>/pages/uiTags/submitTag.jsp</result>
</action>

Create a jsp using the tag <s:submit> that renders a submit button. This tag contains various parameters:

The value parameter presets the value of input element. In our 1st case we have set it to "Submit" 
The type parameter sets the type of submit to use. Valid values are input, button and image.  In our case we have set it to "image"
The src supplies an image src for image type submit button. It will have no effect for types input and button. In our case we have set it to:"/struts2tags/pages/uiTags/submit.gif" 
The
align sets HTML align attribute. In our case we have set it to:"center"

submitTag.jsp

<%taglib prefix="s" uri="/struts-tags" %>

<html>
  <head>
    <title>Submit Tag Example</title>
    
  </head>
  <body>
  <h1><span style="background-color: #FFFFcc">Submit Tag Example!</span></h>
  <s:form>
    <s:textfield name="username" label="User Name" size="15" maxlength="10" />
    <s:textfield name="password" label="Password" size="15" maxlength="10" />
    <s:submit value="Submit" />
  <!-- To use gif button -->
    <s:submit type="image" src="/struts2tags/pages/uiTags/submit.gif" 
                                                          
align="center" />

  </s:form>
  </body>
</html>

Output of the submitTag.jsp:

                         

» View all related tutorials
Related Tags: c orm select form parameters button io tags sed get double tag parameter ddl id ai element move elements buttons

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

when d above code is used in my application i am getting an exception stating that the src attribute is not there for the submit tag according to the tld...

if some one know u may inform me...

Posted by vijay on Friday, 09.28.07 @ 19:19pm | #30159

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.