我们正在尝试在项目中创建反向ajax.
我在网上查了一下,没找到具体的东西.我无法运行成功提供的任何教程.
我的目标是:提供屏幕警报(如弹出窗口)甚至从服务器推送均匀(它可能是高CPU使用率/内存,任何东西).
我的JSP页面中有两个下拉列表
1. lstA
test1
test2
test3
test4
2. lstB
Run Code Online (Sandbox Code Playgroud)
现在选择lstA时,我希望将lstA的所有项目填充到lstB中,除了select选项之外,lstA的内容也应该保持不变.
我怎样才能做到这一点?
我试图这样做,但是从lstA中删除了一些随机的项目,这非常有线.
我有一个包含几个CSS文件的jsp页面.
在这里,每个CSS都有单独定义的表样式.
问题是我需要不同表格的不同样式,我无法区分它们,菜单的css样式与新的css样式重叠.
我怎么能避免这个问题; menu.jsp已包含在另一个页面中.有没有办法避免覆盖样式?
我有一个使用JPA的hibernate项目.
我的persistence.xml内容如下:
<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="Demo-PU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:/DemoDS</non-jta-data-source>
<class>com.demo.framework.entity.ReportDefinitionEntity</class>
<properties>
<!-- Database connection -->
<property name="hibernate.connection.url" value="jdbc:mysql://192.168.9.110:3306/demoDB" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<!-- Hibernate dialect -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<!-- Output goodies
-->
<property name="hibernate.query.jpaql_strict_compliance" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="false" />
<!-- Cache
-->
<property name="hibernate.jdbc.batch_versioned_data" value="true" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
</properties>
</persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)
现在当我使用eclipse运行它时我没有问题,但是当我在Jboss中部署它时,我得到以下错误:
错误[AbstractKernelController]安装到Start时出错:name = persistence.unit:unitName =#Demo-PU state =创建java.lang.ClassCastException:org.hibernate.ejb.HibernatePersistence无法强制转换为javax.persistence.spi.PersistenceProvider …
我有一个JTable并添加了排序.现在,JTable有5列,日期字段中的第2列转换为DD/MM/YYYY,并显示在单元格的JTextField中.
当我将它排序为字符串并且我将日期混淆时,如何更改该特定列的排序行为?
例如.按照ASC顺序排序后,我得到了这个:
01/02/2012
01/03/2011
01/04/2011
01/05/2011
01/06/2011
01/07/2011
01/08/2011
01/09/2011
01/10/2011
01/12/2011
Run Code Online (Sandbox Code Playgroud)
这是错的,我应该得到结果
01/03/2011
01/04/2011
01/05/2011
01/06/2011
01/07/2011
01/08/2011
01/09/2011
01/10/2011
01/12/2011
01/02/2012
Run Code Online (Sandbox Code Playgroud)
我的代码现在看起来像这样排序
List<SortKey> sortKeys = new ArrayList<SortKey>();
sortKeys.add(new SortKey(2, SortOrder.ASCENDING));
table.getRowSorter().setSortKeys(sortKeys);
Run Code Online (Sandbox Code Playgroud)
我应该仅针对该特定列更改哪些内容?