setLocation redirecto to page ?

Hello

I’m trying to redirect to a page in my WEB-INF. The page name is EmailActivated.html. I’m trying use setLocation() but does not work.

I’m trying this.



getUI().getPage().setLocation("EmailActivated.html");

and

getUI().getPage().setLocation(getUI().getPage().getLocation() + "EmailActivated.html");

Any idea ?

The file shouldn’t be in WEB-INF, since that is a folder the server will hide. Also, depending on how you deploy the app, and if you use URI fragments, Page.getLocation() plus something may not work correctly.

I think that my problem is with my servlet. When I edit web.xml file and I do mapping /MyProject/* does work but my UI not.

example


<!-- Here my UI works -->
<servlet-mapping>
    <servlet-name>MyProject</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<!-- Here my ValidateEmail.html in WebContent work, but my UI not -->
<servlet-mapping>
    <servlet-name>MyProject</servlet-name>
    <url-pattern>/MyProject/*</url-pattern>
</servlet-mapping>

When I use mapping /MyProject/* the url: localhost:8080/MyProject/ValidateEmail.html works but the localhost:8080/MyProject doesn’t.

Any ideas ?

If you deploy a vaadin app to anywhere else then root, you nede to map the VAADIN-folder aswell. Add this:

<servlet-mapping>
    <servlet-name>MyProject</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>