struts关于struts.xml运行的一个小解释
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="path" extends="struts-default" namespace="/path">
<action name="path" class="com.bjsxt.struts2.path.action.PathAction">
<result name="path">/path.jsp</result>
</action>
</package>
</struts>
意思是去com.bjsxt.struts2.path.action.PathAction:
package com.bjsxt.struts2.path.action;
public class PathAction {
public String execute() {
return "path";
}
}
得到结果path,然后运行<result name="path">/path.jsp</result>,result为path应该运行的jsp,就是path.jsp