File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Show message and redirect to a page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Show message and redirect to a page" Watch "Show message and redirect to a page" New topic
Author

Show message and redirect to a page

Sudhakar Duraiswamy
Ranch Hand

Joined: Dec 20, 2007
Posts: 43
Hi,

I would want display a custom message to the user before redirecting to a different url.

i use




1)I thought redirecting the user , the browser automatically alert the user that the browser is making a new request.
It didnt happen Y?

2) Is there a way to display a message and then redirect.


Sudhakar
SCJP 5.0 93%| SCWCD (prep. ongoing))
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

1. Redirecting is automatic, browsers don't display any message that they are redirecting the user.
2. You can use html meta tag to display a message and then redirect like given here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sudhakar Duraiswamy
Ranch Hand

Joined: Dec 20, 2007
Posts: 43
Ankit,
thanks for replying.

but dont you think its a security risk , as we know the sendRedirect is as good as(similar to) a new request intiated by the client.


Dont you think this could be misused , say alluring the customer into say (in case of a shopping cart) checkout something that he never wanted in the first place.

Just wondering or am i too paranoid
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

Dont you think this could be misused , say alluring the customer into say (in case of a shopping cart) checkout something that he never wanted in the first place.

A. Soon people will stop using such websites
B. If a person doesn't pay attention while paying what they are paying for, then its their own fault...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Show message and redirect to a page