﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-eagames-随笔分类-Struts</title><link>http://www.blogjava.net/eagames/category/4043.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 03 Mar 2007 09:08:33 GMT</lastBuildDate><pubDate>Sat, 03 Mar 2007 09:08:33 GMT</pubDate><ttl>60</ttl><item><title>Struts+Spring+Hibernate练习</title><link>http://www.blogjava.net/eagames/archive/2005/11/22/21037.html</link><dc:creator>EA_Games</dc:creator><author>EA_Games</author><pubDate>Tue, 22 Nov 2005 13:40:00 GMT</pubDate><guid>http://www.blogjava.net/eagames/archive/2005/11/22/21037.html</guid><wfw:comment>http://www.blogjava.net/eagames/comments/21037.html</wfw:comment><comments>http://www.blogjava.net/eagames/archive/2005/11/22/21037.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/eagames/comments/commentRss/21037.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/eagames/services/trackbacks/21037.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">环境：<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Windows2003<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">jdk<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:chsdate Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False" w:st="on">1.5.05</st1:chsdate><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">Eclipse3.1+MyEclipse4.03<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">做一登录练习。<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">现已经完成了<SPAN lang=EN-US>login</SPAN>的<SPAN lang=EN-US>struts</SPAN>部份，实现了动态<SPAN lang=EN-US>ActionForm</SPAN>和动态<SPAN lang=EN-US>validator</SPAN>验证，详细全部文件内容如下：<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">struts-config.xml</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "<A href="http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><FONT color=#8d8c8c>http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd</FONT></A>"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;struts-config&gt;<BR>&nbsp; &lt;data-sources /&gt;<BR>&nbsp; &lt;form-beans &gt;<BR>&nbsp;&nbsp;&nbsp; &lt;form-bean name="loginForm" type="org.apache.struts.validator.DynaValidatorForm"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;form-property name="password" type="java.lang.String" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;form-property name="username" type="java.lang.String" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/form-bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;/form-beans&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;global-exceptions /&gt;<BR>&nbsp; &lt;global-forwards &gt;<BR>&nbsp;&nbsp;&nbsp; &lt;forward name="indexGo" path="/index.jsp" /&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;/global-forwards&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;action-mappings &gt;<BR>&nbsp;&nbsp;&nbsp; &lt;action<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attribute="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input="/login.jsp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; path="/login"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope="request"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validate="true"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="com.test.struts.action.LoginAction" /&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;/action-mappings&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;message-resources parameter="com.test.struts.ApplicationResources" /&gt;<BR>&nbsp; &lt;plug-in className="org.apache.struts.validator.ValidatorPlugIn"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /&gt;<BR>&nbsp; &lt;/plug-in&gt;<BR>&lt;/struts-config&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">login.jsp</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;%@ page language="java" contentType="text/html; charset=UTF-8"%&gt;<BR>&lt;%@ taglib uri="<A href="http://jakarta.apache.org/struts/tags-bean"><FONT color=#8d8c8c>http://jakarta.apache.org/struts/tags-bean</FONT></A>" prefix="bean"%&gt; <BR>&lt;%@ taglib uri="<A href="http://jakarta.apache.org/struts/tags-html"><FONT color=#8d8c8c>http://jakarta.apache.org/struts/tags-html</FONT></A>" prefix="html"%&gt;<BR>&nbsp;<BR>&lt;html&gt; <BR>&nbsp;&lt;head&gt;<BR>&nbsp;&nbsp;&lt;title&gt;JSP for loginForm form&lt;/title&gt;<BR>&nbsp;&lt;/head&gt;<BR>&nbsp;&lt;body&gt;<BR>&nbsp;&nbsp;&lt;html:form action="/login"&gt;<BR>&nbsp;&nbsp;&nbsp;username : &lt;html:text property="username"/&gt;&lt;html:errors property="username"/&gt;&lt;br/&gt;<BR>&nbsp;&nbsp;&nbsp;password : &lt;html:password property="password"/&gt;&lt;html:errors property="password"/&gt;&lt;br/&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;html:submit/&gt;&lt;html:cancel/&gt;<BR>&nbsp;&nbsp;&lt;/html:form&gt;<BR>&nbsp;&lt;/body&gt;<BR>&lt;/html&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">index.jsp</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;html&gt;<BR>&nbsp; &lt;head&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;title&gt;My JSP 'index.jsp' starting page&lt;/title&gt;<BR>&nbsp; &lt;/head&gt;<BR>&nbsp; <BR>&nbsp; &lt;body&gt;<BR>&nbsp;&lt;a href="login.jsp"&gt;Login&lt;/a&gt;<BR>&nbsp; &lt;/body&gt;<BR>&lt;/html&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">LoginAction.java</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">//Created by MyEclipse Struts<BR>// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_<st1:chsdate Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False" w:st="on">4.0.1</st1:chsdate>/xslt/JavaClass.xsl<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">package com.test.struts.action;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">import javax.servlet.http.HttpServletRequest;<BR>import javax.servlet.http.HttpServletResponse;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">import org.apache.struts.action.Action;<BR>import org.apache.struts.action.ActionForm;<BR>import org.apache.struts.action.ActionForward;<BR>import org.apache.struts.action.ActionMapping;<BR>import org.apache.struts.validator.DynaValidatorForm;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">/** <BR>&nbsp;* MyEclipse Struts<BR>&nbsp;* Creation date: 10-27-2005<BR>&nbsp;* <BR>&nbsp;* XDoclet definition:<BR>&nbsp;* @struts.action path="/login" name="loginForm" input="login.jsp" scope="request" validate="true"<BR>&nbsp;*/<BR>public class LoginAction extends Action {<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;// --------------------------------------------------------- Instance Variables<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;// --------------------------------------------------------- Methods<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;/** <BR>&nbsp; * Method execute<BR>&nbsp; * @param mapping<BR>&nbsp; * @param form<BR>&nbsp; * @param request<BR>&nbsp; * @param response<BR>&nbsp; * @return ActionForward<BR>&nbsp; */<BR>&nbsp;public ActionForward execute(<BR>&nbsp;&nbsp;ActionMapping mapping,<BR>&nbsp;&nbsp;ActionForm form,<BR>&nbsp;&nbsp;HttpServletRequest request,<BR>&nbsp;&nbsp;HttpServletResponse response) {<BR>&nbsp;&nbsp;DynaValidatorForm loginForm = (DynaValidatorForm) form;<BR>&nbsp;&nbsp;// TODO Auto-generated method stub<BR>&nbsp;&nbsp;String username=(String)loginForm.get("username");<BR>&nbsp;&nbsp;String password=(String)loginForm.get("password");<BR>&nbsp;&nbsp;loginForm.set("password",null);<BR>&nbsp;&nbsp;if(username.equals("sonic")||password.equals("sonic")){<BR>&nbsp;&nbsp;&nbsp;System.out.println("AAA");<BR>&nbsp;&nbsp;&nbsp;return mapping.findForward("indexGo");<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else {<BR>&nbsp;&nbsp;&nbsp;System.out.println("BBB");<BR>&nbsp;&nbsp;&nbsp;return mapping.getInputForward();<BR>&nbsp;&nbsp;}<BR>&nbsp;}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">ApplicationResources.properties</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">prompt.username=User Name<BR>prompt.password=User Password<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">errors.required={0} is required.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">ApplicationResources_zh_CN.properties</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">prompt.username=</SPAN><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">用户名称<SPAN lang=EN-US><BR>prompt.password=</SPAN>登录密码<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">errors.required={0} </SPAN><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">是必须的<SPAN lang=EN-US>.<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">validation.xml</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;form-validation&gt;<BR>&nbsp;&lt;formset&gt;<BR>&nbsp;&nbsp;&lt;form name="loginForm"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;field property="username" depends="required"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg0 key="prompt.username" /&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/field&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;field property="password" depends="required"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg0 key="prompt.password" /&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/field&gt;<BR>&nbsp;&nbsp;&lt;/form&gt;<BR>&nbsp;&lt;/formset&gt;<BR>&lt;/form-validation&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">到此已经完成了全部代码！<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P><img src ="http://www.blogjava.net/eagames/aggbug/21037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/eagames/" target="_blank">EA_Games</a> 2005-11-22 21:40 <a href="http://www.blogjava.net/eagames/archive/2005/11/22/21037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts+Hibernate+Spring练习（续）</title><link>http://www.blogjava.net/eagames/archive/2005/11/22/21035.html</link><dc:creator>EA_Games</dc:creator><author>EA_Games</author><pubDate>Tue, 22 Nov 2005 13:39:00 GMT</pubDate><guid>http://www.blogjava.net/eagames/archive/2005/11/22/21035.html</guid><wfw:comment>http://www.blogjava.net/eagames/comments/21035.html</wfw:comment><comments>http://www.blogjava.net/eagames/archive/2005/11/22/21035.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/eagames/comments/commentRss/21035.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/eagames/services/trackbacks/21035.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">现在创建<SPAN lang=EN-US>spring</SPAN>框架<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">配置<SPAN lang=EN-US>struts-config.xml</SPAN>文件，添加（<SPAN lang=EN-US>spring</SPAN>）的插件<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" /&gt;<BR>&nbsp; &lt;/plug-in&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">修改<SPAN lang=EN-US>LoginAction</SPAN>配置</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">原：</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;action<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attribute="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input="/login.jsp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; path="/login"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope="request"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validate="true"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="com.test.struts.action.LoginAction" /&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;/action-mappings&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">改为：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;action<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attribute="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input="/login.jsp"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="loginForm"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; path="/login"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scope="request"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validate="true"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type="</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: green; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">org.springframework.web.struts.DelegatingActionProxy</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">" /&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp; &lt;/action-mappings&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">绿色字体部份为修改内容</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">这里将使用<SPAN lang=EN-US>spring</SPAN>的代理器来对<SPAN lang=EN-US>Action</SPAN>进行控制</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">当提交到<SPAN lang=EN-US>/login.do</SPAN>是将控制权交给了<SPAN lang=EN-US>spring</SPAN>，然后由<SPAN lang=EN-US>spring</SPAN>来决定是否转回到<SPAN lang=EN-US>struts</SPAN>的<SPAN lang=EN-US>Action<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">现在来配置<SPAN lang=EN-US>spring<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><A href="http://www.springframework.org/dtd/spring-beans.dtd"><FONT color=#8d8c8c>http://www.springframework.org/dtd/spring-beans.dtd</FONT></A><SPAN style="COLOR: blue">"&gt;</SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;beans&gt;<BR>&nbsp;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: green; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;bean name="/login" class="net.xiaxin.action.LoginAction" singleton="false"&gt;&lt;/bean&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: blue; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><BR>&lt;/beans&gt;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">绿色字体是关于转交控制权的配置内容</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">属性<SPAN lang=EN-US>singleton="false"</SPAN>，指明了<SPAN lang=EN-US>Action </SPAN>的实例获取方式为每次重新创建。解决了<SPAN lang=EN-US>Struts</SPAN>中令人诟病的线程安全问题（<SPAN lang=EN-US>Struts</SPAN>中，由一个<SPAN lang=EN-US>Action</SPAN>实例处理所有的请求，这就导致了类公用资源在并发请求中的线程同步问题。）（摘自<SPAN lang=EN-US>spring</SPAN>开发指南）<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">建立数据库在 </SPAN></B><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">这里我使用的是<SPAN lang=EN-US>mysql<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:chsdate Year="1899" Month="12" Day="30" IsLunarDate="False" IsROCDate="False" w:st="on">4.1.1</st1:chsdate>x</SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">CREATE TABLE `user` (<BR>&nbsp; `ID` int(11) NOT NULL auto_increment,<BR>&nbsp; `USERNAME` varchar(50) NOT NULL default '',<BR>&nbsp; `PASSWORD` varchar(50) NOT NULL default '',<BR>&nbsp; PRIMARY KEY&nbsp; (`ID`)<BR>) ENGINE=MyISAM DEFAULT CHARSET=latin1; <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">创建<SPAN lang=EN-US>Hibernate</SPAN>框架</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">使用<SPAN lang=EN-US>MyEclipse</SPAN>的数据<SPAN lang=EN-US>Database Explorer</SPAN>工具创建<SPAN lang=EN-US>User.hmb.xml</SPAN>、<SPAN lang=EN-US>AbstractUser.java</SPAN>、<SPAN lang=EN-US>User.java</SPAN>映射文件<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">创建完成后可以将自动生成的<SPAN lang=EN-US>hibernate.cfg.xml</SPAN>删除<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">创建<SPAN lang=EN-US>UserDAO.java</SPAN>、<SPAN lang=EN-US>UserDAOImp.java</SPAN></SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><B><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">修改<SPAN lang=EN-US>LoginAction.java</SPAN>文件</SPAN></B><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">，使用<SPAN lang=EN-US>userDao</SPAN>的方法来进行用户验证<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">package com.test.struts.action;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">import javax.servlet.http.HttpServletRequest;<BR>import javax.servlet.http.HttpServletResponse;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">import org.apache.struts.action.Action;<BR>import org.apache.struts.action.ActionForm;<BR>import org.apache.struts.action.ActionForward;<BR>import org.apache.struts.action.ActionMapping;<BR>import org.apache.struts.validator.DynaValidatorForm;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: green; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">import com.test.UserDAO;</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><BR>public class LoginAction extends Action {<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><BR>&nbsp;<SPAN style="COLOR: green">private UserDAO userDAO</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: green; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;public UserDAO getUserDAO() {<BR>&nbsp;&nbsp;return userDAO;<BR>&nbsp;}</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; COLOR: green; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;public void setUserDAO(UserDAO userDAO) {<BR>&nbsp;&nbsp;this.userDAO = userDAO;<BR>&nbsp;}</SPAN><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;public ActionForward execute(ActionMapping mapping, ActionForm form,<BR>&nbsp;&nbsp;&nbsp;HttpServletRequest request, HttpServletResponse response) {<BR>&nbsp;&nbsp;DynaValidatorForm loginForm = (DynaValidatorForm) form;<BR>&nbsp;&nbsp;// TODO Auto-generated method stub<BR>&nbsp;&nbsp;String username = (String) loginForm.get("username");<BR>&nbsp;&nbsp;String password = (String) loginForm.get("password");<BR>&nbsp;&nbsp;loginForm.set("password", null);<BR>&nbsp;&nbsp;<SPAN style="COLOR: green">if (userDAO.isValidUser(username,password)) {<BR>&nbsp;&nbsp;&nbsp;return mapping.findForward("indexGo");<BR>&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;return mapping.getInputForward();<BR>&nbsp;&nbsp;}<BR></SPAN>&nbsp;}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">}<BR></SPAN><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">绿色字体为修改部份<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">现在剩下最后的<SPAN lang=EN-US>spring</SPAN>配置了<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "<A href="http://www.springframework.org/dtd/spring-beans.dtd"><FONT color=#8d8c8c>http://www.springframework.org/dtd/spring-beans.dtd</FONT></A>"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;beans&gt;<BR>&nbsp;&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;<BR>&nbsp;&nbsp;&lt;property name="driverClassName"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="url"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;value&gt;jdbc:mysql://localhost:3306/test&lt;/value&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="username"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;value&gt;root&lt;/value&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="password"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;value&gt;&lt;/value&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"&gt;<BR>&nbsp;&nbsp;&lt;property name="dataSource"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref local="dataSource" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="mappingResources"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;list&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;com\test\Hibernate\User.hbm.xml&lt;/value&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/list&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="hibernateProperties"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;props&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;prop key="hibernate.dialect"&gt;net.sf.hibernate.dialect.MySQLDialect&lt;/prop&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/props&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&lt;bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"&gt;<BR>&nbsp;&nbsp;&lt;property name="sessionFactory"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref local="sessionFactory" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&lt;bean id="userDAO" class="com.test.UserDAOImp"&gt;<BR>&nbsp;&nbsp;&lt;property name="sessionFactory"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref local="sessionFactory" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&lt;bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"&gt;<BR>&nbsp;&nbsp;&lt;property name="transactionManager"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref bean="transactionManager" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="target"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref local="userDAO" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&nbsp;&lt;property name="transactionAttributes"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;props&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;prop key="insert*"&gt;PROPAGATION_REQUIRED&lt;/prop&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;prop key="get*"&gt;PROPAGATION_REQUIRED,readOnly&lt;/prop&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;prop key="is*"&gt;PROPAGATION_REQUIRED,readOnly&lt;/prop&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/props&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;&lt;bean name="/login" class="com.test.struts.action.LoginAction" singleton="false"&gt;<BR>&nbsp;&nbsp;&lt;property name="userDAO"&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;ref bean="userDAOProxy" /&gt;<BR>&nbsp;&nbsp;&lt;/property&gt;<BR>&nbsp;&lt;/bean&gt;<BR>&lt;/beans&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">现在可以进行测试了！<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P><img src ="http://www.blogjava.net/eagames/aggbug/21035.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/eagames/" target="_blank">EA_Games</a> 2005-11-22 21:39 <a href="http://www.blogjava.net/eagames/archive/2005/11/22/21035.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts1.2+Spring2.0+Hibernate3示例</title><link>http://www.blogjava.net/eagames/archive/2005/11/22/21034.html</link><dc:creator>EA_Games</dc:creator><author>EA_Games</author><pubDate>Tue, 22 Nov 2005 13:38:00 GMT</pubDate><guid>http://www.blogjava.net/eagames/archive/2005/11/22/21034.html</guid><wfw:comment>http://www.blogjava.net/eagames/comments/21034.html</wfw:comment><comments>http://www.blogjava.net/eagames/archive/2005/11/22/21034.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/eagames/comments/commentRss/21034.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/eagames/services/trackbacks/21034.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 工具：&nbsp;&nbsp;&nbsp;&nbsp;Eclipse3.1、MyEclipse4.03、Tomcat5.5.9、Properties Editor插件、MySql4.1.13&nbsp;新建工程：名称为 login&nbsp;创建Struts框架&nbsp;创建 index.jsp，增加一链接指向 login.jsp&nbsp;按下Ctrl + ...&nbsp;&nbsp;<a href='http://www.blogjava.net/eagames/archive/2005/11/22/21034.html'>阅读全文</a><img src ="http://www.blogjava.net/eagames/aggbug/21034.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/eagames/" target="_blank">EA_Games</a> 2005-11-22 21:38 <a href="http://www.blogjava.net/eagames/archive/2005/11/22/21034.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>速动画教学系列共九集，关于struts、hibernate下载</title><link>http://www.blogjava.net/eagames/archive/2005/11/22/21032.html</link><dc:creator>EA_Games</dc:creator><author>EA_Games</author><pubDate>Tue, 22 Nov 2005 13:34:00 GMT</pubDate><guid>http://www.blogjava.net/eagames/archive/2005/11/22/21032.html</guid><wfw:comment>http://www.blogjava.net/eagames/comments/21032.html</wfw:comment><comments>http://www.blogjava.net/eagames/archive/2005/11/22/21032.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/eagames/comments/commentRss/21032.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/eagames/services/trackbacks/21032.html</trackback:ping><description><![CDATA[<H1 class=block_title><A id=viewpost1_TitleUrl HREF="/oksonic/articles/14140.html"><FONT color=#ff6600>速动画教学系列共九集，关于struts、hibernate</FONT></A></H1>
<DIV class=post>
<DIV class=postcontent><STRONG>速动画教程系列第一集 Struts入门</STRONG> 
<P>下载地址：</P>
<P><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"><FONT color=#8d8c8c>http://www.ereach.cn/download/MyEclipse-Struts-01.exe</FONT></A></P><STRONG>速动画教程系列第二集 Hibernate + Struts 实例</STRONG> 
<P>下载地址：</P>
<P><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"><FONT color=#8d8c8c>http://www.ereach.cn/download/MyEclipse_Hibernate.exe</FONT></A><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></P>
<P><STRONG>速动画教程系列第三集 Struts 之 Hello Word 续</STRONG></P>
<P>实现了返回用户名称</P>
<P>下载地址：</P>
<P><A href="http://www.ereach.cn/download/struts_2.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/struts_2.rar</FONT></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></P>
<P><STRONG>速动画教程系列第四集 Struts + Hibernate + oracle</STRONG></P>
<P>使用 MyEclipse 插件创建 Hibernate + Struts + oracle 实例</P>
<P>这一集是第二集的改版，数据库改为 oracle.</P>
<P>下载地址：</P>
<P><FONT color=#0000ff><A href="http://www.ereach.cn/download/Hibernate-Oracle.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/Hibernate-Oracle.rar</FONT></A><BR><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><BR></P>
<P><STRONG><U>速动画教程系列第五集&nbsp;&nbsp;&nbsp; 第一段（共四段）&nbsp;地址薄综合实例</U></STRONG></P>
<P><U>使用Eclipse + MyEclipse + Struts + Hibernate + MySql </U></P>
<P><U>第一段下载地址：</U></P>
<P><FONT color=#0000ff><A href="http://www.ereach.cn/download/sonic005.1.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic005.1.rar</FONT></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><BR><BR></P>
<P><STRONG><U>速动画教程系列第五集&nbsp;&nbsp;&nbsp; 第二段（共四段）&nbsp;地址薄综合实例</U></STRONG></P>
<P><U>使用Eclipse + MyEclipse + Struts + Hibernate + MySql </U></P>
<P><U>第一段下载地址：</U></P>
<P><FONT color=#0000ff><A href="http://www.ereach.cn/download/sonic005.2.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic005.2.rar</FONT></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><BR><BR></P>
<P><STRONG><U>速动画教程系列第五集&nbsp;&nbsp;&nbsp; 第三段（共四段）&nbsp;地址薄综合实例</U></STRONG></P>
<P><U>使用Eclipse + MyEclipse + Struts + Hibernate + MySql </U></P>
<P><U>第一段下载地址：</U></P>
<P><A href="http://www.ereach.cn/download/sonic005.3.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic005.3.rar</FONT></A><A href="http://www.ereach.cn/download/sonic005.1.rar"></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></P></FONT><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></FONT><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A>
<P><STRONG><U>速动画教程系列第五集&nbsp;&nbsp;&nbsp; 第四段（共四段）&nbsp;地址薄综合实例</U></STRONG></P>
<P><U>使用Eclipse + MyEclipse + Struts + Hibernate + MySql </U></P>
<P><U>第一段下载地址：</U></P>
<P><A href="http://www.ereach.cn/download/sonic005.4.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic005.4.rar</FONT></A><BR><A href="http://www.ereach.cn/download/sonic005.1.rar"></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></P></FONT><BR>
<P><STRONG>速动画教程第六集 Struts 之 Tiles 框架</STRONG></P>
<P>下载地址：<A href="http://www.ereach.cn/download/sonic006.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic006.rar</FONT></A><BR><A href="http://www.ereach.cn/download/sonic005.1.rar"></A><A href="http://www.ereach.cn/download/MyEclipse_Hibernate.exe"></A></P>
<P><BR><STRONG>速动画教程系列第七集 Eclipse+MyEclipse配置<BR></STRONG><A href="http://www.ereach.cn/download/sonic007.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic007.rar<BR></FONT></A></P>
<P><BR><STRONG>速动画教程第八集&nbsp;&nbsp; Hibernate的一对多关联关系</STRONG></P>
<P>下载地址：<A href="http://www.ereach.cn/download/sonic008.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic008.rar<BR></FONT></A><BR><BR></P>
<P><STRONG>速动画教程第九集 使用Eclipse+eclipseme开发HelloWorld!</STRONG></P>
<P>下载地址：<A href="http://www.ereach.cn/download/sonic009.rar"><FONT color=#8d8c8c>http://www.ereach.cn/download/sonic009.rar</FONT></A></P><A href="http://www.ereach.cn/download/MyEclipse-Struts-01.exe"></A></DIV></DIV><img src ="http://www.blogjava.net/eagames/aggbug/21032.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/eagames/" target="_blank">EA_Games</a> 2005-11-22 21:34 <a href="http://www.blogjava.net/eagames/archive/2005/11/22/21032.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Dreamweaver和Struts的整合</title><link>http://www.blogjava.net/eagames/archive/2005/10/21/16347.html</link><dc:creator>EA_Games</dc:creator><author>EA_Games</author><pubDate>Fri, 21 Oct 2005 14:04:00 GMT</pubDate><guid>http://www.blogjava.net/eagames/archive/2005/10/21/16347.html</guid><wfw:comment>http://www.blogjava.net/eagames/comments/16347.html</wfw:comment><comments>http://www.blogjava.net/eagames/archive/2005/10/21/16347.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/eagames/comments/commentRss/16347.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/eagames/services/trackbacks/16347.html</trackback:ping><description><![CDATA[<DIV align=center>
<TABLE style="BACKGROUND: white; WIDTH: 525pt; mso-cellspacing: 0cm; mso-padding-alt: 0cm 0cm 0cm 0cm" cellSpacing=0 cellPadding=0 width=700 bgColor=white border=0>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 15pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 15pt; PADDING-BOTTOM: 15pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 15pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=left><FONT face=宋体><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">（声明：非原创！很早的时候收藏别人的，忘了出处了）<BR>使用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">开发</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">web</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">应用是非常有吸引力的，在显示层我们通常采用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">jsp</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">，当然我们编辑网页是首选工具就是</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Dreamweaver</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">，而</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Dreamweaver</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">确不能识别</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的标记库，在做网页设计时通常带来不小麻烦，没有代码提示和所见即所得的界面。下面我们将提供一个方案来解决这个问题。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><FONT face=宋体><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">1 </SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">首先在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Dreamweaver</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">中导入</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的标签库，这样在编写代码时可以出现动态代码提示。点击“编辑</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">|</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">标签库…”，在“标签库编辑器”导入</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">taglib</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">文件，在这些标签用于在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">JSP</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">文件上。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><o:p></o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<IMG height=476 alt=clip_image001.jpg src="http://www.blogjava.net/images/blogjava_net/eagames/clip_image001.jpg" width=611 border=0></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<o:p></o:p></SPAN></P>
<DIV align=center>
<TABLE style="BACKGROUND: white; WIDTH: 525pt; mso-cellspacing: 0cm; mso-padding-alt: 0cm 0cm 0cm 0cm" cellSpacing=0 cellPadding=0 width=700 bgColor=white border=0>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 15pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 15pt; PADDING-BOTTOM: 15pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 15pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><FONT face=宋体><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">2 </SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">下载“</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Animalsgroup Struts taglibs Translator</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">”，该插件可以将以</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的一些标记以图形方式显示出来，当前支持</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">html</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">和</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">bean</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">标签。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><A href="http://www.jetmaven.net/documents/j_files/ast-03.mxp" target=_blank><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: ''; mso-hansi-font-family: ''">点击此处</SPAN></A></SPAN><FONT face=宋体><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">下载插件。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">http://www.jetmaven.net/documents/j_files/ast-03.mxp<o:p></o:p></SPAN></FONT></P>
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><FONT face=宋体><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">下载后使用“</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Macromedia</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">扩展管理器”安装该插件。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><o:p></o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<IMG height=424 alt=clip_image002.jpg src="http://www.blogjava.net/images/blogjava_net/eagames/clip_image002.jpg" width=565 border=0></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<o:p></o:p></SPAN></P>
<DIV align=center>
<TABLE style="BACKGROUND: white; WIDTH: 525pt; mso-cellspacing: 0cm; mso-padding-alt: 0cm 0cm 0cm 0cm" cellSpacing=0 cellPadding=0 width=700 bgColor=white border=0>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 15pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 15pt; PADDING-BOTTOM: 15pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 15pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><FONT face=宋体><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">3 </SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">创一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">jsp</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">文件，导入相应的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">taglib</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">声明，进行设计吧。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">html</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的标签可以显示啦，和普通的设计完全一样，不过没有属性栏，你需要通过更改代码来达到显示的效果。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><o:p></o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<o:p></o:p></SPAN></P>
<DIV align=center><IMG height=367 alt=clip_image003.jpg src="http://www.blogjava.net/images/blogjava_net/eagames/clip_image003.jpg" width=611 border=0></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><SPAN lang=EN-US style="DISPLAY: none; FONT-SIZE: 9pt; FONT-FAMILY: ''; mso-hide: all">&nbsp;<o:p></o:p></SPAN></P>
<DIV align=center>
<TABLE style="BACKGROUND: white; WIDTH: 525pt; mso-cellspacing: 0cm; mso-padding-alt: 0cm 0cm 0cm 0cm" cellSpacing=0 cellPadding=0 width=700 bgColor=white border=0>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: #d4d0c8; PADDING-RIGHT: 15pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 15pt; PADDING-BOTTOM: 15pt; BORDER-LEFT: #d4d0c8; PADDING-TOP: 15pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">
<P style="LINE-HEIGHT: 16.5pt; TEXT-ALIGN: center" align=center><FONT face=宋体><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">总结：使用以上方法，确实可以给网页设计者带来不少便利，组件可以直接显示，方便我们的修改。其实有一款</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Dreamweaver</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">Struts</SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">插件，功能更强大，你可在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt">http://www.fwasi.com </SPAN><SPAN style="FONT-SIZE: 10pt; LETTER-SPACING: 1pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">查找到该插件的信息，不过是收费的。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: ''; LETTER-SPACING: 1pt"><o:p></o:p></SPAN></FONT></P></TD></TR></TBODY></TABLE></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&nbsp;<o:p></o:p></SPAN></P><img src ="http://www.blogjava.net/eagames/aggbug/16347.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/eagames/" target="_blank">EA_Games</a> 2005-10-21 22:04 <a href="http://www.blogjava.net/eagames/archive/2005/10/21/16347.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>