Skip to content

Provide a condition for detecting war deployments #19421

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

Closed
wilkinsona opened this issue Dec 20, 2019 · 2 comments
Closed

Provide a condition for detecting war deployments #19421

wilkinsona opened this issue Dec 20, 2019 · 2 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

If a war file is deployed to Tomcat, Jetty, or Undertow, we currently configure and customise the servlet web server factory even though it will never be used. It would be useful to be able to make the configuration and customization conditional on the app not being deployed to an external container.

@wilkinsona wilkinsona added the type: enhancement A general enhancement label Dec 20, 2019
@wilkinsona wilkinsona added this to the 2.3.x milestone Dec 20, 2019
@spencergibb
Copy link
Member

Spring Cloud has a similar requirement to do something different in a war.

@mbhave mbhave self-assigned this Feb 25, 2020
@mbhave mbhave closed this as completed in 1342e49 Apr 10, 2020
@mbhave mbhave modified the milestones: 2.3.x, 2.3.0.RC1 Apr 10, 2020
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Apr 10, 2020
@philwebb philwebb reopened this Apr 22, 2020
@philwebb
Copy link
Member

philwebb commented Apr 22, 2020

Adding a note here in case we need to return to this issue in the future.

The code below currently works because we set the ServletContext quite late in the embedded case. With a war deployment, it's set very early.

ServletContext servletContext = applicationContext.getServletContext();
if (servletContext != null) {
	return ConditionOutcome.match("Application is deployed as a WAR file.");
}

@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants