漂亮的面孔:通用网址映射 [英] Pretty Faces: Generic URL mapping

查看:110
本文介绍了漂亮的面孔:通用网址映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Pretty Faces 3,我有一些像这样的映射:

Using Pretty Faces 3, I have some mappings like these:

<url-mapping id="search"> 
    <pattern value="/search" /> 
    <view-id value="/views/search.xhtml" />
</url-mapping> 

<url-mapping id="edit"> 
    <pattern value="/edit" /> 
    <view-id value="/views/edit.xhtml" />
</url-mapping> 

有没有办法像这样使用通配符来定义所有这些通配符?

Is there any way to define all them using some wildcard, like this?

<url-mapping id="generic"> 
    <pattern value="/*" /> 
    <view-id value="/views/$1.xhtml" />
</url-mapping>

我知道可以在view-id值中使用EL,但我可以对其进行管理.

I know is possible to use EL in the view-id value, but I can manage it to work.

推荐答案

当前无法使用这样的通配符.

Its currently not possible to use a wildcard like this.

但是,正如您已经提到的,您可以使用dynaview(view-id的EL表达式)来实现类似的功能.我们最近修复了一个错误,该错误使此类操作无法正常进行.也许您可以尝试 3.3.1-SNAPSHOT .我的猜测是它现在可以正常工作.如果您有任何其他问题,请随时在论坛上发布消息.

However as you already mentioned you could use a dynaview (EL expression for the view-id) to achieve something similar. We recently fixed a bug that prevented something like this to work correcty. Perhaps you could give 3.3.1-SNAPSHOT a try. My guess is that it will work fine now. Feel free to post a message on the forums if you have any further problems.

这篇关于漂亮的面孔:通用网址映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