File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Login

 
davidb
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Thanh Cute
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic