1

I have a maven project, using spring boot and vaadin flow. But I can't change the web context when deploy in my server.

I try putting different variables into the file application.properties

vaadin.urlMapping=/mycontext/*
server.servlet.context-path=/mycontext
server.contextPath=/mycontext

Always after deploying the project, it continues showing the context like my-project-01-SNAPSHOT

UPDATE

I deploy like a WAR application in a wildfly server.

Carlos Laspina
  • 2,013
  • 4
  • 27
  • 44
  • There is some information missing in your question. I took one of my Spring Boot apps, and just added these "server.servlet.context-path=/mycontext, server.contextPath=/mycontext" to my application.properties, and it worked as it should. I think this is not necessary: "vaadin.urlMapping=/mycontext/*" – Tatu Lund Jun 24 '18 at 07:12
  • See this one: https://stackoverflow.com/questions/20405474/add-context-path-to-spring-boot-application – Tatu Lund Jun 24 '18 at 07:14
  • Check point 2. here: https://www.mkyong.com/spring-boot/spring-boot-how-to-change-context-path/ – Tatu Lund Jun 24 '18 at 07:17
  • the Vaadin URL-Mapping is also relative to the context path – cfrick Jun 24 '18 at 11:54
  • I read all this you mentioned and that's the problem. The context doesn't change. For that reason, I posted in the question I using vaadin, for it's a problem compatibility with the framework. – Carlos Laspina Jun 24 '18 at 19:52

1 Answers1

2

I found the answer, the problem occurs because I deploy like a WAR application into my wildfly. I fixed it adding to my project a /WEB-INF/jboss-web.xml file

<jboss-web>
    <context-root>/mycontext</context-root>
</jboss-web>
Carlos Laspina
  • 2,013
  • 4
  • 27
  • 44