Redirect JSF error

Asked

Viewed 402 times

1

I am trying to pass two parameters to another example page:

<p:commandButton icon="ui-icon-pencil" action="form?faces-redirect=true&id=cargo.id"></p:commandButton>

But this error returns to me :

A referência à entidade "id" deve terminar com o delimitador ';'.

2 answers

2

It is because you are not sending the correct id, have to use #{cargo.id}.

<p:commandButton icon="ui-icon-pencil" action="form?faces-redirect=true&id=#{cargo.id}"></p:commandButton>

So he gets the id correctly.

  • He says the expression is not valid

  • that button is inside a datatable?

-1

Exchange the & for &amp;. Look at this the response of the following link:

https://stackoverflow.com/questions/6483807/the-reference-to-entity-foo-must-end-with-the-delimiter

"The ampersand & is a special Character in HTML and XML. If you want to use it as a normal Character, you have to Encode it correctly. Write &amp; Instead of &:

src="...9623&amp;w=180&amp;h=46&amp;style=white&amp;variant=text&amp;loc=en_US"

& denotes the start of an encoded Entity, such as &lt; for <, or &amp; for &. In your case the parser tries to interpret &w as an Entity. But entities are Always terminated by an ;, Thus if the ; is Missing you get the error message."

  • 1

    While this link may answer the question, it is best to include the essential parts of the answer here and provide the link for reference. Replies per link only can be invalidated if the page with the link is changed. - Of Revision

  • Added comment with the essential parts of the answer.

Browser other questions tagged

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