This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes login screens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "login screens" Watch "login screens" New topic
Author

login screens

Scott Allen Mueller
Greenhorn

Joined: Apr 09, 2006
Posts: 2
I've been out of the servlet loop for a while... Now I need to create a webapp with, of course, a login screen and even login sections on pages like the homepage. How is this handled nowadays? I used to have to setup a <security-constraint> element in the web.xml file with a url pattern for pages that required a login. Then when you try to navigate to those pages it would bring you to the defined login page (in the <login-config> element). But I forget, and I assume there's a better way now, for example how to deal with homepages with login sections.


AccelerateBiz Managed Hosting<br /> <a href="http://www.acceleratebiz.com" target="_blank" rel="nofollow">http://www.acceleratebiz.com</a>
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
I heard about filters.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Scott Allen Mueller
Greenhorn

Joined: Apr 09, 2006
Posts: 2
How would I use filters to have a login section on the homepage?
Manuel Palacio
Ranch Hand

Joined: Oct 16, 2000
Posts: 45
I've been doing this with Acegi Security, the security framework for Spring: Acegi

You can map URLs to different roles that you have defined in, for example, a database. It uses filters to do this.

I don't think there's a better way in the latest specification to deal with those things. On the other hand, we have frameworks like Acegi that make this easy and portable.

You can also write a filter that does simple autentication, perhaps checking for the existence of a certain variable in the session.


<a href="http://www.newinstance.net" target="_blank" rel="nofollow">http://www.newinstance.net</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: login screens