richfaces dataOrderedList 和自定义后端列表 [编辑:浏览器缓存!!!]
我有一个包含这个对象的支持 bean:
列表<会话>会议;
Session 是一个类,它有一些标准字段,但也有:
列表<条目>条目;
Entry 是一个包含多个字段的类,但所有字段都是标准 java 对象。
所以就这样了..
列表<会话>
|-会议
|-列表<条目>
|-Entry
我尝试访问列表
但是当我尝试访问列表
javax.faces.FacesException: javax.el.PropertyNotFoundException: /pages/console.jspx @75,109 value="#{session.sessionID}": 类 'org.apache.cata lina.session.StandardSessionFacade' 没有财产 '会话ID'。
(sessionID 是 Session 类的 String 字段)
有什么方法可以解决这个问题吗? (转换器可以解决这个问题吗?)
jspx 代码是:
<rich:dataOrderedList id="sessions" var="session" value="#{backEnd.sessions}" style="position:relative;top:40px">
<rich:togglePanel switchType="client" stateOrder="closed, opened" initialState="#{backEnd.sessionsState}">
<f:facet name="closed">
<rich:toggleControl style="font-weight:bold;" value="#{session.sessionID}" switchToState="opened" />
</f:facet>
提前致谢 !!
I have a backing bean containing this object:
List<Session> sessions;
and a Session is an class that has some standard fields but also this:
List<Entry> entries;
An Entry is a class that contains several fields but all of them standard java objects.
So it's like this..
List<Session>
|-Session
|-List<Entry>
|-Entry
I have tried accessing the List<Entry> directly with success.
But when I try to access the List<Session> I get the following error:
javax.faces.FacesException:
javax.el.PropertyNotFoundException:
/pages/console.jspx @75,109
value="#{session.sessionID}": The
class 'org.apache.cata
lina.session.StandardSessionFacade'
does not have the property
'sessionID'.
(sessionID is a String field of Session class)
Is there any way to fix this ?? (could a converter solve this ?)
the jspx code is:
<rich:dataOrderedList id="sessions" var="session" value="#{backEnd.sessions}" style="position:relative;top:40px">
<rich:togglePanel switchType="client" stateOrder="closed, opened" initialState="#{backEnd.sessionsState}">
<f:facet name="closed">
<rich:toggleControl style="font-weight:bold;" value="#{session.sessionID}" switchToState="opened" />
</f:facet>
Thanks in advance !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用“session”关键字作为变量,似乎还有另一个名为“session”的 bean。要解决该问题,请更改您的 var 属性。使用类似的东西
代替
You are using 'session' keyword as a variable and it seems like there is another bean named 'session'. To solve the problem, change your var property. Use something like
instead of
看来该问题与代码、配置、部署或与之相关的任何内容无关。
html 文档的标头中有一个称为“Pragma”的元参数,浏览器使用它来缓存页面以进行后退/前进导航。也许也是为了刷新,因为这就是我的情况。 (在 Firefox 上清除缓存没有效果)。
因此,如果您想在开发时解决此问题,可以使用名为“Modify Headers”的 Firefox 插件,它允许您在所请求网站的标头中包含参数。
如果您出于某种原因想从 html 中删除此功能,则必须在标头中添加以下内容:
并且我还没有研究可能也需要的这一功能:
It appears the problem had nothing to do with code, config, deploy or anything related to that.
There is a meta parameter in the header of html documents called "Pragma" and it is used by the browsers to cache pages for the back/forward navigation. Maybe for refresh too because this was my case. (clearing cache on firefox had no effect).
So if you want to fix this while developing there is a firefox addon called "Modify Headers" which allows you to include parameters in the headers of the requested websites.
If you want to remove this feature from your html for some reason you have to add the following in the header:
and I haven't investigated this one which may be needed as well: