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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:25:50+00:00 2026-05-27T13:25:50+00:00

We are developing box web-product, so I cannot foreseen the environment where application is

  • 0

We are developing “box” web-product, so I cannot foreseen the environment where application is deployed. This application uses spring-security. But it is appeared that if Tomcat placed application not at the root then following configuration fails:

<sec:http auto-config="true" >
    ....
    <sec:form-login login-page="/ui/Login" />

Following recommendation: https://stackoverflow.com/a/6934712/149818 to use

#{servletContext.contextPath} doesn’t work. User instead of http://foo/myApp/ui/Login is redirected to http://foo/ui/Login

So my question is

  • either how to get #{servletContext.contextPath} alive
  • or how to force spring-security recognize actual contextPath
  • 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-27T13:25:51+00:00Added an answer on May 27, 2026 at 1:25 pm

    Great thanks to @Luke Taylor and @axtavt – my error is missing root ‘/’ in the

    <sec:http auto-config="true" use-expressions="true">
         <sec:intercept-url pattern="/ui/Login" 
                            access="IS_AUTHENTICATED_ANONYMOUSLY"/>
    

    When ‘/’ appears – #{servletContext.contextPath} starts work correctly.

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

Sidebar

Related Questions

I am developing a JSF web application on a Windows box using Emacs as
I'm developing a web application using asp.net. There is a text box which contains
I am developing a small application with images and trash box icon on right
Hi i am developing a web app.I am retrieving options of the select box
I'm developing a web site that has a search box as part of the
I'm developing a web application in visual studio 2010. I've a list view and
I am developing a web app base on this guide: http://www.asp.net/data-access/tutorials/declarative-parameters-cs I am able
I have been developing a web application on XP and FF (with occasional IE
At the moment I'm developing a web based application using Silverlight 3.0. For the
I'm working at a small company and we are developing a web application. With

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.