最近由struts1.x 转学struts2,发现变化好大,一个简单的demo都搞不定,
tomcat 访问 出现:The requested resource (/UploadSample/) is not available,,,
struts.xml配置:
web.xml配置:
具体的类已经编译通过,
什么问题呢?
tomcat 访问 出现:The requested resource (/UploadSample/) is not available,,,
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>
<package name="fileUploadDemo" extends="struts-default">
<action name="myUpload"
class="org.UploadAction">
<interceptor-ref
name="fileUpload">
<param
name="allowedTypes">
image/jpg,image/bmp,image/png,image/gif,image/jpeg
</param>
</interceptor-ref>
<interceptor-ref
name="defaultStack" />
<result name="input">
upload.jsp
</result>
<result>showUpload.jsp</result>
</action>
</package>
</struts>
web.xml配置:
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<display-name>struts2上传文件示例</display-name>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<!-- 注意顺序 -->
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>upload.jsp</welcome-file>
</welcome-file-list>
</web-app>
具体的类已经编译通过,
什么问题呢?