Download presentation
Presentation is loading. Please wait.
Published byHarold McCoy Modified over 9 years ago
1
Core basic Java web server technologies
2
Tools Eclipse IDE for Java EE Developers (Netbeans also works) http://www.eclipse.org/dow nloads/packages/eclipse- ide-java-ee- developers/keplersr2 Application server (e.g. Tomcat, GlassFish) https://tomcat.apache.org/ download-80.cgi#8.0.28
5
Create a dynamic web project
6
JSPs (Java Servlet Pages) JSPs are one of the core building blocks of Java web applications, allowing us to combine HTML and Java seamlessly JSP lifecycle: http://www.tutorialspoint.com/jsp/jsp_life_cycle.htmhttp://www.tutorialspoint.com/jsp/jsp_life_cycle.htm We can embed Java code into JSP with scriptlet tags
8
<% java.util.Date today = new java.util.Date(); String mess = "Today is "+today; %> Or <% java.util.Date today = new java.util.Date(); String mess = "Today is "+today; out.println(mess); %> Output Press CTRL+Space Scriplets
9
For deployment
11
Steps for deployment on your local computer Right-click on the project->Export->WAR Copy the war file into webapps folder from your Tomcat installation folder Close the Tomcat from Eclipse and open it from Startup You should be able to see the results when calling your web application from localhost You can deploy your web application for free on https://www.openshift.com, Google App Engine, etc by uploading your war
12
How to import Java classes into JSPs
13
How to retrieve parameters from the URL in JSPs
14
Java Servlet A servlet is a Java class that runs in an "application server" and sends web pages back to a browser when a user somewhere in the world clicks on a URL.
17
To get some URL parameters…
18
Work with scriplets and HTML
19
The include directive vs the include jsp tag Static include includes smth into the page, before compiling and sending it to the browser (directive) Dynamic include takes place at runtime (jsp tag)
20
Going from jsp page/servlet to another jsp page/servlet In forward, you see the content of your forwarded page, but the url of the initial page. In redirect, you see for a second the content of your initial page, then you see your redirected page and, also, its url.
21
Declaration tag
22
Summary of JSP tags so far…
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.