SlideServe
Menu
Préférences
© SlideServe · v2026

Web development with Java Server Pages (JSP) and Servlets

csilla avatar
6 diapositives · 230 Views · Oct 03, 2014

Web development with Java Server Pages (JSP) and Servlets. Julien Thibault / Phil Brewster / Kristina Doing-Harris Julien.thibault@utah.edu. Web development. Web development includes

Web development with Java Server Pages (JSP) and Servlets - slide 1
01 / 6Web development with Java Server Pages (JSP) and Servlets
1 / 17

Télécharger la présentation

Web development with Java Server Pages (JSP) and Servlets
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Web developmentwith Java Server Pages (JSP) and Servlets Julien Thibault / Phil Brewster / Kristina Doing-Harris Julien.thibault@utah.edu

  2. Web development • Web development includes • web design, web content development, client liaison, client-side/server-side scripting, web server and network security configuration, e-commerce… • Limitations of “static” HTML • HTML only structures data (text, pictures, media) for rendering in the browser • The hosting web server just send the HTML file as is to the user • Does not natively offers ways to interface with data sources (e.g. Databases) • Dynamic web through server-side code • A web server dynamically generates a web page based on the user request • The user’s request is processed on the server-side, and HTML is generated accordingly to represent the response, then finally sent back to the user. • Many technologies and languages available • Microsoft .NET, Java Server Pages • CGI, PHP, ColdFusion

  3. Java Server Pages and Servlets • Java Servlets • Java Classes used to process HTTP requests • Hosted by the web server (typically Apache Tomcat) • Good technology choice if you want to reuse existing Java libraries • Java Server Pages (JSP) • Java technology used to embed server-side code directly into the web page • When the JSP pages are deployed, the server compiles them and creates the corresponding Servlets. • JSP example: • Server-side code is surrounded by the <%and%> tags <html> <head>Hello world test</head> <body> Hello World! <%= new java.util.Date() %> </body> </html>

  4. Using JSP in Eclipse JEE • Open Eclipse JEE and create a new Dynamic Web Project (e.g. helloproject) • The project should include the following folders: • Java Resources/src/: where you put your Java classes (including servlets) • WebContent/: where you put your web pages (html/jsp), and other web content (pictures, CSS) • WebContent/WEB-INF/lib: where you put your Java libraries (jar files) • To create a new JSP page: • Right-click on WebContent/ -> New -> JSP file (e.g. create hello.jsp from previous slide) • To create a new Servlet • Right-click on JavaResources/src/ folder -> New -> Servlet • To deploy your web application • Right-click on the project folder -> Export -> WAR file • Destination: the webapps/ folder of your Apache Tomcat install (e.g. C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\) • The project will be packaged into a WAR file (Web application ARchive) and deployed onto the server • Now you should be able to access you web app at http://localhost:8080/helloproject/hello.jsp

  5. Use CHPC to host your JSP page Connecting to CHPC • Host: sanddunearch.chpc.utah.edu • Login: uNID • Password: uNID password Hosting your JSP pages 1. Create a public_jsp folder in your home directory 2. Copy your web page to that folder (scp command or WinSCP) 3. Now you can access your webpage at: http://webapps.chpc.utah.edu/~[uNID]/[page_name] Ex: http://webapps.chpc.utah.edu/~u0668260/index.jsp Note: if you just copy the WAR file to that folder, it might take a few minutes to actually deploy.

  6. JSP tutorials