我正在创建一个带有验证和验证码的注册应用程序(使用 SimpleCaptcha)。我能够在本地主机上部署我的应用程序,并且包括验证码在内的所有内容都可以完美运行。
但是当将war文件部署到测试服务器时,我的验证码不起作用,这是日志文件的输出:
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:111)
Servlet SimpleCaptchaServlet is currently unavailable
我确实在 web.xml 上注册了我的 SimpleCaptchaServlet,我可以找到该 Servlet 的类文件,但仍然无法找到问题所在。我可以知道如何解决此问题吗?
这是 web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>SignupProcessServlet</servlet-name>
<servlet-class>com.example.controller.SignupProcessServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SignupSuccessServlet</servlet-name>
<servlet-class>com.example.view.SignupSuccessServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SignupServlet</servlet-name>
<servlet-class>com.example.view.SignupServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SimpleCaptchaServlet</servlet-name>
<servlet-class>com.example.controller.SimpleCaptchaServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SignupProcessServlet</servlet-name>
<url-pattern>/signup_process.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SignupSuccessServlet</servlet-name>
<url-pattern>/signup_success.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SignupServlet</servlet-name>
<url-pattern>/signup.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleCaptchaServlet</servlet-name>
<url-pattern>/captchaImg</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>signup.html</welcome-file>
</welcome-file-list>
非常感谢你。