Primefaces Dialog Framework打开相同的portlet页面而不是必需的页面.
<p:commandButton value="Dialog" process="@this" icon="ui-icon-extlink" actionListener="#{controller.viewDialog}" />
Run Code Online (Sandbox Code Playgroud)
豆:
public void viewDialog() {
Map<String,Object> options = new HashMap<String, Object>();
options.put("modal", true);
options.put("draggable", false);
options.put("resizable", true);
options.put("contentHeight", 320);
RequestContext.getCurrentInstance().openDialog("viewDialog", options, null);
Run Code Online (Sandbox Code Playgroud)
viewDialog.xhtml:
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:portlet="http://java.sun.com/portlet_2_0">
<h:head />
<h:body styleClass="jsf2-portlet">
<f:event type="preRenderView" listener="#{dialog.initController}" />
</h:body>
Run Code Online (Sandbox Code Playgroud)
我正在通过休眠生成一个日期并保存在数据库中,当我得到该值并将其与插入之前的值进行比较.结果不平等!
我创建了如下日期
Date rightnow = Calendar.getInstance().getTime();
Task t1 = new Task("My task", rightnow);
taskDao.saveOrUpdate(t1);
Task taskR1 = taskDao.get(t1.getIdTask());
assertEquals("They should have to be equal dates",taskR1.getDate(),t1.getDate());
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误
<2014-04-11 23:13:13.0> 与...不同 <Fri Apr 11 23:13:13 CEST 2014>
java.lang.AssertionError:
They should have to be equal dates
expected:<2014-04-11 23:13:13.0>
but was:<Fri Apr 11 23:13:13 CEST 2014>
Run Code Online (Sandbox Code Playgroud)
与问题相关的额外信息
课程任务
@Entity
@Table(name = "t_task")
public class Task {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "idTask")
private long idTask;
...
@Column(name = "date")
private Date date; …Run Code Online (Sandbox Code Playgroud) 我正在用Java做一些测试示例,并且我想出了一个使用@AroundInvoke的示例。问题是我不确切知道该方法在哪里调用。
该测试在调用post()方法的地方进行了调用,但是我真的不知道它是如何工作的(使用Interceptors解释)。
@Test
public void crudtest() {
JsonObjectBuilder todoBuilder = Json.createObjectBuilder();
JsonObject todoToCreate = todoBuilder.
add("caption", "implement").
add("priority", 10).
build();
//The next post execute, invoke the method
Response postResponse = this.provider.target().request().
post(Entity.json(todoToCreate));
}
Run Code Online (Sandbox Code Playgroud)
调用的顺序是BoundaryLogger,然后是MonitorSink
BoundaryLogger.java
...
public class BoundaryLogger {
@Inject
Event<CallEvent> monitoring;
@AroundInvoke
public Object logCall(InvocationContext ic) throws Exception {
long start = System.currentTimeMillis();
try {
return ic.proceed();
} finally {
long duration = System.currentTimeMillis() - start;
monitoring.fire(new CallEvent(ic.getMethod().getName(), duration));
}
}
}
Run Code Online (Sandbox Code Playgroud)
显示器水槽
@Singleton
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
public …Run Code Online (Sandbox Code Playgroud) var是一个静态属性,用于公开当前元素(正文的本地元素)
如何通过scriptlet /表达式访问var属性?
初始化代码
<%
Employee e = new Employee();
e.setName("name");
e.setEmail("abc@gmail.com");
java.util.List<Employee> empList = new java.util.ArrayList();
empList.add(e);
request.setAttribute("empList", empList); %>
Run Code Online (Sandbox Code Playgroud)
forEach code 1 deferredExpression错误
<c:forEach var="emp" items="${employees}">
<c:out value="${emp.name}"/><br><%=emp.getName()%>
</c:forEach>
Run Code Online (Sandbox Code Playgroud)
也不
forEach code 2 deferredExpression错误
<c:forEach var="emp" items="${empList}" varStatus="status">
Emp email: <%= ((Employee)(pageContext.findAttribute("emp"))).getName() %>
</c:forEach>
Run Code Online (Sandbox Code Playgroud) 线程"main"中的异常org.springframework.beans.factory.BeanDefinitionStoreException:从类路径资源[com/main/beans.xml]解析XML文档的IOException; 嵌套异常是java.io.FileNotFoundException:无法打开类路径资源[com/main/beans.xml],因为它不存在
ApplicationContext context =
new ClassPathXmlApplicationContext("com/main/beans.xml");
Run Code Online (Sandbox Code Playgroud)
我之前尝试过
ApplicationContext context =
new FileSystemXmlApplicationContext("src/main/java/com/main/beans.xml");
Run Code Online (Sandbox Code Playgroud)
它运作良好.
如何相对于classpath做到这一点?
注意:类路径位于构建路径中
在我正在关注的示例中,它具有以下结构并且它可以工作
项目结构

类路径

ApplicationContext context =
new ClassPathXmlApplicationContext("com/caveofprogramming/spring/test/beans/beans.xml");
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Primefaces 4对话框架打开对话框,
public void openDialog(String viewName) {
RequestContext.getCurrentInstance().openDialog(viewName);
}
Run Code Online (Sandbox Code Playgroud)
这有效:
<p:commandButton value="Click" action="#{impaktDialogBean.openDialog('/popup/test2')}"/>
Run Code Online (Sandbox Code Playgroud)
这不是:
<p:commandButton value="Click">
<p:ajax event="click" listener="#{impaktDialogBean.openDialog('/popup/test2')}" ></p:ajax>
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)
那么,Primefaces对话框架只适用于action&actionListener ?????
我正在使用:
谢谢.
我有迹象表明我的项目有错误,但我没有在任何文件中出现任何错误.该指示也适用于项目内的Java Resources文件夹.

