[CAM-9137] Disabling of redirection to index.html is not working in Spring Boot Created: 13/Jun/18  Updated: 20/Nov/18  Resolved: 14/Nov/18

Status: Closed
Project: camunda BPM
Component/s: spring-boot
Affects Version/s: spring-boot 3.0.0, 7.10.0-alpha1
Fix Version/s: 7.10.0, spring-boot 3.1.0

Type: Bug Report Priority: L3 - Default
Reporter: Svetlana Dorokhova Assignee: Michael Schoettes
Resolution: Fixed Votes: 0
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes

Issue Links:
is duplicated by CAM-9071 cant disable webapp automatically red... Closed


What are the steps to reproduce your problem?
1. Create Spring Boot application with Camunda Webapp starter included
2. Define following configuration parameter: camunda.bpm.webapp.index-redirect-enabled: false
3. Start the application and open localhost:8080

What is the problem?
Redirection to index.html bundled inside Camunda Webapps and in turn redirection to /app/tasklist takes place.

What would be the expected behavior:
Redirection should not happen.

Comment by Sergii Tsymbal [ 05/Sep/18 ]

I am having troubles validating this fix.
I have a Spring Boot app with Camunda Starter dependency and Angular app bundled in. All works on 7.8/2.3.0/1.5.x of Camunda/CamundaStarter/SpringBoot version.
After I upgraded to 7.9/3.0.0/2.0.4 I am not able to get to my custom index.html page - I get redirected to Camunda web app.
According to this bug it looks like it is supposed to be fixed in Camunda Starter 3.1.0-alpha1, but after I upgraded the dependencies to Camunda Starter 3.1.0-alpha1 and even Camunda 7.10.0-alpha2 I am still NOT able to get to my custom index.html page. However, I am able to get to other static files from the Angular app (like styles.ded9f2c7e8a889108fd8.bundle.css)

Am I missing something?

P.S. I have the following property set in application.properties and other camunda properties seem to be working correctly.


Comment by Yana Vasileva [ 06/Sep/18 ]

Hi Sergii Tsymbal,

How does your file structure look like?
It is important to put the custom index.html page under /META-INF/resources folder.

Best regards,

Comment by Sergii Tsymbal [ 06/Sep/18 ]

Hi Yana,

The index.html is located in the following location in the "fat" jar, which is handled by Spring Boot 2 correctly.

I will try to put it in `BOOT-INF/classes/META-INF/resources` and report back.

What about other supported by Spring Boot static content locations like `/static`, `/public`, `/resources` or cases when the static files are loaded from a jar (created by frontend-maven-plugin for example)?

Thank you,

Comment by Yana Vasileva [ 07/Sep/18 ]

Hi Sergii,

Here is folder structure in my test project jar:

│   ├───classes
│   │   │   application.yaml
│   │   │
│   │   ├───bpmn
│   │   │       sample.bpmn
│   │   │
│   │   └───org
│   │       └───camunda
│   │           └───...
│   │
│   └───lib
│      └───...
│   │   processes.xml
│   │
│   ├───maven
│   │   └───...
│   │
│   └───resources
│           index.html│

What about other supported by Spring Boot static content locations like `/static`, `/public`, `/resources` or cases when the static files are loaded from a jar (created by frontend-maven-plugin for example)?

This is spring boot topic and it is out of the scope of the Camunda. So I can only point you resources regarding it:
[1]: https://docs.spring.io/spring/docs/5.0.8.RELEASE/spring-framework-reference/web.html#mvc-config-static-resources
[2]: https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources

Best regards,

Comment by Sergii Tsymbal [ 07/Sep/18 ]

Hi Yana,

I was able to get to my custom index.html after I moved the Angular files to BOOT-INF/classes/META-INF/resources/
What I was trying to say by mentioning Spring Boot static content locations was that Spring Boot officially supports static content from the following location of the source tree:


Which end up as the following locations under the "fat" jar


However, CamundaBootStart 3.0.0+ no longers allows those locations to be used for static files by redirecting to Camunda UI if the static file is located in any of those locations. That is, CamundBootStarter 3.1.0-alpha1 only supports src/main/resources/META-INF/resources (BOOT-INF/classes/META-INF/resources) location.
I think this can be considered a regression by those customers who migrate from CamundaBootStarter 2.3.0.

Thank you!

Comment by Kristian Weissmann [ 29/Oct/18 ]

I totally agree with Sergii.

Switching to Camunda Spring Boot Starter 3.0.0 the custom entry page of the application is overrun by the camunda web app entry page regardless of the property camunda.bpm.webapp.index-redirect-enabled.

Since the static resource ist located correctly from the perspective of Spring Boot project setup, camunda spring boot needs to support the localtions.

I opened https://app.camunda.com/jira/browse/SUPPORT-4984 to address this issue.

Comment by Smirnov Roman [ 09/Nov/18 ]

I reopen this issue, because with the current Webjar structure of the Camunda Webapp, it is not possible to provide a custom Welcome Page (other then the Camunda Webapp).

To deal with it, it is possible to change the Spring Boot property like spring.resources.static-locations: classpath:/myapp.

Generated at Tue Jun 18 13:38:49 CEST 2019 using JIRA 6.4.6#64021-sha1:33e5b454af4594f54560ac233c30a6e00459507e.