users@glassfish.java.net

Re: I don't know how to Title it- but please read and help

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Sun, 27 Jan 2008 21:41:54 +0100

glassfish_at_javadesktop.org wrote:
> I am having a JSP.
>
> Login.JSP calls LoginServlet when Login button is clicked
>
> LoginServelt then re-directs to Homepage.JSP
>
> Now if I access Homepage.jsp object, it shows an error saying
>
> "object not found"
>
> as URL is of LoginServlet though I am on Homepage
>

Hi shopperswing,

your mail is a bit vague. Are you redirecting or are you forwarding? And
does "object not found" refer to a 404 error code (not found) or to a
Java object that is null on homepage.jsp?

If you use forwarding the url in the address bar does not change. From
what you describe it looks like you are actually using forwarding
instead of redirecting. When you use redirection the url changes. In
that case the description of your mail suggest that not even the Servlet
could be reached. You might want to check the servlet mapping within
your web.xml.

In your mail you are pretty careless with regard to capital letters. But
this makes a difference (at least on any UNIX-like system). So be sure
the JSP file is named exactly as used in your servlet and keep an eye on
capital letters.

If - on the other hand - your problem is that a Java object is null,
this might very well have to do with redirection. A redirect uses a
roundtrip to the browser. I.e. the first response (from LoginServlet)
sends a 301 or 302 status code and contains a header field which tells
the browser which page to load next. Now the browser loads the page
mentioned in the header. But any information that is stored using
request.setAttribute(key, value) is thus lost since you are using a new
request.

Given these multiple possibilities it would be best to provide more
details so that we can better understand what is happening in your app.


Regards,

Wolfram Rittmeyer


> Please tell what to do?
> [Message sent by forum member 'shopperswing' (shopperswing)]
>
> http://forums.java.net/jive/thread.jspa?messageID=256013
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>