Presentation is loading. Please wait.

Presentation is loading. Please wait.

Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-

Similar presentations


Presentation on theme: "Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-"— Presentation transcript:

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

3

4

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

7

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

10

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.

15

16

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…


Download ppt "Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-"

Similar presentations


Ads by Google