Java Server Pages (JSP) 11-08-2013 - FTP Directory Listing

6 downloads 53 Views 716KB Size Report
Nov 8, 2013 ... 03: HelloDate JSP. 04: . 05: . 06:

HelloDate JSP

. 07:

The current time is: 08:


Java Server Pages (JSP)

11-08-2013

 JSP  JavaBeans Read:

 Java

EE Tutorial on Servlets & JSP

 Java

EE API

● Section 17 Java ● Tutorial on JSP

Servlet Technology

Exam#2 is scheduled for Tues., Nov. 19, 7:00 pm, Snell 213 review session: Monday, 11/11, 5:30 to 7:00 pm, ITL

Environment variables  CATALINA_HOME  path

to the directory where tomcat is installed

(e.g. C:\apache-tomcat-7.0.23)

 JAVA_HOME  path

to the Java JDK

(e.g. C:\Program files\Java\jkd1.7.0_09)

 JRE_HOME  path

to the Java Runtime Environment

(e.g. C:\Program Files\Java\jre7)

Two of the subfolders in $CATALINA_HOME are:  bin

– startup and shutdown  webapps – docs and examples

GET /hello.jsp

Hello.jsp

HelloServlet.java

Hello!

Server w/ JSP Container

HelloServlet.class

01: 02: 03: HelloDate JSP 04: 05: 06:

HelloDate JSP

07:

The current time is: 08: 09:

10: 11: Where you put this file is very important!

$CATALINA_BASE

cs242

1. Type the JSP file into a text editor 2. If you use Tomcat, you may want to create a subdirectory for the JSP file in $CATALINA_HOME\webapps c:\apache-tomcat-7.0.23\webapps\cs242 4. Place the date.jsp file into that directory 5. Startup Tomcat 6. Point your browser to localhost:8080/cs242/date.jsp

1. Build a directory tree separate from tomcat’s webproject1

servlet source code

src

hello.java

classes

deployment descriptor

etc

web.xml

 Extensible Markup Language (XML) is a  cross-platform,

extensible, text-based standard for representing data. Parties that exchange XML data can create their own tags to describe the data, set up schemas to specify which tags can be used in a particular kind of XML document, and use XML style sheets to manage the display and handling of the data.  For example, a web service can use XML and a schema to produce price lists, and companies that receive the price lists and schema can have their own style sheets to handle the data in a way that best suits their needs.