How to get URL value

Asked

Viewed 988 times

0

Help me...

I’m stuck on the following question...

I need to get the id of the user that comes through the URL parameter, as below:

localhost:8080/Sgc/pages/generationNew.xhtml? id=3

But I don’t know how to get this value "id=3".

A link is sent to the email of the user who forgot the password, so when the user clicks on the link this value no longer exists in Managedbean, where I am stuck. How do I get that amount?

Help me out, please.

  • your form is with a get request?

  • Could you show us how you’re doing at the moment? It’s easier to help!

  • What language is using on the server? PHP?

  • Guys, I’m using via GET. But manage to solve the problem, using a method that recovers the value per parameter, but the fundamental problem was due is using the annotation "Viewscoped" and the right would be "Sessionscoped" due to destroy the information contained in the bean.

1 answer

0


You need to use a guy named Viewparam is a metadata that added to your page allows you to capture this type of information passed by parameter. Primefaces - http://www.primefaces.org/showcase-labs/push/viewparam.jsf?data=Pushed

Viewparam is from the jsf specification the example of using primefaces is didactic but works the same way with any other library if you are using one.

  • I tried to use for f:param but could not... But thanks for the help!

Browser other questions tagged

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