vaadin-spring-boot-starter hides my rest controller

Hi guys,

I just started developing vaadin, Normally I just use spring and offer some rest controller to the outside world.

So I added the following to my pom:

[code]

com.vaadin
vaadin-spring-boot-starter
1.0.0.beta2

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>7.5.5</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

[/code]This works great, I can show UIs, e.g.

@SpringUI(path="/frontend") public class SimUI extends UI {} But if I want to access my rest controller, it hides it and I am unable to access it.

@RequestMapping("/backend") 
public class SimulatorRestController {

    @RequestMapping(value = "simcall", produces = "application/json")
    public String getSome() {
        return "looks good";
    }
}

If I delete vaadin from my pom again, I can access my backend again. I have no clue how to tell vaadin, that it is not allowed to listen to every mapping…
Hope you can help me!

Best regards
Benjamin

PS: The problem seems to be ‘springVaadinServlet’, but where to configure it?

Hi,

I’d suggest to try with 1.0.0 version. I think the development team made some changes how vaadinServlet is mapped.

cheers,
matti

Hi Matti,

thanks for the quick response. You were right, this resolved my issue.
It is now mapping to “/vaadinServlet/, /VAADIN/”, which is much nicer. :wink:

The only problem is that our team needs beta2 for some functions (do not ask me why exactly :D).
Is there a way to change the default mapping via a code-config?

Best regards
Benjamin

Uuuh, I’d really like to know why beta2 is favored over the stable 1.0.0, so I do have to ask that!?

:slight_smile:

cheers,
matti

Dear Matti,

I have a similar usecase, I want to have a browser facing Ui and a rest service in the backend,

Like Benajamin told above I extended the UI class like this @SpringUI(path="/frontend") @Theme("mytheme") public class MyUI extends UI {
And created a controller for the rest service

@RequestMapping("/backend")
public class GreetingController {

    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();

    @RequestMapping(value = "greeting",  produces = "application/json")
    public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
        return new Greeting(counter.incrementAndGet(),
                            String.format(template, name));
    }
}

My Frontend is working great when i access it with XXX/frontend

But request to my backend service XXX/backend/greeting returns a 404 with “Request was not handled by any registered handler.”

Did I miss something here?

thanks
Chahat