锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
緇忚繃鍑犲ぉ鐨勫姫鍔涘拰鏈嬪弸鐨勫府鍔╋紝Struts緇堜簬鎼炴竻妤氫簡
鐜 resin3.0.12+struts1.1
1銆?SPAN style="FONT: 7pt 'Times New Roman'"> Jsp錛堣鍥撅級
2銆?SPAN style="FONT: 7pt 'Times New Roman'"> actionForm
3銆?SPAN style="FONT: 7pt 'Times New Roman'"> action
4銆?SPAN style="FONT: 7pt 'Times New Roman'"> 妯″瀷
瑙嗗浘鍐呭錛?/SPAN>
鏈夋爣絳懼拰html璇█緇勬垚銆?/SPAN>
渚嬪錛?/SPAN>
<%@ include file="taglibs.jsp" %>
<%-- 鐧誨綍楠岃瘉瑙嗗浘 2005/04/27 lanlanq --%>
<html:errors/>
<html:form action="/Logon.do">
<center>
<table border="0" width="100%">
<tr>
<th align="right">
<bean:message key="prompt.username"/>
</th>
<td align="left">
<html:text property="userName" size="15" maxlength="15" />
</td>
</tr>
<tr>
<th align="right">
<bean:message key="prompt.password"/>
</th>
<td align="left">
<html:password property="password" size="15" maxlength="15" />
</td>
</tr>
<tr>
<td align="right">
<html:submit property="submit" >
<bean:message key="button.logon"/>
</html:submit>
</td>
<td align="left">
<html:reset>
<bean:message key="button.reset"/>
</html:reset>
</td>
</tr>
</table>
</center>
</html:form>
棣栧厛閰嶇疆涓涓?/SPAN>resin3.0.12
鐒跺悗鍐嶅伐紼嬬洰褰曚笅鐨?/SPAN>WEB-INF涓嬪垱寤?/SPAN>lib鏂囦歡澶癸紝澧炲姞struts鐨勬敮鎸佺被鍖?/SPAN>
鐒跺悗鍒涘緩TLD鏂囦歡
struts-bean.tld
struts-html.tld
struts-logic.tld
榪欎笁涓爣璁板簱鏂囦歡
浠ヤ究鍦?/SPAN>Jsp涓繘琛岃皟鐢ㄣ?/SPAN>
鐒跺悗鍒涘緩struts-config.xml
鍐呭濡備笅錛?/SPAN>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<!--
This is the Struts configuration file for the "Hello!" sample application
-->
<struts-config>
<!-- ======== Form Bean Definitions =================================== -->
<form-beans>
<form-bean name="HelloForm" type="hello.HelloForm"/>
<form-bean name="logonForm" type="member.forms.LogonForm"/>
</form-beans>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<!-- Say Hello! -->
<action path = "/HelloWorld"
type = "hello.HelloAction"
name = "HelloForm"
scope = "request"
validate = "true"
input = "/DateSouce/hello.jsp"
>
<forward name="SayHello" path="/DateSouce/hello.jsp" />
</action>
<action path = "/Logon"
type = "member.actions.LogonAction"
name = "logonForm"
scope = "request"
validate = "true"
input = "/DateSouce/error.jsp"
>
<forward name="Success" path="/DateSouce/sucess.jsp" />
</action>
</action-mappings>
<!-- ========== Message Resources Definitions =========================== -->
<message-resources parameter="application_ch_CN"/>
</struts-config>
榪欎釜鏂囦歡鏄湪榪愯web鏈嶅姟鍣ㄦ槸棣栧厛瑕佸幓鎵劇殑閰嶇疆鏂囦歡
鍏朵腑鐨?/SPAN>
<form-beans>
<form-bean name="HelloForm" type="hello.HelloForm"/>
<form-bean name="logonForm" type="member.forms.LogonForm"/>
</form-beans>
琛ㄧずjsp鏂囦歡鎸囧畾鐨?/SPAN>actionForm鏂囦歡
鍏朵腑鐨?/SPAN>
<action-mappings>
<!-- Say Hello! -->
<action path = "/HelloWorld"
type = "hello.HelloAction"
name = "HelloForm"
scope = "request"
validate = "true"
input = "/DateSouce/hello.jsp"
>
<forward name="SayHello" path="/DateSouce/hello.jsp" />
</action>
<action path = "/Logon"
type = "member.actions.LogonAction"
name = "logonForm"
scope = "request"
validate = "true"
input = "/DateSouce/error.jsp"
>
<forward name="Success" path="/DateSouce/sucess.jsp" />
</action>
琛ㄧずjsp涓皟鐢?/SPAN>Html:form涓殑action=Logon.do鏂囦歡鐨勬槧灝勩?/SPAN>
鍏朵腑鐨?/SPAN>name鍜?/SPAN>actionForm涓殑name淇濇寔涓鑷淬?/SPAN>
濡傛灉validate=鈥漷rue鈥?/SPAN>琛ㄧず瑕佹墽琛?/SPAN>actionForm鐨?/SPAN>validate閿欒澶勭悊銆?/SPAN>
<message-resources parameter="application_ch_CN"/>
琛ㄧず鍥介檯鏍囧噯鍖栵紝鍐?/SPAN>jsp欏甸潰涓殑鏂囧瓧璇存槑閮芥槸閫氳繃application鏂囦歡鎸囧畾銆?/SPAN>
鍒涘緩actionForm鏃舵敞鎰忥紝鍦ㄩ氳繃JBuilder鐢熸垚actionForm鏃舵敞鎰忓睘鎬у悕鍜?/SPAN>jsp涓殑灞炴у悕瀛椾繚鎸佷竴鑷達紝鐒跺悗鍒涘緩action錛屽緱execute鏂規硶錛岃繘琛岄昏緫澶勭悊銆?/SPAN>