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

  • Home
  • SEARCH
  • 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 8306581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:21:37+00:00 2026-06-08T18:21:37+00:00

I have a security constraint declared in web.xml: <security-constraint> <web-resource-collection> <web-resource-name>LoggedIn</web-resource-name> <url-pattern>/screens/*</url-pattern> </web-resource-collection> <auth-constraint/>

  • 0

I have a security constraint declared in web.xml:

    <security-constraint>
    <web-resource-collection>
        <web-resource-name>LoggedIn</web-resource-name>
        <url-pattern>/screens/*</url-pattern>
    </web-resource-collection>
    <auth-constraint/>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

After logging in, when I make a GET request against the application I get the expected behavior e.g.

https://localhost:8443/Patrac/screens/user.xhtml –> results in access denied.

However, when I do a postback e.g.

<rich:menuItem submitMode="ajax" label="User" action="/screens/user"/>

I can view the screen. If I do a second identical postback, I get the access denied message. Each time I submit a postback the result alternates between displaying the screen and issuing a 403. The URL displayed in the browser alternates between the following:

https://localhost:8443/Patrac/screens/user.xhtml –> browser URL when access denied

https://localhost:8443/Patrac/public/403.xhtml –> browser URL when user screen is displayed

I understand the way the displayed browser URL in JSF lags behind the screen that is currently displayed, so that’s no mystery. But I don’t understand how I’m able to view the screen every other time the same postback is submitted. Again, GET requests are always denied.

EDIT :

I did try post-redirect-get and that made the strange behavior go away, as expected.

<rich:menuItem submitMode="ajax" label="User" action="/screens/user?faces-redirect=true"/>

However, I don’t want to do PRG every time and besides PRG doesn’t eliminate the security problem.

What am I missing here? Thanks for any insights!

  • 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-08T18:21:38+00:00Added an answer on June 8, 2026 at 6:21 pm

    The security constraint isn’t checked on forwards, but on requests. This is by design.

    So you definitely need the PRG pattern or, better, normal GET links. It’ll instantly also make your webapp more SEO friendly and better bookmarkable. Using POST for page-to-page navigation is bad design anyway.

    The “alternating behaviour” you’re seeing is because the forward isn’t checked, but any subsequent (postback) request on the same page is a fullworthy request and thus checked.

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

Sidebar

Related Questions

I have a problem configuring BASIC-auth in jetty here's my web.xml <security-constraint> <web-resource-collection> <web-resource-name>resources</web-resource-name>
Here is the example code from my web.xml <security-constraint> <display-name> change password</display-name> <web-resource-collection> <web-resource-name>change
I have a web.xml which looks like: <web-app> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <security-constraint> <web-resource-collection> <web-resource-name>Default</web-resource-name>
I have tried to use security-constraint in web.xml. I gave permission to admin by
In my web.xml of my simple app i have <servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>HelloServlet</servlet-class> </servlet> <servlet-mapping>
I'm porting a standard web-app with a web.xml, security-constraint(s), security-role(s), and login-config to Spring
I have a web application Maven project, and I want to customize the web.xml
I have a class like this : class User { String name; String password;
I am toying with tomcat security for servlets. In my server.xml I have <Realm
I'm using WebSphere 7. I have a simple example set up with web.xml as

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.