6、Spring+Struts2+MyBatis(mybatis有代理)整合增刪改查


1、創建如下的oracle腳本

 1  create table userinfo
 2 (id number(4),
 3 name varchar2(50),
 4 password varchar2(20
 5 telephone varchar2(15),
 6 isadmin varchar2(5));
 7 
 8  --4.2 用戶表序列
 9  create sequence seq_userinfo;
10 
11  alter table userinfo add constraint pk_userinfo_id primary key(id);
12 
13  insert into userinfo values(seq_userinfo.nextval,'holly','123','134518024
14 ','');
15 
16  commit;
userinfo.sql

2、創建如下項目結構

3、在項目的WebRoot下的WEB-INF下的lib下添加如下jar文件

aopalliance.jar
aspectjweaver.jar
cglib-nodep-2.1_3.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-logging-1.0.4.jar
freemarker-2.3.15.jar
log4j-1.2.8.jar
mybatis-3.2.3.jar
mybatis-spring-1.2.1.jar
ognl-2.7.3.jar
ojdbc14.jar
org.springframework.aop-3.0.2.RELEASE.jar
org.springframework.asm-3.0.2.RELEASE.jar
org.springframework.beans-3.0.2.RELEASE.jar
org.springframework.context-3.0.2.RELEASE.jar
org.springframework.core-3.0.2.RELEASE.jar
org.springframework.expression-3.0.2.RELEASE.jar
org.springframework.jdbc-3.0.2.RELEASE.jar
org.springframework.orm-3.0.2.RELEASE.jar
org.springframework.transaction-3.0.2.RELEASE.jar
org.springframework.web-3.0.2.RELEASE.jar
struts2-core-2.1.8.1.jar
struts2-spring-plugin-2.1.8.1.jar
xwork-core-2.1.6.jar

4、在src下的com.bean包下創建UserInfo.java

 1 package com.bean;
 2 
 3 public class UserInfo {
 4     private Integer id;
 5     private String name;
 6     private String password;
 7     private String telephone;
 8     private String isadmin;
 9     
10     public UserInfo() {
11         
12     }
13     public UserInfo(Integer id, String name, String password, String telephone,
14             String isadmin) {
15         this.id = id;
16         this.name = name;
17         this.password = password;
18         this.telephone = telephone;
19         this.isadmin = isadmin;
20     }
21     public Integer getId() {
22         return id;
23     }
24     public void setId(Integer id) {
25         this.id = id;
26     }
27     public String getName() {
28         return name;
29     }
30     public void setName(String name) {
31         this.name = name;
32     }
33     public String getPassword() {
34         return password;
35     }
36     public void setPassword(String password) {
37         this.password = password;
38     }
39     public String getTelephone() {
40         return telephone;
41     }
42     public void setTelephone(String telephone) {
43         this.telephone = telephone;
44     }
45     public String getIsadmin() {
46         return isadmin;
47     }
48     public void setIsadmin(String isadmin) {
49         this.isadmin = isadmin;
50     }
51     @Override
52     public String toString() {
53         return "UserInfo [id=" + id + ", isadmin=" + isadmin + ", name=" + name
54                 + ", password=" + password + ", telephone=" + telephone + "]";
55     }
56     
57 
58 }
UserInfo.java

5、在src下的com.dao包下創建UserInfoDao.java

 1 package com.dao;
 2 
 3 import java.util.List;
 4 
 5 import com.bean.UserInfo;
 6 /**
 7  * mybatis映射文件的dao接口
 8  * @author pc
 9  *
10  */
11 public interface UserInfoDao {
12     public List<UserInfo> findAll();  //查所有
13     public UserInfo findUser(UserInfo user);//條件查詢
14     public void insertUser(UserInfo user); //插入對象
15     public void updateUser(UserInfo user); //修改對象
16     public void deleteUser(int id); //條件刪除
17 
18 }
UserInfoDao.java

6、在src下的com.dao包下創建UserInfoDao.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 3 <mapper namespace="com.dao.UserInfoDao">
 4   <select id="findAll" resultType="user">
 5     select * from userinfo
 6   </select>
 7   <select id="findUser" resultType="user" parameterType="user">
 8      select * from userinfo where name=#{name} and password=#{password}
 9   </select>
10   <insert id="insertUser" parameterType="user">
11     insert into userinfo values(seq_userinfo.nextval,#{name},#{password},#{telephone},#{isadmin})
12   </insert>
13   <update id="updateUser" parameterType="user">
14     update userinfo set name=#{name},password=#{password},telephone=#{telephone},isadmin=#{isadmin} where id=#{id}
15   </update>
16   
17   <delete id="deleteUser" parameterType="int">
18     delete from userinfo where id=#{id}
19   </delete>
20 </mapper>
UserInfoDao.xml

7、在src下創建mybatis-config.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd" >
 3 <configuration>
 4   <!-- mybatis映射文件的別名配置 -->
 5   <typeAliases>
 6     <typeAlias type="com.bean.UserInfo" alias="user"/>
 7   </typeAliases>
 8   
 9   <!-- 注冊mybatis的映射文件 -->
10   <mappers>
11     <mapper resource="com/dao/UserInfoDao.xml"/>
12   </mappers>
13 </configuration>
mybatis-config.xml

8、在src下的com.dao.impl包下創建UserInfoDaoImpl.java

  1 package com.dao.impl;
  2 
  3 import java.util.List;
  4 
  5 import org.mybatis.spring.SqlSessionTemplate;
  6 
  7 import com.bean.UserInfo;
  8 import com.dao.UserInfoDao;
  9 /**
 10  * 數據dao接口實現類
 11  * @author pc
 12  *
 13  */
 14 public class UserInfoDaoImpl implements UserInfoDao {
 15     private SqlSessionTemplate sqlSession;
 16     /**
 17      * 根據id刪除
 18      */
 19     public void deleteUser(int id) {
 20         //獲取代理對象
 21         UserInfoDao dao=sqlSession.getMapper(UserInfoDao.class);
 22         try {
 23             dao.deleteUser(id); //調用代理對象映射的dao接口刪除
 24             sqlSession.commit(); //提交事務
 25             System.out.println("刪除成功");
 26         } catch (Exception e) {
 27             System.out.println("刪除失敗");
 28             e.printStackTrace();
 29         }
 30     }
 31     /**
 32      * 查詢所有
 33      */
 34     public List<UserInfo> findAll() {
 35         //獲取代理對象
 36         UserInfoDao dao=sqlSession.getMapper(UserInfoDao.class);
 37         List<UserInfo> list=null;
 38         try {
 39              list=dao.findAll();
 40             System.out.println("查詢所有成功");
 41         } catch (Exception e) {
 42             System.out.println("查詢所有失敗");
 43             e.printStackTrace();
 44         }
 45         return list;
 46     }
 47     
 48     /**
 49      * 條件查詢
 50      */
 51     public UserInfo findUser(UserInfo user) {
 52         //獲取代理對象
 53         UserInfoDao dao=sqlSession.getMapper(UserInfoDao.class);
 54         UserInfo userinfo=null;
 55         try {
 56             if(user!=null){
 57                 userinfo=dao.findUser(user);
 58                 System.out.println("條件查詢成功");
 59             }else{
 60                 System.out.println("條件查詢參數為空");
 61             }
 62         } catch (Exception e) {
 63             System.out.println("條件查詢失敗");
 64             e.printStackTrace();
 65         }
 66         return userinfo;
 67     }
 68 /**
 69  *添加
 70  */
 71     public void insertUser(UserInfo user) {
 72         //獲取代理對象
 73         UserInfoDao dao=sqlSession.getMapper(UserInfoDao.class);
 74         try {
 75             if(user!=null){
 76                 dao.insertUser(user); 
 77                 sqlSession.commit(); //提交事務
 78                 System.out.println("添加成功");
 79             }else{
 80                 System.out.println("添加參數為空");
 81             }
 82         } catch (Exception e) {
 83             System.out.println("添加失敗");
 84             e.printStackTrace();
 85         }
 86         
 87     }
 88    /**
 89     * 修改對象
 90     */
 91     public void updateUser(UserInfo user) {
 92         //獲取代理對象
 93         UserInfoDao dao=sqlSession.getMapper(UserInfoDao.class);
 94         try {
 95             if(user!=null){
 96                 dao.updateUser(user); 
 97                 sqlSession.commit(); //提交事務
 98                 System.out.println("修改成功");
 99             }else{
100                 System.out.println("修改參數為空");
101             }
102         } catch (Exception e) {
103             System.out.println("修改失敗");
104             e.printStackTrace();
105         }
106     }
107 public SqlSessionTemplate getSqlSession() {
108     return sqlSession;
109 }
110 public void setSqlSession(SqlSessionTemplate sqlSession) {
111     this.sqlSession = sqlSession;
112 }
113 
114     
115 }
UserInfoDaoImpl.java

9、在src下的com.service包下創建UserInfoService.java

 1 package com.service;
 2 
 3 import java.util.List;
 4 
 5 import com.bean.UserInfo;
 6 /**
 7  * 服務接口
 8  * @author pc
 9  *
10  */
11 public interface UserInfoService {
12     public List<UserInfo> findAll();  //查所有
13     public UserInfo findUser(UserInfo user);//條件查詢
14     public void insertUser(UserInfo user); //插入對象
15     public void updateUser(UserInfo user); //修改對象
16     public void deleteUser(int id); //條件刪除
17 
18 
19 }
UserInfoService.java

9、在src下的com.service.impl包下創建UserInfoServiceImpl.java

 1 package com.service.impl;
 2 
 3 import java.util.List;
 4 
 5 import com.bean.UserInfo;
 6 import com.dao.UserInfoDao;
 7 import com.dao.impl.UserInfoDaoImpl;
 8 import com.service.UserInfoService;
 9 
10 public class UserInfoServiceImpl implements UserInfoService{
11     //引入數據層接口
12     UserInfoDao dao=new UserInfoDaoImpl();
13     /**
14      * 刪除
15      */
16     public void deleteUser(int id) {
17          dao.deleteUser(id);
18     }
19     /**
20      * 查所有
21      */
22     public List<UserInfo> findAll() {
23         return dao.findAll();
24     }
25   /**
26    * 條件查詢
27    */
28     public UserInfo findUser(UserInfo user) {
29         return dao.findUser(user);
30     }
31    /**
32     * 插入對象
33     */
34     public void insertUser(UserInfo user) {
35         dao.insertUser(user);
36     }
37     /**
38      * 修改對象
39      */
40     public void updateUser(UserInfo user) {
41         dao.updateUser(user);
42     }
43     
44     
45     public UserInfoDao getDao() {
46         return dao;
47     }
48     public void setDao(UserInfoDao dao) {
49         this.dao = dao;
50     }
51 
52 }
UserInfoServiceImpl.java

10、在src下的com.action包下創建UserInfoAction.java

 1 package com.action;
 2 
 3 import com.bean.UserInfo;
 4 import com.opensymphony.xwork2.Action;
 5 import com.opensymphony.xwork2.ActionSupport;
 6 import com.service.UserInfoService;
 7 import com.service.impl.UserInfoServiceImpl;
 8 /**
 9  *
10  * @author pc
11  * ActionSupport可以最數據校驗
12  */
13 public class UserInfoAction extends ActionSupport  {
14 
15     /**
16      * 引用服務層對象
17      */
18     private UserInfoService service=new UserInfoServiceImpl();
19     /**
20      * 對象用於接收請求中的值
21      * 必須創建setter和getter方法,代理對象才能獲取或設置
22      */
23     private UserInfo user;
24     /**
25      * 登錄
26      * @return
27      */
28     public String login(){
29         
30         if(user!=null){
31             System.out.println("登錄表單值接收到");
32             UserInfo userinfo=service.findUser(user);
33             if(userinfo!=null){
34                 System.out.println("登錄陳宮");
35                 return SUCCESS;
36                 
37             }else{
38                 return ERROR;
39             }
40             
41             
42         }else{
43             System.out.println("登錄表單值沒有接收到");
44             return ERROR;
45             
46         }
47     }
48     
49     /**
50      * 注冊
51      * @return
52      */
53     public String register(){
54         if(user!=null){
55             System.out.println("注冊表單值接收到");
56             service.insertUser(user);
57             System.out.println("action注冊成功");
58             return SUCCESS;
59             
60         }else{
61             System.out.println("注冊表單值沒有接收到");
62             return ERROR;
63             
64         }
65     }
66 
67     public UserInfoService getService() {
68         return service;
69     }
70 
71     public void setService(UserInfoService service) {
72         this.service = service;
73     }
74 
75     public UserInfo getUser() {
76         return user;
77     }
78 
79     public void setUser(UserInfo user) {
80         this.user = user;
81     }
82    
83     
84 
85 }
UserInfoAction.java

11、在src下創建applicationContext.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
 3   <!-- 1.配置數據源 -->
 4   <bean id="oracleDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
 5     <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
 6     <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
 7     <property name="username" value="scott"/>
 8     <property name="password" value="tiger"/>
 9   </bean>
10   
11   <!-- 3.事務管理session工廠 -->
12   <!-- 事務配置 -->
13     <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
14         <property name="dataSource" ref="oracleDataSource"/>
15     </bean>
16   
17   <!--2.在sqlSessionFactory中注入數據源  -->
18   <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
19      <!-- 注入數據源 -->
20      <property name="dataSource" ref="oracleDataSource"/>
21      
22      <!-- 引用mybatis的主配置文件,(注冊dao映射文件) -->
23      <property name="configLocation">
24        <value>classpath:mybatis-config.xml</value>
25      </property>
26   </bean>
27   
28   
29   
30   <!-- 3.用構造獲取sqlSessionTemplate -->
31   <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
32      <constructor-arg ref="sqlSessionFactory"/>
33   </bean>
34   
35   <!-- 4.dao注入sqlSesson -->
36   <bean id="userdao" class="com.dao.impl.UserInfoDaoImpl">
37     <property name="sqlSession" ref="sqlSessionTemplate"/>
38   </bean>
39   
40   <!-- 5.service注入dao -->
41   <bean id="servicedao" class="com.service.impl.UserInfoServiceImpl">
42     <property name="dao" ref="userdao"/>
43   </bean>
44   
45   <!-- 6.在Action中注入service -->
46   <bean id="userAction" class="com.action.UserInfoAction">
47     <property name="service" ref="servicedao"/>
48   </bean>
49 </beans>
applicationContext.xml

12、在src下創建struts.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "struts-2.1.dtd" >
 3 <struts>
 4   <!-- 中文亂碼處理 -->
 5   <constant name="struts.i18n.encoding" value="UTF-8"/>
 6     
 7     
 8     <package name="default" namespace="/" extends="struts-default">
 9     
10         
11        <!-- method是對應action類的有返回值的方法名 -->
12         <!-- 登錄,注冊,通配符設置,動態調用方法,*表示Login或register -->
13         <action name="*" class="userAction" method="{1}">
14           <result name="input">{1}.jsp</result>
15           <result name="success">success.jsp</result>
16           <result name="error">error.jsp</result>      
17        </action>
18         
19         
20     </package>
21 </struts>
struts.xml

13、編輯WebRoot下的WEB-INF下的web.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 3     <context-param>
 4       <param-name>contextConfigLocation</param-name>
 5       <param-value>classpath:applicationContext.xml</param-value>
 6     </context-param>
 7      <listener>
 8       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 9     </listener>
10     <filter>
11         <filter-name>struts2</filter-name>
12         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
13     </filter>
14 
15     <filter-mapping>
16         <filter-name>struts2</filter-name>
17         <url-pattern>/*</url-pattern>
18     </filter-mapping>
19 
20     <welcome-file-list>
21         <welcome-file>login.jsp</welcome-file>
22     </welcome-file-list>
23 
24 </web-app>
web.xml

14、在WebRoot下創建register.jsp

 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24     <center>
25       <fieldset style="width:400px;">
26         <legend>注冊</legend>
27         <form action="registerUser.action" method="post">
28             <table>
29               <tr>
30                   <td>用戶名:</td>
31                   <td><input type="text" name="user.name"/></td>
32               </tr>
33               <tr>
34                    <td>密碼:</td>
35                    <td><input type="password" name="user.password"/></td>
36                </tr>
37               <tr>
38                    <td>電話號碼:</td>
39                    <td><input type="text" name="user.telephone"/></td>
40                </tr>
41               <tr>
42                    <td>是否是管理員:</td>
43                    <td>
44                    <input type="radio" name="user.isadmin" value="是">
45                    <input type="radio" name="user.isadmin" value="否" checked="checked"/>
46                    </td>
47                </tr>
48               <tr>
49                    <td><input type="submit" value="提交"/></td>
50                    <td><input type="reset" value="重置"/></td>
51                </tr>
52             </table>
53         
54         </form>
55       </fieldset>
56     </center>
57   </body>
58 </html>
register.jsp

15、在WebRoot下創建login.jsp

 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24     <center>
25       <fieldset style="width:400px;">
26         <legend>登錄</legend>
27         <form action="login.action" method="post">
28             <table>
29               <tr>
30                   <td>用戶名:</td>
31                   <td><input type="text" name="user.name"/></td>
32               </tr>
33               <tr>
34                    <td>密碼:</td>
35                    <td><input type="password" name="user.password"/></td>
36                </tr>
37               <tr>
38                    <td><input type="submit" value="提交"/></td>
39                    <td><input type="reset" value="重置"/></td>
40                </tr>
41             </table>
42         
43         </form>
44       </fieldset>
45     </center>
46   </body>
47 </html>
login.jsp

16、在WebRoot下創建success.jsp

 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 <%@taglib uri="/struts-tags" prefix="s"%>
 3 <%
 4 String path = request.getContextPath();
 5 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 6 %>
 7 
 8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 9 <html>
10   <head>
11     <base href="<%=basePath%>">
12     
13     <title>My JSP 'index.jsp' starting page</title>
14     <meta http-equiv="pragma" content="no-cache">
15     <meta http-equiv="cache-control" content="no-cache">
16     <meta http-equiv="expires" content="0">    
17     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
18     <meta http-equiv="description" content="This is my page">
19     <!--
20     <link rel="stylesheet" type="text/css" href="styles.css">
21     -->
22   </head>
23   
24   <body>
25    <h1>操作成功</h1>
26    <s:if test="user.name eq 'holly'">
27       holly你來啦?
28    </s:if>
29    <s:else>
30       我不認識你?你是誰?
31    </s:else>       
32   </body>
33 </html>
success.jsp

17、在WebRoot下創建error.jsp

 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24       操作失敗!
25   </body>
26 </html>
error.jsp

18、運行

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <base href="<%=basePath%>">        <title>My JSP 'index.jsp' starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0">    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">-->  </head>    <body>    <center>      <fieldset style="width:400px;">        <legend>注冊</legend>        <form action="registerUser.action" method="post">        <table>          <tr>              <td>用戶名:</td>              <td><input type="text" name="user.name"/></td>          </tr>          <tr>               <td>密碼:</td>               <td><input type="password" name="user.password"/></td>           </tr>          <tr>               <td>電話號碼:</td>               <td><input type="text" name="user.telephone"/></td>           </tr>          <tr>               <td>是否是管理員:</td>               <td>               <input type="radio" name="user.isadmin" value="是">               <input type="radio" name="user.isadmin" value="否" checked="checked"/>               </td>           </tr>          <tr>               <td><input type="submit" value="提交"/></td>               <td><input type="reset" value="重置"/></td>           </tr>        </table>                </form>      </fieldset>    </center>  </body></html>




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM