prettyfaces

Prettyfaces: Set a bean property to some constant value, on observing a specific url pattern

别等时光非礼了梦想. 提交于 2019-12-04 05:24:56
问题 While writing the URL mapping rules for Prettyfaces in pretty-config.xml I would like to add a rule that whenever a particular pattern is observed in URL then set a specific constant value to bean property. For e.g. when there is a pattern like ../products/electronics then it should set bean property bean.category to ELECTRONICS_ITEMS . How do I do that ? 回答1: You should simply use a path parameter and convert the value from the URL to your constant in a page action method. Something like

PrettyFaces error with required attribute

南楼画角 提交于 2019-12-02 03:25:42
问题 I'm developing a web application using JSF 2 and prettyfaces . I annotated one of my @ViewScoped beans with pretty annotations. That's what I have: @ManagedBean @ViewScoped @URLMapping(parentId = "app-list", id = "app-view", pattern = "/detail/#{appId}", viewId = "/system/manage_app/content/app_detail/app_detail.xhtml") public class NavegableAppView extends SystemNavegable { /** Basically that shows the details of an application which is installed in my system. This bean can be instanced in

PrettyFaces error with required attribute

佐手、 提交于 2019-12-02 01:40:07
I'm developing a web application using JSF 2 and prettyfaces . I annotated one of my @ViewScoped beans with pretty annotations. That's what I have: @ManagedBean @ViewScoped @URLMapping(parentId = "app-list", id = "app-view", pattern = "/detail/#{appId}", viewId = "/system/manage_app/content/app_detail/app_detail.xhtml") public class NavegableAppView extends SystemNavegable { /** Basically that shows the details of an application which is installed in my system. This bean can be instanced in two ways, passing #{appId} param, which indicates the id of the application which I want to load, or

How to reproduce specific Friendly URL?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 13:24:09
we are trying to refactor an JSP/XSLT application to JSF. We use a CMS for content management. Technologies : JSF 2.0 using Mojarra, PrimeFaces 2.2.1 and Tomcat 6.29 The organisation of the data structure is the following: There are Sites. Sites contain Channels. Channels contain Contents. Sites, channels and content are translated. The URLs look like: http://whatever/firstSite http://whatever/firstSite/aChannel http://whatever/firstSite/aChannel/aSubChannel/myGreatContent It's the translated name who is showing to the user. The siteName only appears once, channel can appear many times and the

Pretty faces config issues on WebSphere Application server - JSF2

这一生的挚爱 提交于 2019-12-01 01:22:01
"Error 500: com.ocpsoft.pretty.PrettyFilter incompatible with javax.servlet.Filter" JSF2.1.2 Prettyfaces-jsf2-3.3.2 Primefaces 3.2 WebSphere Application Server 7.0.0.9 Tried with adding custom properties in WebSphere admin console for filter compatibility(Last in FAQ at http://ocpsoft.org/prettyfaces/ ). Tomcat 6.0.32 don't have any issues but once deployed the app in WAS got the issue. Below is webxml <context-param> <param-name>defaultHtmlEscape</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.numberOfViewsInSession</param-name> <param

ViewScoped bean rebuilt when FileUploadListener called using PrettyFaces

笑着哭i 提交于 2019-11-30 23:15:23
I've inserted a <p:fileUpload /> component into my JSF 2.1.5 application. I'm using PrimeFaces 3.4.1 . This component is backed by a @ViewScoped bean. I have my form in this way: <?xml version='1.0' encoding='UTF-8' ?> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" template="/templates/general_template.xhtml"> <ui:define name="metadata"> <f:metadata> <f:viewParam id="NavIndex" name=

Pretty faces config issues on WebSphere Application server - JSF2

徘徊边缘 提交于 2019-11-30 20:07:31
问题 "Error 500: com.ocpsoft.pretty.PrettyFilter incompatible with javax.servlet.Filter" JSF2.1.2 Prettyfaces-jsf2-3.3.2 Primefaces 3.2 WebSphere Application Server 7.0.0.9 Tried with adding custom properties in WebSphere admin console for filter compatibility(Last in FAQ at http://ocpsoft.org/prettyfaces/). Tomcat 6.0.32 don't have any issues but once deployed the app in WAS got the issue. Below is webxml <context-param> <param-name>defaultHtmlEscape</param-name> <param-value>true</param-value> <

ViewScoped bean rebuilt when FileUploadListener called using PrettyFaces

和自甴很熟 提交于 2019-11-30 17:51:19
问题 I've inserted a <p:fileUpload /> component into my JSF 2.1.5 application. I'm using PrimeFaces 3.4.1 . This component is backed by a @ViewScoped bean. I have my form in this way: <?xml version='1.0' encoding='UTF-8' ?> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" template="/templates

remove application name from URL

那年仲夏 提交于 2019-11-30 16:04:33
my site uses JSF and the url appears to be, http://mysitename.com/wompower6/faces/home.xhtml I am using prettyfaces, so if I use the following in pretty-config.xml, i can change the name to http://mysitename.com/ wompower6 /home <url-mapping id="home"> <pattern value="/home" /> <view-id value="/faces/home.xhtml" /> </url-mapping> my questions are how can i remove the application name wompower6 , so that the url becomes mysitename.com/home ? in my web.xml, i have <welcome-file>home.xhtml</welcome-file> , but this does not seem to work. When i type, mysitename.com, it does not get mapped to home

remove application name from URL

谁说胖子不能爱 提交于 2019-11-29 23:19:08
问题 my site uses JSF and the url appears to be, http://mysitename.com/wompower6/faces/home.xhtml I am using prettyfaces, so if I use the following in pretty-config.xml, i can change the name to http://mysitename.com/ wompower6 /home <url-mapping id="home"> <pattern value="/home" /> <view-id value="/faces/home.xhtml" /> </url-mapping> my questions are how can i remove the application name wompower6 , so that the url becomes mysitename.com/home ? in my web.xml, i have <welcome-file>home.xhtml<