Combination View Flat View Tree View
Threads [ Previous | Next ]
Jan Bub
Load different xhtml-Files depending on URL-Parameter
January 10, 2013 1:33 AM
Answer

Jan Bub

Rank: Junior Member

Posts: 78

Join Date: March 2, 2011

Recent Posts

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.

 1
 2public EbookManagementOverviewController() throws
 3            SystemException, IOException, PortalException {
 4
 5        FacesContext context = FacesContext.getCurrentInstance();
 6
 7        // Get URLParameters
 8        Map<String, String> requestMap = context.getExternalContext()
 9                .getRequestParameterMap();
10
11        // Get bookId from URL
12        if (requestMap.get("bookId")!=null) {
13            setCurrentBookId(Long.parseLong(requestMap.get("bookId")));
14        }
15.....
16}
17
18@PostConstruct
19public void postConstruct() {
20// TODO set show.xhtml
21// ???????????????????
22}
Neil Griffin
RE: Load different xhtml-Files depending on URL-Parameter
December 6, 2012 2:35 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1973

Join Date: July 26, 2005

Recent Posts

In your Facelet view for portlet VIEW_MODE you can do something like this:

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


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

1public String getFaceletComposition() {
2    return faceletComposition;
3}