Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure display-name when no web.xml

We used to specify display-name in our web.xml Currently we don't have a web.xml (and adding one seems to break the application)

We are using spring boot / spring 4 / java 7 / maven3 to develop rest services.

Can anyone tell me how the display-name can be be set ? For example from within the java code / SpringBootServletInitializer ?

note: I currently don't have any @WebServlet tags

After adding web.xml below, tomcat manager will show the display-name, but when opening my application I get 404. It seems adding web.xml breaks my app.

<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>
like image 689
Raymond Domingo Avatar asked Nov 18 '14 12:11

Raymond Domingo


1 Answers

Since SpringBoot v1.3.1.RELEASE, you can do it via the server.display-name property.

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

EDIT 2019-10-24 : Since SpringBoot v2.0.0 RELEASE you can do it via the server.servlet.application-display-name property

See this commit : https://github.com/spring-projects/spring-boot/commit/0c1aac14a077685ce6a6c2c0d7066255a7433365

like image 145
morellet.d Avatar answered Nov 11 '22 14:11

morellet.d