Advertisement

09.17.2003 at 03:02AM PDT, ID: 20741098
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Authentication from Database for Servlets and JSP

Asked by Andy_Neodynium in Java Server Pages (JSP)

Tags: , ,

I've been assigned the task of writing a web-app to administer the users of another system. The user data to be controlled/configured is in a database. For different instances of the system, different servlet containers will be used (Tomcat and Weblogic mainly).

To provide authentication, I need to look up details in the database, but as the different instances will have different containers (and database types - mainly MS-SQL and Oracle), I don't see how I can use declarative security (i.e. that which is in the web.xml and users.xml files).

Consequently, I have been looking at programmatic security.

What I would like is that if anyone tries to look at a JSP page or access a servlet in the web-application, then their session is checked. If they have not been authenticated and authorised, they are forwarded to a Login page. Otherwise, they can access the resource as they want.

I had done this by subclassing HttpServlet, and overriding the Service() method to perform authentication and authorisation. Then either the request is forwarded to a login page, or I call super.service ( req, res ) to process the request as normal.

However, this won't work with JSP pages, as they don't have any doXXX functions, which are called by the HttpServlet service() method. If I create a JSP page that subclasses my authenticating class (the subclass of HttpServlet), then the service method of the JSP calls doXXX rather than _jsp_service().

I imagine that others must have had this problem, and was wondering what the most elegant solution is - how do you create a common programmatic authentication method to be applied to both servlets and JSP pages?Start Free Trial
[+][-]09.17.2003 at 04:30AM PDT, ID: 9377199

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.17.2003 at 04:34AM PDT, ID: 9377222

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2003 at 08:15AM PDT, ID: 9378818

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Server Pages (JSP)
Tags: jsp, authentication, database
Sign Up Now!
Solution Provided By: jamoville
Participating Experts: 4
Solution Grade: B
 
 
[+][-]09.17.2003 at 08:21AM PDT, ID: 9378867

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2003 at 08:26AM PDT, ID: 9378918

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2003 at 09:42AM PDT, ID: 9379532

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32