Sun ONE logo      Previous      Index      Next     

Sun ONE Web Server 6.1 Programmer's Guide to Web Applications

Contents


About This Guide
Who Should Use This Guide
Using the Documentation
How This Guide Is Organized
Documentation Conventions
Product Support

Chapter 1   Web Applications
Introducing Web Applications
Servlets
JavaServer Pages (JSP)
SHTML
CGI
Creating a Web Application
Securing a Web Application
Deploying a Web Application
Virtual Servers
Default Web Applications
Servlet and JSP Caching
Database Connection Pooling
Configuring the Web Container
Web Application Samples

Chapter 2   Using Servlets
About Servlets
Servlet Data Flow
Servlet Types
Creating Servlets
Creating the Class Declaration
Overriding Methods
Overriding Initialize
Overriding Destroy
Overriding Service, Get, and Post
Accessing Parameters and Storing Data
Handling Sessions and Security
Handling Threading Issues
Delivering Client Results
Creating a Servlet Response Page
Creating a JSP Response Page
Invoking Servlets
Calling a Servlet with a URL
Calling a Servlet Programmatically
Servlet Output
Caching Servlet Results
Caching Features
Default Cache Configuration
Caching Example
CacheHelper Interface
CacheKeyGenerator Interface
Maximizing Servlet Performance

Chapter 3   Using JavaServer Pages
Introducing JSPs
Creating JSPs
Designing for Ease of Maintenance
Designing for Portability
Handling Exceptions
Compiling JSPs: The Command-Line Compiler
Package Names Generated by the JSP Compiler
Other JSP Configuration Parameters
Debugging JSPs
JSP Tag Libraries and Standard Portable Tags
JSP Cache Tags
cache
flush
JSP Search Tags
<searchForm>
<CollElem>
<collection>
<colIItem>
<queryBox>
<submitButton>
<formAction>
<formSubmission>
<formActionMsg>
<Search>
<resultIteration>
<Item>
<resultStat>
<resultNav>

Chapter 4   Session Managers
Introducing Sessions
Sessions and Cookies
Sessions and URL Rewriting
Sessions and Security
How to Use Sessions
Creating or Accessing a Session
Examining Session Properties
Binding Data to a Session
Binding Notification with HttpSessionBindingListener
Invalidating a Session
Invalidating a Session Manually
Setting a Session Timeout
Session Managers
StandardManager
Enabling StandardManager
Manager Properties for StandardManager
PersistentManager
Enabling PersistentManager
Manager Properties for PersistentManager
IWSSessionManager
Enabling IWSSessionManager
Manager Properties for IWSSessionManager
Source Code for IWSSessionManager
MMapSessionManager (UNIX Only)
Enabling MMapSessionManager
Manager Properties for MMapSessionManager

Chapter 5   Securing Web Applications
Sun ONE Web Server Security Goals
Security Responsibilities Overview
Application Developer
Application Assembler
Application Deployer
Common Security Terminology
Authentication
Authorization
Realms
J2EE Application Role Mapping
Container Security
Programmatic Security
Declarative Security
Sun ONE Web Server-specific Security Features
Sun ONE Web Server Security Model
ACL-based Authentication and Authorization
J2EE/Servlet-based Authentication and Authorization
Web Application and URL Authorizations
User Authentication by Servlets
HTTP Basic Authentication
SSL Mutual Authentication
Form-Based Login
User Authentication for Single Sign-on
User Authorization by Servlets
Defining Roles
Defining Servlet Authorization Constraints
Fetching the Client Certificate
Realm Configuration
File
LDAP
Solaris
Certificate
Custom Realm
Native Realm
Programmatic Login
Precautions
Granting Programmatic Login Permission
The ProgrammaticLogin Class
Enabling the Java Security Manager
The server.policy File
Default Permissions
Changing Permissions for an Application
For More Information

Chapter 6   Deploying Web Applications
Web Application Structure
Creating Web Deployment Descriptors
Deploying Web Applications
Using the Administration Interface
Deploying a Web Application using wdeploy
Using Sun ONE Studio
Enabling and Disabling Web Applications
Using the Administration Interface
Editing the server.xml File
Dynamic Reloading of Web Applications
Classloaders
The sun-web-app_2_3-1.dtd File
Subelements
Data
Attributes
Elements in the sun-web.xml File
General Elements
sun-web-app
property
description
Security Elements
security-role-mapping
servlet
servlet-name
role-name
principal-name
group-name
Session Elements
session-config
session-manager
manager-properties
store-properties
session-properties
cookie-properties
Reference Elements
resource-env-ref
resource-env-ref-name
resource-ref
res-ref-name
default-resource-principal
name
password
jndi-name
Caching Elements
cache
cache-helper
default-helper
cache-mapping
url-pattern
cache-helper-ref
timeout
refresh-field
http-method
key-field
constraint-field
value
Classloader Elements
class-loader
JSP Elements
jsp-config
Internationalization Elements
parameter-encoding
locale-charset-info
locale-charset-map
Alphabetical List of sun-web.xml Elements
Sample Web Application XML Files
Sample web.xml File
Sample sun-web.xml File

Chapter 7   Debugging Web Applications
Enabling Debugging
Using the Administration Interface
Editing the server.xml File
JPDA Options
Using Sun ONE Studio for Debugging
Debugging JSPs
Generating a Stack Trace for Debugging
Logging
Using the Administration Interface
Editing the server.xml File
Profiling
The HPROF Profiler
The Optimizeit Profiler

Appendix A   Internationalization Issues
Servlets
Servlet Request
Servlet Response
JSPs

Appendix B   Migrating Legacy Servlets
JSP by Extension
Servlet by Extension of Servlet by Directory
Registered Servlets

Index


Previous      Index      Next     


Copyright 2004 Sun Microsystems, Inc. All rights reserved.