if A and B are also servlets then the suggestion below is very correct. But
i think orginal poster of this mail was asking about the links to html
pages.i.e A and B are html files.
>From: "Jonnalagadda Pradeep." <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: LOGIN VALIDATION
>Date: Fri, 1 Dec 2000 13:25:57 -0600
>
>Assuming that the links in the html file are again links to the pgms u have
>developed you can call a verifyUser() method in the pgms
>which verifies whether the user has logged in and if no redirects the
>control to the login page.
>
>
>In the login page when the user successfully logs in create a session and
>put the some value into it
>
>The code might be :
>HttpSession s = request.getSession(true);//create a new session
>s.putValue("Login","Logged in");
>Suppose in the page after login you have some thing like
>
> link to A link to B
>
>and hiting on link A or B will take to your pgm A or PGM B then you could
>write a code in A and B like this
> doGet(){
>
> verifyUser(req,res);
>
>
>}
>
>verifyUser(req,res){
>
>HttpSession ht=req.getSession();
>String str=ht.getValue("Login")
>//if the user not logged in redirect to login screen
>if(!str.equals("Logged in")
>res.sendRedirect(homepageurl);
>return;
>}
>
> you could write verify user in super class of A and B
>
> THANKS
> Pradeep.
> > Hello everybody
> >
> > I am trying to develop a simple web-site which needs a valid login. I
>have
> > some files on the same server and in the same folder. I want to prevent
> > any
> > non-users from looking at this content. Can my initial login page take
> > care
> > of the security of my entire directory.
> >
> > Here is an example of what I am trying to say: I have a login page which
> > posts a request to a servlet that checks if the user information is
> > correct
> > and then loads an html page. Then there are links to a few other files
> > from
> > this HTML file. Right now if a user types the links directly he can see
> > all
> > of them. I need some mechanism to redirect him to the login page if he
> > tries
> > to access these links.
> >
> > I hope my question is understandable. I am not sure either, if a servlet
> > could offer a solution. I am sorry if this is the wrong list that I
>mailed
> > my question to.
> >
> > Thanks,
> > Kalyan
> >
> >
>__________________________________________________________________________
> > ___________
> > Get more from the Web. FREE MSN Explorer download :
> > http://explorer.msn.com
> >
> >
>__________________________________________________________________________
> > _
> > 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
>
>___________________________________________________________________________
>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
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
___________________________________________________________________________
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