Вебсерлет показывает статус HTTP 404 — не найден ⇐ JAVA
Вебсерлет показывает статус HTTP 404 — не найден
I'm having a problem with webservlet. This is my first project and i don't know what happend but when i start project in server i can't go to "/helloworld" althought i can connect to my main url this is my class
package quangtoan.controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(asyncSupported = false,name = "HelloWorld",urlPatterns = "/helloworld") public class HelloWorld extends HttpServlet { @Override public void init() throws ServletException { // TODO Auto-generated method stub System.out.println("afjaf"); } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().append("12424124214"); } } this is my project source
enter image description here
this is the error
enter image description here
I try to find solution for 1 hour but can't do anything
Источник: https://stackoverflow.com/questions/780 ... -not-found
I'm having a problem with webservlet. This is my first project and i don't know what happend but when i start project in server i can't go to "/helloworld" althought i can connect to my main url this is my class
package quangtoan.controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(asyncSupported = false,name = "HelloWorld",urlPatterns = "/helloworld") public class HelloWorld extends HttpServlet { @Override public void init() throws ServletException { // TODO Auto-generated method stub System.out.println("afjaf"); } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.getWriter().append("12424124214"); } } this is my project source
enter image description here
this is the error
enter image description here
I try to find solution for 1 hour but can't do anything
Источник: https://stackoverflow.com/questions/780 ... -not-found
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение