myeclipse案例

来源:互联网 发布:mac 忘记开机密码 编辑:程序博客网 时间:2024/06/04 18:56

tagl.jsp页面

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<s:actionerror/>
<s:actionmessage/>
<s:fielderror/>
 <body><br>
<s:form>
<s:file tooltip="this is a file input" name="file" label="上传文件"/>
<s:radio label="性别" list="{'男','女'}"  tooltip="this is a radiobox" name="sex"/>
<s:select label="所在地" list="{'江苏','上海','南京'}" tooltip="this is a your select" name="area"/>
<s:password label="密码" maxlength="9" required="true" tooltip="please enter password"/>
<s:textarea tooltip="writesomething" label="备注" name="auto" cols="20" rows="3" name="note"/>
<s:checkboxlist tooltip="hoose the job" label="职业" list="{'艺术家','工程师','程序员'}" name="job"/>
<s:combobox tooltip="choose the color" label="颜色" name="color" list="{'红色','绿色','蓝色'}"/>

<s:optiontransferselect tooltip="select the cuntry you like most" label="最美的国家" name="leftsidecountry"
leftTitle="Western countries" rightTitle="easern counteries" list="{'china','korean','japan'}" multiple="true"
headerKey="headerKey" headerValue="---please select---" emptyOption="true" doubleList="{'us.','uk','germany'}"
doubleName="rightsidecountries" doubleHeaderKey="doubleheaderkey" doubleHeaderValue="--please select--"
doubleEmptyOption="true" doubleMultiple="true"/>

 <s:submit onclick="alert('you clicked the submit');"/>
 <s:reset onclick="alert('you clicked the reset');"/>
  </s:form>
  </body>
</html>

java代码

package com;

public class reg {
 public String sex;//tagl页面提交的性别,所在地,颜色,备注
 public String note;
 public String color;
 public String area;
public String execute(){
 System.out.println(sex);
 System.out.println(note);
 System.out.println(color);
 System.out.println(area);
 
 return "succes";
}
}


struts.xml配置文件

  </action>
    <action name="reg" class="com.reg">包名com,类名reg
       <result name="succes">/tagl.jsp</result>显示页面tagl.jsp
  </action>


0 0
原创粉丝点击