Hide Parameters in start URL

Hi,

I start my Vaadin application with parameters…



http://myhost/myApp&para1=alpha&para2=beta

On start screen the complete URL is visible in the browsers URL field. And it stays visible while working with the application.

My question: is there nice way to hide the parameters from users view? I don’t care about the URL, but parameters shouldn’t been seen.

Thanks, Thorsten

URL parameters are URL parameters and as such stay visible to the user.

However, with Vaadin applications, the state is kept on the server.
If your use case is that an external system links to the Vaadin application with URL parameters and you would like to remove them from the URL on “arrival”, you can copy the relevant state to the application server-side state and then redirect the browser to a URL without the parameters.

Hi,

actually that was what I thought… But what is the best way to do it? Should the “arrival” part of the application be a servlet which do the forward? Or is it possible to forward from within the Vaadin part without loosing request parameters?


Window.open()
does not work because it uses external resources - am I right?

Thanks, Thorsten

Window.open can take an URL and you can ask URL from any Vaadin window by calling getURL() of the Window class

Hi,

OK - but is
Window.open()
really the correct way to do a servlet like
forward
? My final goal is to display another URL in the browser but not to leave the current application (i.e. not losing the session)

If you’ll do a window.open to any other window from your app - you’ll not loose a session. However - yes, you’ll suffer a full page refresh.

You can try another way - replace your parameters from request parameters to url anchor, like: http://localhost:8080/myapp#xyz - see Sampler or Directory applications - they both do use this technique. This way you can always change URL in the browser without page refresh - by using an URIFragmentUtility - it must be added to a window (to any place) and then it will track changes to URI string as well as let you to change the URI programmatically.

You can also try any of the higher-level addons like
AppFoundation
or
TPT
- they both have a component to create view-based apps - when your views are organized in a stack and controlled from an URI. Those components already handle parameter parsing - you just get the parameters to your views by called callbacks/interface methods.

Promising hints - I will check…
Thanks, Thorsten