Redirection Help!

Status
Not open for further replies.

anuj919

Broken In
I am making Cyber Cafe management system, In which I want to redirect the user request(for any page etc.) to home page (i.e., login page) untill he/she logs in.

Can anyone tell me how to do this with Java, J2EE, javascript (I don't know what to use), & without .NET ??
 

Bandu

Journeyman
On your login page submit action, save something in the session - some flag or something.

Have a common jsp page included in all your application pages. This page checks for the flag / variable being present in the session. If it does, no probs; if it does not, do a response.sendRedirect() back to the login page.

If you need more inputs, do let me know.

- Bandu.
 

Zangetsu

I am the master of my Fate.
I am making Cyber Cafe management system, In which I want to redirect the user request(for any page etc.) to home page (i.e., login page) untill he/she logs in.

Can anyone tell me how to do this with Java, J2EE, javascript (I don't know what to use), & without .NET ??

do u need a software or u r programming the system from scratch....:confused:
 

Desi-Tek.com

In the zone
in jsp / servlet
response.sendRedirect("*destination");
if you are developing application in j2ee than consider using struts 2 it is quite easy if compare to jsp and servlet.
 
OP
A

anuj919

Broken In
Thanks to all of you.
Sorry for the late reply.

@KaranTh85 & amitava82
I am making it as a project in my college so obviously I am making it from scratch.

@ Bandu & Desi-Tek.com
Thanks for the help, but when I redirect request( using sendRedirect()) to any other page which is not in my application(say www.google.com) then browser tells that request not found. :confused: So can you help me solve it out?
I have to submit my project shortly so I can't try out strut 2, but thanks for the suggestion, will surely see that after exams.
 

chandru.in

In the zone
Code:
response.sendRedirect("*www.google.com");

It works fine for me. Dunno what goes wrong for you. Are you sure your internet connection was fine when it was run?
 
Last edited:
Status
Not open for further replies.
Top Bottom