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

Vaadin URL mapping issues: sub-path URL mapping and automatic URL mapping not working #7

Open
kuldip-chalo opened this issue Jul 12, 2017 · 1 comment

Comments

@kuldip-chalo
Copy link

Hi there,

Not sure if I can post this here. Please feel free to close/delete.

Facing these issue w.r.t Vaadin UI and URL mapping.

Problem1:

I am trying to use Vaadin for basic CRUD operations for my Entities. To start with, I would like to expose a UI class to /subpath/xyz url. But the sub-path url mapping is somehow not working. (Please note that when I keep or remove @spring(path="myui") it still maps to localhost:8080/myui/ and not localhost:8080/subpath/myui/

What am I missing?

I have been following Vaadin's documentation but no luck so far.
https://vaadin.com/docs/-/part/framework/application/application-environment.html#application.environment.servlet-mapping

Problem2:
Also, Vaadin is not generating url mappings automatically from the class name. E.g. MyUI classname should be mapped to localhost:8080/my-ui/ if I do not give path attribute in @springui( as per Vaadin's documents).

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.Title;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.spring.server.SpringVaadinServlet;
import com.vaadin.ui.*;

import javax.servlet.annotation.WebServlet;

@theme("valo")
@title("My UI")
@springui(path="myui")
public class MyUI extends UI {
@OverRide
protected void init(VaadinRequest request) {
// Create the content root layout for the UI
VerticalLayout content = new VerticalLayout();
setContent(content);

	// Display the greeting
	content.addComponent(new Label("Hello World!"));

	// Have a clickable button
	content.addComponent(new Button("Click Me!",
		click -> Notification.show("Clicked!")));
}
@WebServlet(urlPatterns = {"/admin/*", "/VAADIN/*"}, name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends SpringVaadinServlet {
}

}

@toufik-menad
Copy link

Hi kuldip-chalo,

I am having the same trouble with an app that am building with Spring vaadin wildly:
Could not navigate to 'ui'
Reason: Couldn't find route for 'ui'

Available routes:
This detailed message is only shown when running in development mode.

Have fixed the issue?
tsk for helping out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants