Forums de discussion

Load different xhtml-Files depending on URL-Parameter

Jan Bub, modifié il y a 11 années.

Load different xhtml-Files depending on URL-Parameter

Junior Member Publications: 78 Date d'inscription: 02/03/11 Publications récentes
Hey,

I wanted to make my entities likeable in Facebook. Therefor I need a link to get directly to the enitity page. I realized that the friendlyURL mapping is not working correctly at this time. So i decided to get the parameter from the URL and than forward to the 'show.xhtml' if it is set.

My Question is, how can I set a special xhtml file to load it programaticly. I tried some solutions without success. Please help.


public EbookManagementOverviewController() throws 
			SystemException, IOException, PortalException {

		FacesContext context = FacesContext.getCurrentInstance();

		// Get URLParameters 
		Map<string, string> requestMap = context.getExternalContext()
				.getRequestParameterMap();

		// Get bookId from URL
		if (requestMap.get("bookId")!=null) {
			setCurrentBookId(Long.parseLong(requestMap.get("bookId")));
		}
.....
}

@PostConstruct
public void postConstruct() {
// TODO set show.xhtml
// ???????????????????
}

</string,>
thumbnail
Neil Griffin, modifié il y a 11 années.

RE: Load different xhtml-Files depending on URL-Parameter (Réponse)

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
In your Facelet view for portlet VIEW_MODE you can do something like this:

<ui:include src="#{ebookManagementOverviewController.faceletComposition}" />


And then in your backing bean, do something like this:

public String getFaceletComposition() {
    return faceletComposition;
}