1 / 16

Configuration Web Server Tomcat

Configuration Web Server Tomcat. Install JDK 1.6 Install Tom cat 5.5.20 Configure Tom cat for running Servlet C:Program FilesApache Software FoundationTomcat 5.5conf Open web.xml with WordPad and uncomment. <servlet> <servlet-name>invoker</servlet-name> <servlet-class>

naida-koch
Download Presentation

Configuration Web Server Tomcat

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Configuration Web Server Tomcat • Install JDK 1.6 • Install Tom cat 5.5.20 • Configure Tom cat for running Servlet C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf Open web.xml with WordPad and uncomment

  2. <servlet> • <servlet-name>invoker</servlet-name> • <servlet-class> • org.apache.catalina.servlets.InvokerServlet • </servlet-class> • <init-param> • <param-name>debug</param-name> • <param-value>0</param-value> • </init-param> • <load-on-startup>2</load-on-startup> • </servlet>

  3. <servlet-mapping> • <servlet-name>invoker</servlet-name> • <url-pattern>/servlet/*</url-pattern> • </servlet-mapping>

  4. Test Your Web Server Open IE: http://localhost:9999/ Port: 9999 Ask your friend test your web server: http://192.168.5.125:9999/

  5. Successfully

  6. Unsuccessfully

  7. Fix Web Server • Make sure you start Tomcat Service (Control Panel -> Administration Tool -> Service -> Start (Apache Tomcat Service) Make sure you type correct port

  8. First Servlet • import java.io.*; • import javax.servlet.*; • import javax.servlet.http.*; • public class HelloServlet extends HttpServlet { • public void doGet(HttpServletRequest request, • HttpServletResponse response) • throws ServletException, IOException { • response.setContentType("text/html"); • PrintWriter out = response.getWriter(); • String docType = • "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + • "Transitional//EN\">\n"; • out.println(docType + • "<HTML>\n" + • "<HEAD><TITLE>Hello</TITLE></HEAD>\n" + • "<BODY BGCOLOR=\"#FDF5E6\">\n" + • "<H1>Hello First Servlet</H1>\n" + • "</BODY></HTML>"); • } • }

  9. First Servlet Folder Location for Servlet Class file C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes If you change servlet code, you should restart the Tomcat Service to updating new code Test your Servlet: http://localhost:9999/servlet/HelloServlet

  10. First JSP • <html> • <head> • <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> • <title>First Hello JSP</title> • </head> • <body> • <% • out.println("<H1>Hello JSP </H1>"); • %> • </body> • </html>

  11. Run the first JSP Folder Location for Servlet Class file C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\hello.jsp Test your JSP File: Open IE http://localhost:9999/hello.jsp

  12. Input Class

  13. ESL Registration

  14. Student Grade / Semester

  15. ESL Registration for Officer Module

  16. Design Web Page for inputting An Employee An Employee has first name, last name, id, birthday, gender, Type of employee (Full Time or Part time), education (B.A. , Master, or Doctor)

More Related