How to customize display name if no web.xml

We used to indicate the display name in our web.xml. Currently we do not have a web.xml file (and the addition seems to break the application)

We use spring boot / spring 4 / java 7 / maven3 to create recreation services.

Can someone tell me how to customize the display of the name? For example, from java code / SpringBootServletInitializer?

note: I currently do not have @WebServlet tags

After adding web.xml below, the tomcat manager will show the display name, but when I open my application, I get 404. Adding web.xml seems to break my application.

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>MyT2ConfigServer</display-name> <description>MyT2ConfigServer description</description> </web-app> 
+7
spring-boot
source share
2 answers

With SpringBoot v1.3.1.RELEASE, you can do this using the server.display-name property.

See https://github.com/spring-projects/spring-boot/issues/2600

+1
source share

After adding web.xml, I ran into an unrelated problem caused by some other changes that I made ... When I fixed this other problem, everything was fine and I could use the web.xml above as suggested by M.Deinum .

0
source share

All Articles