Prettyfaces: Set a bean property to some constant value, on observing a specific url pattern
- 阅读更多 关于 Prettyfaces: Set a bean property to some constant value, on observing a specific url pattern
问题 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