Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3760430
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:28:13+00:00 2026-05-19T10:28:13+00:00

I want to make authentication controled by Tomcat. To test it I created to

  • 0

I want to make authentication controled by Tomcat. To test it I created to simple pages, login page and loginError page.
Authentication seemed to work. When I enter wrong login or password I see loginError page. But when I enter correct login and password I see:

type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.

Here is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <security-constraint>
        <web-resource-collection>
            <url-pattern>/protected.jsp</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/login.jsp</form-login-page>
            <form-error-page>/loginError.jsp</form-error-page>
        </form-login-config>
    </login-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

Here is my tomcat-users.xml

<tomcat-users>

  <role rolename="tomcat"/>
    <role rolename="admin"/>
    <role rolename="manager"/>
    <user password="tomcat" roles="tomcat,manager,admin" username="tomcat"/>
    <user password="proger" roles="tomcat" username="proger"/>
</tomcat-users>

My login.jsp looks like:

<html>
    <body>
        <form id="loginForm" method="post" action="j_security_check">
            <p>
                Username: <input type="text" name="j_username" id="j_username" />
                <br/>
                Password: <input type="password" name="j_password" id="j_password" />
                <br/>
                <button type="submit">login</button>
            </p>
        </form>
    </body>
</html>

I deploy it I use NetBeans 6.9.1. I use Tomcat 6.0.29.
What can be wrong?
Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:28:14+00:00Added an answer on May 19, 2026 at 10:28 am

    Using

       <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    

    requires that you also define ‘valid’ roles

    <security-role>
          <role-name>admin</role-name>
    </security-role>
    <security-role>
         <role-name>user</role-name>
    </security-role>
    

    If the user enters a valid name/pass, but is only in role ‘dimwit’, they’ll get access denied

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make simple authentication like # SessionController require 'session.rb' def create Session.new(params[:email],
Iam using forms authentication in asp.net Application,i want to make pages accessible depending upon
I want to make user Login Authentication in my web application. I am using
I want to make a windows form application and want to use windows authentication
Question 1 I want to make IPhone application that uses OpenID for authentication. I
I'll want to make a authentication with Ruby on Rails, that every user have
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task
Let's say I want make some of my sources publicly available via my blog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.