The first time I put the @RequestMapping("/login") I used it with the value “login”
Then I wanted to change the address @RequestMapping("/something") but still point to “login”
And the application does not let me go even to my other View
@HtmlImport("styles/shared-styles.html")
@Route
@RequestMapping("/something")
public class LoginView extends VerticalLayout {
/**
*
*/
private static final long serialVersionUID = 1L;
private Label title = new Label("Login into our application - \"Seguimiento Medico\"");
private Button btnRegister = new Button("Register");
private TextField txtUser = new TextField("", "User");
private PasswordField txtPwd = new PasswordField("","Password");
private Button btnLogin = new Button("Login");
private RadioButtonGroup<String> group = new RadioButtonGroup<>();
public LoginView(@Autowired ExampleTemplate template) {
txtUser.setRequiredIndicatorVisible(true);
txtUser.focus();
txtPwd.setRequiredIndicatorVisible(true);
group.setItems("Doctor", "Patient");
group.setValue("Doctor");
btnLogin.addClickListener(event -> {
String type = group.getValue();
String email = txtUser.getValue();
String password = txtPwd.getValue();
if(group.getValue().equals("Doctor")) {
System.out.println("Doctor");
}else if(group.getValue().equals("Patient")) {
System.out.println("Patient");
}
});
add(title, txtUser, txtPwd, group, btnLogin,btnRegister);
setClassName("MainView");
}
}
Could not navigate to ‘something’
Reason: Couldn’t find route for ‘something’
Available routes:
login
This detailed message is only shown when running in development mode.