Redirect JSF error

1

To 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 I get this error:

A referência à entidade "id" deve terminar com o delimitador ';'.
    
asked by anonymous 06.10.2015 / 15:49

2 answers

2

It is because you are not sending the correction id, you 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.

    
06.10.2015 / 16:39
-1

Change & by &amp; . Look at the answer from the following link:

link

"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

  •     
  • 08.05.2018 / 22:04