web.xml配置servlet
现有的servlet的配置如下:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.momentek.ums.mms.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
我们总监写了一个servlet的代理类,我们在WEB-INF/classes下面建web文件夹,在把代理类放进去(代理类是*.class的文件),要在web.xml怎样进行配置,使代理类和程序关联起来?知道的请给我把具体的web.xml这里的配置写一下,谢谢!
[解决办法]
如果代理类是Proxy.class的文件
那么在web.xml里添加如下代码
<servlet><servlet-name>proxy</servlet-name><servlet-class>web.Proxy</servlet-class></servlet><servlet-mapping><servlet-name>proxy</servlet-name><url-pattern>*</url-pattern></servlet-mapping>
[解决办法]
<servlet> <servlet-name>proxy</servlet-name> <servlet-class>web.ServletProxy</servlet-class> <init-param> <param-name>proxyHost</param-name> <param-value>192.168.18.162</param-value> </init-param> <init-param> <param-name>proxyPort</param-name> <param-value>8080</param-value> </init-param> <init-param> <param-name>proxyPath</param-name> <param-value>/mms</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>proxy</servlet-name> <url-pattern>/mms/*</url-pattern> </servlet-mapping>