There are two methods in servlet to dispatch user requests to other web resources such as JSP, HTML, or another servlet in the same or different web applications. They are RequestDispatcher interface and HttpServletResponse‘s sendRedirect() method. RequestDispatcher is used to dispatch requests to the resource run in the same web applications, and sendRedirect() can be […]
HttpSession is used to save user session-related information. It is provided by java servlet API. When a session request comes to a servlet container, it will create a HttpSession object on the server-side and then assign a unique id to the session object. The session id will be returned back to the client browser, and
Servlet is the most important web component in the Java EE Web application. It is also the foundation of many Java EE frameworks such as Spring, JSF, Struts, etc. In this article, we will show you how to write a basic hello world servlet java program use eclipse step by step.
There are a lot of XML elements in web.xml in a web application project. And the most important two we will introduce are welcome-file-list and load-on-startup. The welcome-file-list XML element is used to display the default web page to a user when the user does not point out which page he wants to browse in URL.
Deploy or undeploy java web applications in Tomcat are very easy to handle. You can either deploy or undeploy your war file manually or use tomcat manager. This article will show you how to do that.