Impossible de récupérer un paramètre dans l'URL
Bonjour,
Je n'arrive pas à récupérer un paramètre dans l'une de mes pages :
URL : http://localhost:8080/techniweb/page...on.sav?id=5555
XHTML :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:head>
<title>LinkRedirection</title>
</h:head>
<h:body>
<h:form>
<p:remoteCommand action="#{linkRedirectionBean.redirect()}" autoRun="true"/>
</h:form>
</h:body>
</html> |
ManagedBean :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
@Named
@ViewScoped
public class LinkRedirectionBean implements Serializable {
@PostConstruct
public void init(){
System.out.println(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));
}
public String redirect(){
return "";
}
} |
Le "System.out.println" renvoie toujours "null"
J'ai essayer de mettre le "System.out.println(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));" dans le PostConstruct une autre page déjà codé et sa marche, je ne sais plus quoi faire
Une idée ??
Merci d'avance