caucho
Resin
FAQ
Reference Guide
Demo
Tutorial
 Resin Examples

Servlets

Hello, World

Trivial page using Servlets.

Servlet Parameters

Shows the servlet environment: parameters and attributes. Servlet and application init parameters are defined in resin.conf

Basic JSP

Hello, World (Java)

hello.jsp
Example of a trivial page.
 

Environment (Java)

env.jsp
Displays information about the web request.

Counter (Java)

counter.jsp
How to implement a simple counter.

Login (Java)

web.xml, TestAuthenticator
Authentication and simple page protection.

Form (JavaScript)

form.jsp
Retrieving form information.

Session (JavaScript)

session.jsp
Information persistent between requests. Reload the page to see the state change.

Directory (JavaScript)

dir.jsp
Displays the contents of the directory.

File (JavaScript)

file.jsp
A fortune program, randomly choosing a file to display.

Navigation (JavaScript)

toc.xml  navigation.jsp  Navigation.js  header.js
Generates web page navigation automatically, using a simple XML site map file.

Tic-Tac-Toe (JavaScript)

tictactoe.jsp  score.js
A simple tic-tac-toe game with simulated intelligence. Illustrates breaking up projects into different files.

Basic XTP

Basic

basic.xtp  basic.xsl
Trivial example of using XTP to automatically rewrite <a href> to deal with non-cookie browsers.

Vary

vary.xml 
Using multiple stylesheets to vary XTP formatting.

Navigation

navigation.xtp  header.xsl  Navigation.js
Basic navigation and site headers.

Counter

counter.xtp  counter.xsl
A simple counter.

Verify

verify-bad.xtp  verify.xsl
Verifies an XTP file against an expected XML format.

JSP and XTP Templates

Simple JSP Guest Book

guestbook.jsp
A simple guest book implemented with flat JSP.

Simple XTP Guest Book

guestbook.xtp  simple-format.xsl
A simple XTP guest book with a basic XSL stylesheet.

JSP Bean Guest Book

guestbook_bean.jsp  guestbook_inc.jsp  GuestBook.java  Guest.java
Using beans and included pages to factor the guestbook.

JSP Template Guest Book

GuestJsp.java  login.jsp  add.jsp  admin.jsp
A simple guest book using JSP templates to format the results.

XTP Template Guest Book

GuestXtp.java  login.xtp  add.xtp  admin.xtp  guestbook.xsl  form.xsl
A simple guest book using XTP templates to format the results.


Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.