Declarative Role based security in j2ee websphere

Hi Experts,

I have been trying to get the declarative security in J2e to work and not able to do so. The request pattern doesnt work, the application is letting users in to unauthorized jsps as well. But i can see that the role itself is obtained right. Meaning if I do request.isInRole returns the right role info in the servlet.

Can someone suggest me as to where to look for pointers. Here is my web.xml and app.xml.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">
<web-app id="WebApp">
		<description>Administrator module path</description>
		<description>Author module path</description>
	<resource-ref id="ResourceRef_1263312544187">
		<description>Indirect JNDI reference</description>
			<description>The Manager Resources</description>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "">
<application id="Application_ID">
	<module id="WebModule_1232571342612">
	<module id="WebModule_1232571342613">
	<module id="WebModule_1232571342614">
	<security-role id="SecurityRole_1260484657609">
	<security-role id="SecurityRole_1270843993062">

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

When I do a simple test of your security-constraint patterns, they work fine -- all access to the root directory requires a login.

However, one thing is a little peculiar -- your login page is in the same directory where you require a login.  Try putting it in a public directory of your webapp, which would require changing your rules a little.

Usually people have public and private subdirectories under their webapps.  The login and login error pages are public, and the rest are private.

I haven't tested your protected login, because I don't want to create an entire login env to check your code.  But it does look odd to me.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.