HI,
I want to open a new window when specific url is entered.I used request handler to do this but it is not working.Window is not opening.Below is my code
public class SampleappUI extends UI {
public static final String URL = "GSAWindow";
private final RequestHandler requestHandler = new RequestHandler() {
@Override
public boolean handleRequest(VaadinSession session,
VaadinRequest request, VaadinResponse response)
throws IOException {
// TODO Auto-generated method stub
if (("/" + URL).equals(request.getPathInfo())) {
Window w=new Window("Sample");
Label label=new Label("Welcome User");
w.setContent(label);
((SampleappUI)session.getAttribute("UI")).addWindow(w);
return true;
}
// If the URL did not match our image URL, let the other request
// handlers handle it
return false; }
};
@Override
public void init(VaadinRequest request) {
getSession().setAttribute("UI", this);
getSession().addRequestHandler(requestHandler);
Label label=new Label("Helloo User!!!!!!!!!Request Handler sample");
setContent(label);
}
@Override
public void detach() {
super.detach();
// Clean up
getSession().removeRequestHandler(requestHandler);
}
}
Can any one tell me what’s wrong in the code