且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JSP所请求的资源不可用

更新时间:2022-01-30 17:33:03

<form action> URL不得指向servlet类的类文件名.它必须指向一个Web浏览器可以公开访问的URL,与您在浏览器的地址栏中输入的URL完全相同.

The <form action> URL must not point to the class file name of the servlet class. It must point to an URL which is publicly accessible by a webbrowser, exactly the one as you'd need to enter in browser's address bar.

您已将servlet映射到/LoginServletPath的URL模式上,因此http://localhost:8080/WHFM/LoginServletPath可以使用它,因此您需要相应地修复<form action> URL:

You have mapped the servlet on an URL pattern of /LoginServletPath, so it is available by http://localhost:8080/WHFM/LoginServletPath, so you need to fix your <form action> URL accordingly:

<form action="LoginServletPath">

或者,如果您希望能够在任何地方移动JSP文件而不用担心相对URL,则

or, if you prefer to be able to move your JSP file around everywhere without worrying about relative URLs,

<form action="${pageContext.request.contextPath}/LoginServletPath">


无关与具体问题


Unrelated to the concrete problem, your JDBC code is leaking resources. I'd fix that as soon as possible.