答案 0 :(得分:0)
不,您放在WEB-INF文件夹中的所有内容都不会对您的Web应用程序的用户可用。您的层次结构看起来没问题。
答案 1 :(得分:0)
WEB-INF资源对公众不直接可见。您可以使用webservlet注释。例如;
@WebServlet(urlPatterns = {"/adminlogin", "/register"})
或servlet映射(老式),
web.xml:
<servlet>
<servlet-name>LoginController</servlet-name>
<servlet-class>yourPackage.LoginController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginController</servlet-name>
<url-pattern>/adminlogin/</url-pattern>
<url-pattern>/logout/</url-pattern>
<url-pattern>/register/</url-pattern>
<url-pattern>/userlogin/</url-pattern>
</servlet-mapping>
的LoginController
//post get method
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String userPath = request.getServletPath();
if (userPath.equals("/logout")) {
//Your Model
request.getRequestDispatcher("/WEB-INF/login.jsp").forward(request, response);
} ...
}