Url Parameter in Custom Component

Hello,

i have a couple of custom class in my application. A custom class extend VerticalLayout and implement View. I call it by http://myapp/#!/customclass.

Now i want get a parameter like httt://myapp/ #!/customclass/?test=hello. I tried implementing Handler Request interface but it didnt work.

In general i cant understand how get a parameter outside my init(VaadinRequest requet) method. Can someone help me plz?

There’s your problem; the an HTTP URI, the request parameters come
before
the URI Fragment. From
Wikipedia article
(easier to understand than the RFC, and the first result on my quick google!)

In other words, your URL should be http://myapp?test=hello#!/customclass

You simply need access to the VaadinRequest object - which you can get via the
VaadinService#getCurrentRequest()
method, e.g.

String value = VaadinService.getCurrentRequest().getParameter("test") HTH,

Cheers,
Charles.

Tnx Charles,

now it work! And i understand better URI Fragment :slight_smile: