Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional context paths #687

Merged
merged 3 commits into from
Jan 25, 2024
Merged

Conversation

labkey-jeckels
Copy link
Contributor

Rationale

Some server configurations have historically used non-root context paths, and/or deployed additional web apps for delivering static content.

Changes

  • Property to control LabKey's context path: context.contextPath
  • Property to automatically redirect/forward requests from a legacy context path to the root: context.legacyContextPath
  • Properties to deploy extra web apps: webapps.contextPath and webapps.docBase

server/embedded/src/org/labkey/embedded/LabKeyServer.java Outdated Show resolved Hide resolved
@@ -156,7 +162,7 @@ protected TomcatWebServer getTomcatWebServer(Tomcat tomcat)
}

// set the root path to the context explicitly
context.setPath("");
context.setPath(contextProperties.getContextPath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any need to do trimming on this value and the legacyContextPath value? Perhaps in the setter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be fine to do, but we don't trim any of the other properties so I'm inclined to leave as-is. From a quick test, the properties file parser automatically trims leading spaces for the value (after the =) but not trailing spaces.

Co-authored-by: Susan Hert <susanh@labkey.com>
@labkey-jeckels labkey-jeckels merged commit ee87bc3 into tomcat10 Jan 25, 2024
5 checks passed
@labkey-jeckels labkey-jeckels deleted the tc10_contextPaths branch January 25, 2024 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants