jdon 下如何加一个servlet mapping?

08-05-09 little1234

我用了最基本的jdon + JdbcTemp 框架,没用structs.

在我的应用中,加了一个servlet。 部署上真机时, 老说 The requested URL /wap/sizePic was not found on this server.

开发环境下在jBuilder里配置好了,可以找到/sizePic。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>wap</display-name>
<context-param>
<param-name>modelmapping-config</param-name>
<param-value>com.aa.wap.jdonframework.xml</param-value>
</context-param>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>com.jdon.util.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.jdon.container.startup.ServletContainerListener</listener-class>
</listener>
<servlet>
<servlet-name>ImgProcessorSevlet</servlet-name>
<servlet-class>com.aa.wap.util.ImgProcessorSevlet</servlet-class>
</servlet>
<servlet>
<servlet-name>debugjsp</servlet-name>
<description>Added to compile JSPs with debug info</description>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>classdebuginfo</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ImgProcessorSevlet</servlet-name>
<url-pattern>/sizePic</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>debugjsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>


服务器上的web.xml 是这样的,就找不到

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>wap</display-name>
<context-param>
<param-name>modelmapping-config</param-name>
<param-value>com.aa.wap.jdonframework.xml</param-value>
</context-param>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>com.jdon.util.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>com.jdon.container.startup.ServletContainerListener</listener-class>
</listener>
<servlet>
<servlet-name>ImgProcessorSevlet</servlet-name>
<servlet-class>com.aa.wap.util.ImgProcessorSevlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImgProcessorSevlet</servlet-name>
<url-pattern>/sizePic</url-pattern>
</servlet-mapping>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>

请问这是什么问题?
急等!

little1234
2008-05-10 11:00

发完,发现不能删了。

不好意思,是自己的tomcat 和apache之间的配置有问题, 不是web.xml , 更不是jdon的问题。