Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
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:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<version>1.0.0.beta2</version>
</dependency>
<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>
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. ;)
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!?
:-)
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