JSF 2.0 + Spring 3,通过注解检索请求参数
在本机 JSF 2.0 环境中,用户可以使用类似的内容引用请求参数。
@ManagedProperty("#{param.id}")
private Long id;
但是,我使用 Spring 来管理 JSF bean,因此在我的情况下,@ManagedProperty 注释被忽略。仍然可以在 faces-config.xml 中使用 #{param.id} 语句,但基于注释的配置显然更可取。
有没有办法用Spring注解来解决这样的语句?
In native JSF 2.0 environment user is able to refer to request parameters with something like
@ManagedProperty("#{param.id}")
private Long id;
However I'm using Spring to manage JSF beans, so @ManagedProperty annotation is ignored in my case. It's still possible to use #{param.id} statement in faces-config.xml, but annotation-based configuration is obviously much more preferable.
Is there any way to resolve such statements with Spring annotations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试将
@Value
与 Spring 表达式语言一起使用。应该有可用的request
变量:You can try to use
@Value
with Spring Expression Language. There should berequest
variable available: