I am using vaadin 10. I would see this error on my login view class if I used @Route("") but when I write it as @Route(value="") it worked. But doing that to another view I get this error. Most questions asked are way too advanced. I just have a simple project with vaadin and springboot.
Asked
Active
Viewed 2,209 times
0
-
No answers on the vaadin [Route](https://vaadin.com/docs/v10/flow/routing/tutorial-routing-annotation.html) documentation pages? – Jeroen Heier Sep 09 '18 at 05:46
-
Nope. They tell you to use @Route("name") and thats exactly what I did. It doesnt work. – Tamim Khan Sep 09 '18 at 06:05
-
1Please share your code. Preferably a simple complete example that reproduces your problem. – Steffen Harbich Sep 09 '18 at 07:23
-
[link](https://github.com/tamimmahmudkhan/inventory-management) Here is the project itself. – Tamim Khan Sep 09 '18 at 13:09
-
`@Route("")` and `@Route(value="")` *should* give identical results since the shorter variant is only syntactic sugar that the Java compiler automatically expands to the longer variant. This means that you have either encountered some kind of bug in the Java compiler, or then there's also something else that is different between when it works and when it doesn't work. – Leif Åstrand Sep 10 '18 at 08:01
-
When asking a question where one approach leads to some kind of error, it usually helps anyone to answer the question if you also describe the actual error. If possible, you should copy-paste the exact error message, including the stacktrace. – Leif Åstrand Sep 10 '18 at 08:01
2 Answers
3
With the source code you provided as link in the question's comments, I cannot reproduce your issue. However, there were 2 problems with your code before I was able to run the application:
- the
@Theme
annotation needs to be placed on a view or router layout; I moved it to yourLoginView
- the Valo theme is not available in Vaadin 10, so the reference on
ValoTheme
class was a compile error; I removed it
After fixing these problems everything ran fine, @Route(value="")
and @Route("")
were both working. Which Java version are you using? Java 8 is required minium for Vaadin 10. Also please try to remove lombok for testing, maybe it is causing a problem.

Steffen Harbich
- 2,639
- 2
- 37
- 71
-
Yeah I fixed those issues on my project. I use jdk 1.8 and on Spring Tool Suite. – Tamim Khan Sep 11 '18 at 13:45
1
Try annotating your EmployeeDisplay class with @Route(value = "employeeDisplay")
instead of @Route(value = "/employeeDisplay")
. In other words, remove the /
.

Tulio
- 432
- 2
- 4
-
@TamimKhan sorry to bother when it's such a long time since resolved ... but you did not mark the response as an answer :) – V. Courtois Aug 02 '19 at 11:45