Hi, I need some help please.

I am having trouble with resending with URL encoding.

The user accesses a page, not the login page, and the following code
is used...

        String done = (String)session.getValue("logon.isDone");
        if (done == null) {
// Save the request URL as the true target and redirect to the login
page.
                session.putValue("login.target",
HttpUtils.getRequestURL(req).toString());
String login = ("full url");//not that I don't trust you guys :-)
                 res.sendRedirect(login);
        }

This is then sent to the login page where...

        // Try redirecting the client to the page he first tried to access
        try {
                String target = (String)session.getValue("login.target");// marker
object
                        if (target != null) {
                        res.sendRedirect(res.encodeRedirectUrl(target));
                }//end if
                else {
                        String start = ("full URL");
                        res.sendRedirect(res.encodeRedirectUrl(start));
                }
}//end try
catch (Exception ignored) { }

So basically the user should be redirected to the target page after
login, but this doesn't work, instead it goes to the start page,
whereas when cookies are enabled the user is successfully sent to the
target instead of the start page. Any ideas?

I know that res.encodeRedirectUrl() has been depreciated in favour off
res.encodeRedirectURL()

Also another problem is that when the session Id is being passed in
URL encoding, it is sent like this
        http://computer/servlet/sessionid is this correct or should I try to
stop it doing this?

I am thanking you in advance.

Cheers

Sam Rose

___________________________________________________________________________
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