Java Server Pages JSPs - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Java Server Pages JSPs

Description:

Snippets of code written in Java (called scriptlets) Java Server Pages (JSPs) ... Just unzip the file, no installation needed. Can unzip the file anywhere ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 12
Provided by: julie387
Category:
Tags: java | jsps | pages | server | unzip

less

Transcript and Presenter's Notes

Title: Java Server Pages JSPs


1
Java Server Pages (JSPs)
  • Like Perl and PHP, Server-side scripting
  • .jsp extension
  • Similar to PHP
  • Static HTML/XML components
  • Special JSP tags lt gt
  • Snippets of code written in Java (called
    scriptlets)

2
Java Server Pages (JSPs)
  • Scriptlets written in Java
  • ? access to complete Java environment
  • ? scalability
  • ? portability

3
Java Server Pages (JSPs)
  • lthtmlgt
  • lttitlegtDemo a simple JSP programlt/titlegt
  • ltbodygt
  • lt Hello world gt
  • lt/bodygt
  • lt/htmlgt

4
Java Server Pages (JSPs)
  • JSP implicit objects
  • Among others (will visit later)
  • out, a JspWriter object that writes into the
    output stream.

5
Java Server Pages (JSPs)
  • lthtmlgt
  • lttitlegtDemo a simple JSP programlt/titlegt
  • ltbodygt
  • lt
  • out.print( Hello world )
  • gt
  • lt/bodygt
  • lt/htmlgt

6
Java Server Pages (JSPs)
  • Can run JSPs on your own computer, even without
    an Internet connection
  • Install tomcat (servlet/jsp engine)

7
Installing and running Tomcat
  • Download jakarta-tomcat-6.0.14
  • Just unzip the file, no installation needed
  • Can unzip the file anywhere

8
Installing and running Tomcat
  • Find bin directory in jakarta-tomcat-6.0.14
    directory
  • Edit the file startup.bat
  • SET JAVA_HOME c\\jdk1.6
  • // whatever your file path is for the java
  • // version installed on your computer

9
Installing and running Tomcat
  • From command line inside bin directory, start
    tomcat
  • startup
  • // that should open another window
  • // tomcat is running, you can run JSPs

10
Installing and running Tomcat
  • Open your browser and go to
  • http//localhost8080
  • 8080 is the default port so make sure it is not
    taken by another program
  • If it is, you can change tomcats default port by
    editing server.xml

11
Installing and running Tomcat
  • Your browser ends up in jakarta-tomcat-6.0.14/weba
    pps/ directory
  • From there, call a jsp file with the appropriate
    file path
Write a Comment
User Comments (0)
About PowerShow.com