Generate Url through form

Asked

Viewed 119 times

0

I have the following url:

www.teste.com/username=xxxx

I have to type the name of Usario in xxxx, I am creating a form in html with the username field, I want that when the user type his name in this form he generates the automatic link for example: if he type in the field the name Fernando then you have to go to a page that link and the following www.teste.com/username=Fernando am ultiliziando JSF.

  • You could put in the code you already have?

  • In this case, you can solve this problem only using Javascript, via the Location object. As an example I am passing you the following links: - http://www.tutorialspoint.com/javascript/javascript_page_redirect.htm - http://www.w3schools.com/jsref/obj_location.asp

1 answer

0

You need to use the jsf viewParam tag.

<f:metadata>
    <f:viewParam name="username"/>
</f:metadata>   

There are several ways you can work with this received value, apply converters, validators, load attributes from your bean and etc. This will depend on your need, but a search on viewParam on google will give you the path of stones regardless of what your desire.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.