PrettyFaces是一个JSF1.2和JSF2.0的扩 展,用来创建便于书签收藏、漂亮的网址。 PrettyFaces优雅的解决了这个问题,包括诸如功能:网页装载行动,无缝的跟faces的导航整合,动态视图的ID分配和管理参数分析,无需配 置,兼容其他JSF框架。
配置示例:
<pretty-config
xmlns="http://ocpsoft.com/prettyfaces-xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.com/prettyfaces-xsd
http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd">
<url-mapping id="login">
<pattern> /login </pattern>
<view-id> /faces/login.jsf </view-id>
</url-mapping>
<url-mapping id="home">
<pattern> /home </pattern>
<query-param name="displayWelcomeMessage">#{homeBean.displayWelcomeMessage}</query-param>
<view-id> #{homeBean.getViewPath} </view-id>
</url-mapping>
<url-mapping id="viewStory">
<pattern>
/story/#{myBean.currentStoryId}/
</pattern>
<query-param name="commentText" decode="false">#{myBean.commentText}</query-param>
<view-id> /faces/story/viewStory.jsf </view-id>
<action onPostback="false">#{myBean.loadStory}</action>
</url-mapping>
<url-mapping id="viewComment">
<pattern>
/story/#{myBean.currentStoryId}/#{myBean.commentId}
</pattern>
<view-id>/faces/story/comment.jsf</view-id>
<action>#{myBean.loadComment}</action>
</url-mapping>
</pretty-config>
新特性和改进:
- Performance improvements when running JSF 2.0 in project stage ‘development’
- Regular expression performance improvements provided by Yann Simon.
- Ambiguous View IDs are now resolved automatically when using pretty:mappingIds in action method navigation, <h:link> and <h:button> component outcomes
- Ambiguous View IDs may now be resolved manually for outbound URL rewrites by adding ‘?com.ocpsoft.mappingId=…’ to URLs before calling HttpServletResponse.encodeURL(…)
- Dynaview URLs* are now resolved during rendering of links and navigation cases, and are now as functional as traditional mappings.
修复的Bug:
- Fixed bug that caused path parameter validators to be ignored (#102)
- Handle java.lang.ClassFormatError during initialization of bean name resolvers (#101)
- Also check Weld 1.1.x specific servlet context attribute while search for BeanManager
- Mapping inheritance now working correctly for mappings using the same viewId
暂无更多评论