• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Session Tracking in Servlets

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can i get some answers for this question???
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
</form>

entry in web.xml:-

<web-app>
...
<login-config>
<auth-method>FORM</auth-method>
<!--realm-name not required for FORM based authentication -->
<form-login-config>
<form-login-page>/formlogin.html</form-login-page>
<form-error-page>/formerror.html</form-error-page>
</form-login-config>
</login-config>
...
<web-app>

thanks,
ram
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic