Saturday, 24 October 2015

Struts2: submit tag example

Render a submit button. 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"...>

Go through following link to know about all the attributes of submit.
https://struts.apache.org/docs/submit.html

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
  <s:form>
    <s:textfield name="userName" label="user name : " />
    <s:password name="password" label="password : " />
    <s:hidden name="code" value="1" />
    <s:submit />
  </s:form>
</body>
</html>



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment