• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

XML Login

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I a mtrying to right a servlet that will take a username and password that has been [osted to it from a form and then use that to check against a xml document to see if the username and password are valid.

If they are valid then it should direct the user to a welcome page.

can anyone help, i'm not really sure where to start?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apache Tomcat already does all of this. If you use FORM based authentication, it allows you to pass in the username and password, and the default location for authentication details is the tomcat-users.xml file in the <tomcat_home>/conf directory.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"homer homer"
We're a friendly bunch here at the ranch, but we take display names very seriously.

We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and fix your display name.

thanks,
Dave.
 
davidb
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have an example of how you could use that?

The XML user/login stuff that is?
[ March 10, 2006: Message edited by: davidb ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"davidb", please read my request more closely.
I appreciate you changing your diaply name, but display names must be two words: your first name, a space then your last name.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check out the config for the tomcat-users.xml file here, I'll need to go find a link for configuring the FORM based authentication, although it's just config settings in the web.xml file and therefore standard J2EE.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or you can write your own custom realm, and parse your XML document yourself, I guess. Check out the security section of the J2EE Tutorial. Howerver, I think using JDBCRealm of Tomcat is easier and more convenient when you already have an existing database that includes usernames, pass, and roles..

cheers,
[ March 15, 2006: Message edited by: Thanh Cute ]
 
Are you here to take over the surface world? Because this tiny ad will stop you!
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic