![]() ![]() Set the response message's MIME type (in Content-Type response header) Public class HelloServlet extends HttpServlet void doGet(HttpServletRequest request, HttpServletResponse response) Enter the following codes for " HelloServlet.java ":."Configure Servlet Deployment" ⇒ In "Servlet Name", enter " HelloServletExample " ⇒ In "URL Pattern", enter " sayhello " ⇒ Finish."Name and Location" ⇒ In "Class Name", enter " HelloServlet " ⇒ In "Package", enter " hello " ⇒ Next.Right-click on the project " HelloServletJSP " ⇒ New ⇒ Servlet.To execute this JSP, right-click on the project ⇒ "Run". "Frameworks" ⇒ Select none for pure servlet/JSP application ⇒ Finish.Ī JSP page called " index.jsp " is automatically created, which says "Hello world!"."Server and settings" ⇒ Choose your server, or "add" a new server ⇒ Next."Name and Location" ⇒ In "Project Name", enter " HelloServletJSP " ⇒ In "Project Location", select a suitable directory to save your works ⇒ Check "Set as Main Project" ⇒ Next."Choose Project" ⇒ Under "Categories", choose "Java Web" ⇒ Under "Projects", choose "Web Application" ⇒ "Next". ![]() From "File" menu ⇒ choose "New Project.". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |