Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以像 JSF 中的 JSP UseBean 一样声明一个 bean?
例如,如果我在 VO 中嵌套了对象,我不想一次又一次地调用许多 get 方法
例如,我有 ManagedBean(MB) 持有 VO。VO保持(CVO),CVO保持CVO1。如果想要 CVO 的方法。我需要编写 MB.VO.CVO.CVO1.method1、MB.VO.CVO.CVO1.method2。有没有像我定义 CVO1 并将其用作 CVO1.method1 和 CVO1.method2 的简单方法?
如果您使用的是JSTL,则可以使用该<c:set> 组件:
<c:set>
<c:set var="temp" value="#{myBean.someObject}"/> ... <!-- Exemple of usage: --> <h:outputText value="#{temp.someProperty}"/>