SWE 642: Java Server Page Examples


Current date and time

  1. Run the JSP
  2. Current date and time source
  3. Java version

Count to 10

  1. Run the JSP
  2. JSP source

Printing letters in black and white

  1. Run the JSP
  2. Print letters JSP source

Printing letters in color

  1. Run the JSP
  2. Letter print JSP source
  3. AlphabetCode bean source

Demonstration of Java Bean use

  1. HTML page
  2. JSP source
  3. Language Bean source
  4. Short installation script example

Computing GPAs—All in one JSP

  1. Run the JSP
  2. JSP source

Computing GPAs—With a Java "bean"

  1. Run the JSP
  2. JSP source
  3. GPA source

Counting in different scopes

  1. Run the JSP
  2. JSP source
  3. Java version of JSP
  4. Counter Bean source
  5. Forwarding, session and application scopes

Fibonacci Series

  1. Run the JSP
  2. JSP source
  3. Bean
  4. Exception handler

Fibonacci Series with bug

  1. Run the JSP
  2. JSP source
  3. Bean

HT Gold's forwarding examples

What happens if we print, then flush(), then forward to another component?

See Kurniawan, pg 79.

  1. Forwarding after a flush    source
  2. No forwarding after a flush    source
  3. No flushing, then forwarding    source
    The next one was suggested by Jing Jin and implemented by Robert Pond, Spring 2009.
  4. No flushing, sleep, then forwarding    source
    The next one was suggested by Jing Jin and Robert Pond and implemented byJeff Offutt, Spring 2009.
  5. No flushing, then forward to a partial date    source    source

File Viewer (from book)

  1. Run the JSP
  2. JSP source
  3. Bean

Student Information System

  1. Run info    info source
  2. Run email    email source
  3. Run grade    grade source
  4. Bean source
  5. Login    login source
  6. Info form
  7. Design (PDF)
  8. Servlet components:
    1. See the form
    2. studInfoSysDemo.java
    3. studEntryDemo.java
    4. parserXMLDemo.java

Resources