Re: PrettyFaces + Primefaces url trouble

Splash Forums PrettyFaces Users PrettyFaces + Primefaces url trouble Re: PrettyFaces + Primefaces url trouble

#23181

hgkkjh
Member

I really didn´t want to change the structure of my code…

But its better to do that, than having some ugly URLs :)

let me just ask you something about the post you showed to me.

@URLAction
public void init() {
}

Doesn´t all actions in JSF return a “String”?

So that is not simular to the action atribute, it is similar to the actionListener attribute.

Another thing, i really need to use pretty link and f:param?

<pretty:link mappingId="editUser">
<f:param value="#{user.id}" />
Edit
</pretty:link>

Can’t I just do like this:

<p:commandButton id="edit" icon="ui-icon-pencil"
action="#{grupoController.getFormPath}" actionListener="#grupoController.loadObject(entity.id)" ajax="false">
</p:commandButton>

and them i would have:

public void loadObject(Integer id){
// loads object here.
}

would that work in this configuration:

<url-mapping id="grupoEditor">
<pattern value="/grupo/#{ grupoController.entity.id }" />
<view-id value="/view/grupo/form.jsf" />
<action>{ grupoController.loadObject}</action>
</url-mapping>

or that is not the right/better way to do it?