strus+ajax實例--用戶註冊(1)
1.新建工程userReg
2.添加struts
3.配置struts.配置後的struts-config.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="UserForm" type="com.user.UserForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="UserForm"
input="/user/userReg.jsp"
name="UserForm"
path="/userReg"
scope="request"
type="com.user.UserReg">
<forward name="ok" path="index.jsp" />
<forward name="err" path="/user/userReg.jsp" />
</action>
<action path="/checkUser" type="com.user.CheckUser" />
</action-mappings>
<message-resources parameter="ApplicationResources" />
</struts-config>
2.添加struts
3.配置struts.配置後的struts-config.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="UserForm" type="com.user.UserForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="UserForm"
input="/user/userReg.jsp"
name="UserForm"
path="/userReg"
scope="request"
type="com.user.UserReg">
<forward name="ok" path="index.jsp" />
<forward name="err" path="/user/userReg.jsp" />
</action>
<action path="/checkUser" type="com.user.CheckUser" />
</action-mappings>
<message-resources parameter="ApplicationResources" />
</struts-config>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.