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 8181539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:33:34+00:00 2026-06-07T00:33:34+00:00

first of all some details: I configured security as below in web.xml view plaincopy

  • 0

first of all some details: I configured security as below in web.xml
view plaincopy to clipboardprint?

<login-config>  
    <auth-method>FORM</auth-method>  
    <form-login-config>  
        <form-login-page>/formLoginPage.html</form-login-page>  
        <form-error-page>/formErrorPage.html</form-error-page>  
    </form-login-config>  
</login-config>  
<security-constraint>  
    <web-resource-collection>  
        <web-resource-name>MyBeerApp</web-resource-name>  
        <url-pattern>/web/form.html</url-pattern>  
        <url-pattern>/SelectBeer.do</url-pattern>         
        <http-method>POST</http-method>  
        <http-method>GET</http-method>  
    </web-resource-collection>  
    <auth-constraint>  
        <role-name>member</role-name>  
    </auth-constraint>  
    <user-data-constraint>  
        <!--transport-guarantee>CONFIDENTIAL</transport-guarantee-->  
    </user-data-constraint>  
</security-constraint>  
<security-role>  
    <role-name>admin</role-name>  
</security-role>  
<security-role>  
    <role-name>member</role-name>  
</security-role>  
<security-role>  
    <role-name>guest</role-name>  
</security-role>  

in tomcat-user.xml as below:
view plaincopy to clipboardprint?

  <role rolename="member"/>  
  <role rolename="guest"/>  
  <user username="vgarg2" password="tomcat" roles="member,guest" />  
  <user username="vgarg3" password="tomcat" roles="guest" />  

file are location as below:
view plaincopy to clipboardprint?

<TOMCAT_HOME>\Beer-v1\index.html  
<TOMCAT_HOME>\Beer-v1\web\form.html  
<TOMCAT_HOME>\Beer-v1\WEB-INF\web.xml  
<TOMCAT_HOME>\Beer-v1\WEB-INF\classes\...  

contents of form.html:

view plaincopy to clipboardprint?

<html>  
<body>  
<h1 align="center">Beer Selection Page</h1>  
<form method="POST" action="../SelectBeer.do">  
Select Beer Characteristics  
Color : <select name="color1" size="1">  
            <option value="light1">Light</option>  
            <option value="amber1">Amber</option>  
            <option value="brown1">Brown</option>  
            <option value="dark1">Dark</option>  
        </select>  
    <br/>  
Can sizes:  
<input type="checkbox" name="sizes" value="12oz">12 oz</input>    
<input type="checkbox" name="sizes" value="24oz">24 oz</input>  
<input type="checkbox" name="sizes" value="36oz">36 oz</input>  
    <br/>  
    <center>  
        <input type="submit"/>  
    </center>  
</form>  
</body>  
<html>  

Now my problem is that the request going to “http://localhost:8080/Beer-v1/web/form.html&#8221; is not getting constrained.
when I submit the request from /web/form.html to “http://localhost:8080/Beer-v1/SelectBeer.do&#8221; it checks for the authentication and asks for id/password info.

If i disable the security constraints the app works fine.

what is going wrong here?

  • 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-06-07T00:33:36+00:00Added an answer on June 7, 2026 at 12:33 am

    I think issue here is that the response for http://localhost:8080/Beer-v1/web/form.html is being served from cache.

    If you require authentication for static pages, you should be sending cache control header saying the caching entities not to cache the response. For this you should be sending the following headers along with the response:

    • Cache-Control: no-cache,no-store
    • Pragma : no-cache

    NOTE: Without applying the headers above, if you refresh the page using F5, you should see that the authentication will work.

    I would suggest to have all the pages which requires authentication as JSP’s.

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

Sidebar

Related Questions

First of all, I did some search and no answer on stackoverflow/google provided me
First of all thank you for your time and sorry if some issues are
First of all, I did some searching for an answer to this question...but I
First of all, apologize because I have seen some posts about this, but I
first of all, my main question: What are some good troubleshooting techniques when you
First of all, it needs to create some codes that handle any error in
First of all, sorry for my English. I need some help with this. Recently
First of all, I'm new to objective-c programming so I've probably made some mistakes
First of all, this is a homework assignment. I'm trying to make some bubbleSort
I have the models shown below. I need to store some details that are

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.