On Tue, 18 Dec 2001, Mark Galbreath wrote:

> Look at the API - setAttribute() takes a String and an Object, not 2
> Strings.  Try something like:
>
> String errorMessage = "NO Error Message";
> application.setAttribute( "errorMessage", errorMessage);

Mark, I think you're losing it :-).

Surely a double quoted string literal is a String object (or is
translated/converted to a String object -- I'm not surely exactly how
the language spec technically deals with it.)  How else could you do
things like:

"a".equals("b")

And of course, if that was the problem, the code below wouldn't even
compile.

Not that I do know what the problem is :-).

But here's a quesiton: application is a pre-defined identifier in
JSPs, but what is the application in the line of servlet code below?


> -----Original Message-----
> From: Jim Lindsay
> Sent: Tuesday, December 18, 2001 2:49 PM
>
> I am not able to get session or application scope tracking to work for some
> reason.  Currently the code is trying to use
> application tracking, but I know I should be using session tracking for
> items that are for the user session.
>
> In my userLoggidIn.jsp page I have:
>        Error Message = < <%= application.getAttribute("errorMessage") %> >
>
> In my servlet I have:
>        application.setAttribute("errorMessage", "NO error message");
>
> esponse.sendRedirect( response.encodeRedirectURL("/userLoggedIn.jsp");
>
> The output is *always*: "Error Message = < null >".  What the heck am I
> doing wrong?
>

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
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

Reply via email to