文档介绍:Struts2基本使用方法:
建一个web project
导入所需要的包--à右击弹出菜单-àbulid path
3
.
,待会依照项目再进行修改。
<?xml version="" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration //EN"
"http://struts./dtds/struts-">
<struts>
<constant name="" value="false" />
<constant name="" value="false" />
<!--<include file=""/>
-->
<package name="login1" namespace="/" extends="struts-default">
<action name="loginAction" class="">
<result>/</result>
<result name="error">/</result>
</action>
</package>
</struts>
<?xml version="" encoding="UTF-8"?>
<web-app id="WebApp_9" version="" xmlns="http://java./xml/ns/j2ee" xmlns:xsi="1/XMLSchema-instance" xsi:schemaLocation="http://java./xml/ns/j2ee http://java./xml/ns/j2ee/web-">
<display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-.</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<e-file-list>
<e-file></e-file>
</e-file-list>
</web-app>
建一个jsp页面
<body>
<s:form action="" method="post">
username:<