小编Man*_*noi的帖子

JSF中<ui:param>的范围是什么?

我已经看过2次来自先前浏览过的页面的变量可能会干扰或替换下游查看的页面中的变量(例如ah:datatable"var").

那么ui:param的范围是什么?有没有办法控制它?

jsf

11
推荐指数
1
解决办法
3181
查看次数

无法使Eclipselink 2级缓存正常工作

我有一个最小的Web应用程序,您可以在这里下载(6Kb):http : //www.mediafire.com/? 6vo1tc141t65r1g

相关的配置是:

-eclipselink 2.3.2

-server为tomee 1.0(但glassfish 3.1相同)

当我点击页面并按F5键反复刷新时:

http://localhost:8080/testCache/jsf/test.xhtml
Run Code Online (Sandbox Code Playgroud)

我在控制台中看到几行

[EL Fine]:2012-08-29 19:01:30.821--ServerSession(32981564)-Connection(27242067)-Thread(Thread [http-bio-8080-exec-12,5,main])- SELECT ID,任务类型FROM任务类型

通过运行嗅探器,我发现SQL请求始终发送到服务器。我虽然Eclipselink的2级缓存将返回结果(表中的5行)而不查询数据库。那么怎么了,我该如何激活缓存?

文件中的一些摘录

persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="xxxPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>microsoft</jta-data-source>
    <properties>

        <property name="eclipselink.logging.level" value="FINE"/>
      <property name="eclipselink.logging.parameters" value="true"/>

    </properties>
  </persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)

EJB执行查询

/**
 * Some useless class required to use JTA transactions
 * 
 * @author Administrator
 * 
 */
@Stateless
public class Facade {
    @PersistenceContext(unitName = "xxxPU")
    private EntityManager em;


    public List findAll(Class entityClass) { …
Run Code Online (Sandbox Code Playgroud)

java caching jpa eclipselink

2
推荐指数
1
解决办法
2680
查看次数

标签 统计

caching ×1

eclipselink ×1

java ×1

jpa ×1

jsf ×1