错误日志
Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
An exception stack trace is not available.
Run Code Online (Sandbox Code Playgroud)
问题
An error occurred while filtering resources
line 1 - Maven configuration problem
Run Code Online (Sandbox Code Playgroud)
如何在Eclipse项目文件夹中删除此错误?有任何想法吗!
环境:
我通过执行ng generate component dashboard得到错误,但它也发生在ng generate c
$ ng generate component dashboard
The "c" alias is already in use by the "--collection" option
and cannot be used by the "--change-detection" option.
Please use a different alias.
Run Code Online (Sandbox Code Playgroud)
我试图在 npm 中查找错误,ant 我收到以下错误
$npm list
...
npm ERR! peer dep missing: @angular-devkit/core@0.4.5, required by @schematics/angular@0.4.5
npm ERR! peer dep missing: @angular-devkit/schematics@0.4.5, required by @schematics/angular@0.4.5
Run Code Online (Sandbox Code Playgroud)
它看起来与 npm 验证别名有关
函数 angular-cli.command.prototype.validateAlias(选项,别名)
但我不确定为什么要使用“c”而不是“component”。
签名ChronoUnit.DAYS.between method是:
公众之间的长期(时间颞1包含,时间颞2独家)
所以最后的日期不包括在内,因为它与示例相关:
LocalDate from = LocalDate.now();
LocalDate to = from.plusDays(1);
ChronoUnit.DAYS.between(from, to); // Result is 1
Run Code Online (Sandbox Code Playgroud)
是否还有其他功能可以在该表达式中获得2天?
否则我只看到我能做到如下:
LocalDate from = LocalDate.now();
LocalDate to = from.plusDays(1);
ChronoUnit.DAYS.between(from, to.plusDays(1)); // Result is 2
Run Code Online (Sandbox Code Playgroud) class A{
A aob;
public static void main(String args[]){
A a=new A();
A b=new A();
A c=new A();
a.aob=b;
b.aob=a;
c.aob=a.aob;
A d=new A().aob=new A(); //tricky assignement
c=b; //one object eligible GC
c.aob=null;
System.gc();
}
}
Run Code Online (Sandbox Code Playgroud)
有两个对象有资格进行垃圾收集,但有一个很难理解.
A d=new A().aob=new A();
Run Code Online (Sandbox Code Playgroud)
1)这一行我会做到这一点
A d = new A().aob = new A();
^ ^
O1 O2
O1 --> O2 --> null
^
|
d ----|
Run Code Online (Sandbox Code Playgroud)
2)但真正做的是这个(所以一个符合条件的对象)为什么这样?
A d = new A().aob = new A();
^ ^
O1 …Run Code Online (Sandbox Code Playgroud)