我正在开发一个网站,我发现托管问题。我已将所有.jsp
文件放在根目录中。
我能够看到JSP(直接访问它们)。 但是,当我尝试执行相同的检查WEB-INF /类时,我收到错误:
Not Found The requested URL /AC/SearchController was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
这是我的Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>AC</display-name>
<welcome-file-list>
<welcome-file>Home.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>AdvisorProfileServlet</servlet-name>
<servlet-class>org.AC.controller.AdvisorProfileServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AdvisorProfileServlet</servlet-name>
<url-pattern>/AC/AdvisorProfilePage?aId=*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ForgotPasswordRedirectController</servlet-name>
<servlet-class>org.AC.controller.ForgotPasswordURLController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ForgotPasswordRedirectController</servlet-name>
<url-pattern>/ForgotPasswordAdvisor</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>AdvisorMyAccountRequest</servlet-name>
<servlet-class>org.AC.controller.AdvisorMyAccountRequestController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AdvisorMyAccountRequest</servlet-name>
<url-pattern>/AC/requests.jsp</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ForgotPasswordRedirectControllerUser</servlet-name>
<servlet-class>org.AC.controller.UserForgotPasswordURLController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ForgotPasswordRedirectControllerUser</servlet-name>
<url-pattern>/ForgotPasswordUser</url-pattern>
</servlet-mapping>
</web-app>
这也可能是服务器配置,因为我在Tomcat服务器8上创建了项目,但我想现在托管它的服务器是Tomcat 7。
我该如何解决这个问题?
答案 0 :(得分:0)
请声明&#34; / AC / SearchController&#34;作为web.xml中的url模式