Milan Tucakovic wrote:
> I am new to Servlets and Java in general. I have the following problem:
> I have to check user's name and password, create a session, read some
> preferrences from a database, store data in the session object and - if
> everything is ok - redirect the client to another URL (which is not always
> the same, depends on username/category).
> What would be the best way to do this redirect? JavaScript or
> redirect-method in response-object?
The response.sendRedirect(newURL) is the best way (IMHO), because
(AFAIK) all browsers handle redirect in response header correctly,
contrary to the other redirect methods - JavaScript or even <META
HTTP-EQUIV="Refresh" CONTENT="0;URL=...">.
This is my experience.
J.Ch.
--
Ing. Jozef Chocholacek Qbizm Technologies, Inc.
Chief Project Analyst ... the art of internet.
________________________________________________________________
Kralovopolska 139 tel: +420 5 4124 2414
601 12 Brno, CZ http://www.qbizm.com fax: +420 5 4121 2696
___________________________________________________________________________
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