glaringshadow 发表于 2018-10-5 19:51:41

Servlet报错,web.xml已经配置完成

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

贴下代码
package LoginServlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LoginServlet extends HttpServlet
{
       
        private static final long serialVersionUID = -5469527586751008772L;

        protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException
        {
                response.setContentType("text/html");
                PrintWriter out = response.getWriter();
                out.println("welcome to this S");
        }
       
}



web.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>

<web-app>


<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>LoginServlet.LoginServlet</servlet-class>

</servlet>


<servlet-mapping>

<servlet-name>LoginServlet</servlet-name>

<url-pattern>/LoginServlet/LoginServlet</url-pattern>

</servlet-mapping>

</web-app>

newu 发表于 2018-10-5 23:32:05

https://blog.csdn.net/dbc_121/article/details/79204340

其次推荐一篇文章《提问的智慧》https://fishc.com.cn/forum.php?mod=viewthread&tid=101875&highlight=%CC%E1%CE%CA%B5%C4%D6%C7%BB%DB

glaringshadow 发表于 2018-10-6 10:01:56

newu 发表于 2018-10-5 23:32
https://blog.csdn.net/dbc_121/article/details/79204340

其次推荐一篇文章《提问的智慧》https://fish ...

多谢啦
页: [1]
查看完整版本: Servlet报错,web.xml已经配置完成