Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-9137

Disabling of redirection to index.html is not working in Spring Boot

      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.

        This is the controller panel for Smart Panels app

            [CAM-9137] Disabling of redirection to index.html is not working in Spring Boot

            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.
            camunda.bpm.webapp.index-redirect-enabled=false

            Thanks

            Sergii Tsymbal added a comment - 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. camunda.bpm.webapp.index-redirect-enabled=false Thanks

            Hi stsymbal,

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

            Best regards,
            Yana

            Yana Vasileva added a comment - Hi stsymbal , How does your file structure look like? It is important to put the custom index.html page under /META-INF/resources folder. Best regards, Yana

            Sergii Tsymbal added a comment - - edited

            Hi Yana,

            The index.html is located in the following location in the "fat" jar, which is handled by Spring Boot 2 correctly.
            `BOOT-INF/classes/static/index.html`

            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,
            Sergii

            Sergii Tsymbal added a comment - - edited Hi Yana, The index.html is located in the following location in the "fat" jar, which is handled by Spring Boot 2 correctly. `BOOT-INF/classes/static/index.html` 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, Sergii

            Hi Sergii,

            Here is folder structure in my test project jar:

            ├───BOOT-INF
            │   ├───classes
            │   │   │   application.yaml
            │   │   │
            │   │   ├───bpmn
            │   │   │       sample.bpmn
            │   │   │
            │   │   └───org
            │   │       └───camunda
            │   │           └───...
            │   │
            │   └───lib
            │      └───...
            │
            ├───META-INF
            │   │   MANIFEST.MF
            │   │   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,
            Yana

            Yana Vasileva added a comment - Hi Sergii, Here is folder structure in my test project jar: ├───BOOT-INF │ ├───classes │ │ │ application.yaml │ │ │ │ │ ├───bpmn │ │ │ sample.bpmn │ │ │ │ │ └───org │ │ └───camunda │ │ └───... │ │ │ └───lib │ └───... │ ├───META-INF │ │ MANIFEST.MF │ │ 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, Yana

            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:

            src/main/resources/static
            src/main/resources/public,
            src/main/resources

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

            BOOT-INF/classes/static
            BOOT-INF/classes/public
            BOOT-INF/classes

            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!
            Sergii

            Sergii Tsymbal added a comment - 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: src/main/resources/static src/main/resources/public, src/main/resources Which end up as the following locations under the "fat" jar BOOT-INF/classes/static BOOT-INF/classes/public BOOT-INF/classes 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! Sergii

            Kristian Weissmann added a comment - - edited

            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.

            Kristian Weissmann added a comment - - edited 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.

            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.

            Roman Smirnov added a comment - 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 .

              michael.schoettes Michael Schoettes
              svetlana.dorokhova Svetlana Dorokhova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: