doGet() method in servlet run system.out.println twice

Answered

I do not why because I use Netbeans and the code works fine. Any time I wirte system.out.println("something") in the doGet() method,  the application always run twice. Here is my codes:

<welcome-file-list>
<welcome-file>TestServlet</welcome-file>
</welcome-file-list>
@WebServlet(name = "TestServlet",urlPatterns = "/TestServlet")
public class TestServlet extends HttpServlet {

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

System.out.println("something");
}
}

When I am calling hibernate save() method and run it, the hibernate code will run twice as well, just like the system call did. I have try it in several ways and I still could not figure it out. 

Are there something wrong with intellij using Tomcat ? Thank you

0

Please sign in to leave a comment.