Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-booted vaadin cannot use the non-root servlet path #70

Closed
vaadin-bot opened this issue Sep 20, 2016 · 2 comments
Closed

spring-booted vaadin cannot use the non-root servlet path #70

vaadin-bot opened this issue Sep 20, 2016 · 2 comments
Labels
bug Impact: High Severity: Minor v7 Issues or PRs for Vaadin 7 version of the add-on
Milestone

Comments

@vaadin-bot
Copy link
Collaborator

vaadin-bot commented Sep 20, 2016

Originally by ksaua on 2015-10-20 14:56:55 +0300


Using the base:

@SpringBootApplication
public class SpringBootTestApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootTestApplication.class, args);
    }

    @SpringUI
    public static class MyVaadinUI extends UI {
        @Override
        protected void init(VaadinRequest vaadinRequest) {
            setContent(new Label("Hello! I'm the root UI!"));
        }
    }
}

I see from the log:

2015-10-20 13:50:34.166  INFO 16180 --- [ost-startStop-1] c.v.s.b.i.VaadinServletConfiguration     : Servlet will be mapped to URLs [/vaadinServlet/*, /VAADIN/*]

However, if try to access it on http://localhost:8080/vaadinServlet/ I get

Failed to load the bootstrap javascript: ./VAADIN/vaadinBootstrap.js?v=7.5.5

This happens because the ServletForwardingController-hack contradicts the VaadinServletService#getStaticFileLocation usage of servletRequest.getServletPath()


Imported from https://dev.vaadin.com/ issue #19161

@vaadin-bot
Copy link
Collaborator Author

Originally by hesara on 2015-10-20 18:10:05 +0300


The path "/vaadinServlet" is an internal one and requests to the root (and certain paths under the root) are automatically forwarded to it. The logging message, while technically accurate (the Vaadin servlet is at those paths and it is another servlet that handles the forwarding to support concurrent use of Vaadin and Spring MVC/REST/...), is perhaps misleading, but otherwise I believe mappings should just work as specified in the application. If nothing is specified, root path is used by default.

If you want to use another path than root, you can either map a UI to another path with @springui("/path/to/my/ui") (which doesn't change the servlet mapping of Vaadin servlet but only the forwarding paths) or map the whole Vaadin servlet to another path with a Spring Boot configuration parameter vaadin.spring.urlMapping (can be set in application.properties, a system property or anything else the Spring configuration mechanism supports) - see https://github.com/vaadin/spring/blob/master/vaadin-spring-boot/src/main/java/com/vaadin/spring/boot/internal/VaadinServletConfigurationProperties.java .

In conclusion, I think only the log messages could be clarified and everything else should work

@Artur- Artur- added bug and removed Defect labels Sep 20, 2016
@pleku pleku added this to P3 - Spring & CDI Low Priority in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) May 16, 2019
@caalador caalador moved this from P3 - FW 7 / 8 Spring & CDI Low Priority to Needs triage in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Feb 10, 2020
@caalador caalador moved this from Needs triage to P3 - FW 7 / 8 Spring & CDI Low Priority in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Feb 10, 2020
@pleku
Copy link
Contributor

pleku commented Nov 30, 2020

Old issue for fixing logs but to be honest, we'll probably never get to it due to other priorities - closing the issue.

@pleku pleku closed this as completed Nov 30, 2020
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from P3 - FW 7 / 8 Spring & CDI Low Priority to Closed Nov 30, 2020
@pleku pleku added this to the Abandoned milestone Nov 30, 2020
@pleku pleku added the v7 Issues or PRs for Vaadin 7 version of the add-on label Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Impact: High Severity: Minor v7 Issues or PRs for Vaadin 7 version of the add-on
Development

No branches or pull requests

4 participants