There are many ways to do this using the scope attributes Milt notes below
(though "context" scope is called "application" scope in the JSP spec) using
scriptlets (not recommended) and tags (JSTL, Struts, and custom).  See
jakarta.apache.org/struts to educate yourself.

BTW: I have all the main books.  I like Jason's best because it is the most
sophisticated.  Marty's books are very good for beginners or quick reference
for the experienced.  And then there's David Geary's "Advanced JavaServer
Pages" (Sun/Prentice Hall 2001), which does an excellent job with custom
tags, MVC/Model 2 design, database access, XML, and security.  For an
in-depth examination of JSP tags, Gal Schachor's, et al, "JSP Tag Libraries"
(Manning, 2001) even goes into Java reflection.  If you just need an
excellent overview of JSP, Servlet and J2EE technologies and how they can
interoperate, get a copy of Jim Farley's, et al, "Java Enterprise In A
Nutshell, 2d ed." (O'Reilly 2002, which, btw, is coauthored by William
Crawford, Jason's collaborator on his 1st edition).

Mark

-----Original Message-----
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 9:37 AM
To: [EMAIL PROTECTED]
Subject: Re: Passing parameters from a JSP page to a servlet


On Tue, 1 Oct 2002, Kenny G. Dubuisson, Jr. wrote:

> Can you pass parameters from a JSP page to a servlet?  What I want
> to do is to pass a sessionID and database info via parameters to a
> servlet that will generate a chart from data in my Oracle dB.  I
> know this is a basic question but I'm just now learning servlets.
> Thanks, Kenny

You can attach "attributes" to various levels/scopes within the
servlet spec, e.g. context, session, request.  Sounds like request is
what you want.  Check the spec/API for details.  (The relevant methods
are setAttribute/getAttribute.)

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to