File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Session Tracking in Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Tracking in Servlets" Watch "Session Tracking in Servlets" New topic

Session Tracking in Servlets

gowrishankar sundararajan

Joined: Apr 10, 2007
Posts: 6
hi all,
i am learning servlets and to learn about session tracking.
i would like to know first how to do authentication.
i tried

which is always null.
i dont want to use the timcat-users.xml and then authenticate.
we have some server with which i always login to computer in our network.
now when i write a servelt and put these two lines i get a popup but after giving the credentials i am not able taken forward.

can you tell me what should be done?
gowrishankar sundararajan

Joined: Apr 10, 2007
Posts: 6
can i get some answers for this question???
Ramu Pamidimarri

Joined: Jun 29, 2007
Posts: 2
Hi you can do the authentication 4 types:-
oHTTP Basic authentication ( BASIC )
oHTTP Digest authentication (DIGEST)
oHTTPS Client authentication (CLIENT-CERT)
oHTTP FORM-based authentication (FORM)

<form method="POST" action="j_security_check">
<input type="text" name="j_username">
<input type="password" name="j_password">
<input type="submit" value="OK">

entry in web.xml:-

<!--realm-name not required for FORM based authentication -->

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
In most cases you don't need to fiddle around with the response in your own code. If you set things up properly -like Ramu hints at- and then tell the container where to look for your user information (e.g. for Tomcat that's described here), then you should be all set.

can i get some answers for this question???

As an aside, it would have been polite to put a "please" in this sentence, instead of adding three question marks.
[ June 29, 2007: Message edited by: Ulf Dittmer ]
I agree. Here's the link:
subject: Session Tracking in Servlets
It's not a secret anymore!