AjaxEventBehavior behavior = new AjaxEventBehavior("keyup"){
@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println("Hello world!");
}
};
form.add(behavior);
Run Code Online (Sandbox Code Playgroud)
在以前版本的Wicket中,我可以这样做:
behavior.setThrottleDelay(Duration.ONE_SECOND);
Run Code Online (Sandbox Code Playgroud)
但自6.1版以来,这个机会已被抹去.Web上充满了以前版本的教程,这些教程都包含.setThrottleDelay()方法.
基本上,目标是在人员停止在表单中键入时调出行为.目前,每当密钥启动时,它每次都会调用该行为,这基本上会阻塞服务器端.这就是我想延迟的原因.背景:我目前正在尝试对数据库进行查询,并获取与表单输入类似的数据.在这个人打字的时候,所有这一切.但是目标是需要延迟以使服务器端/ SQL退出"轰炸范围".
我也愿意接受替代方案.
我创建一个com.w3c.dom.Document从String使用此代码:
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(new InputSource(new StringReader("<a><b id="5"/></a>")));
Run Code Online (Sandbox Code Playgroud)
当我System.out.println(xmlToString(document)),我得到这个:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><a><b id="5"/></a>
Run Code Online (Sandbox Code Playgroud)
一切都很好,但我不希望XML有<?xml version="1.0" encoding="UTF-8" standalone="no"?>声明,因为我必须用私钥签名并嵌入肥皂信封.
有没有办法在不引入servlet api/Wicket依赖的情况下将Http/Wicket Session信息共享到服务层?
我会提供一些背景信息,为什么我会问这个问题,以防我错过了什么并提出了错误的问题.
我有几个实体具有可以验证的属性组.作为可验证的方式有指示验证值,谁做了验证,并在验证日期用户领域这是这些实体建模方式:
@Embeddable
public class ValidationBean<T> implements Serializable {
private T validated;
private String user;
private Date date;
// Constructors, getters, setters ahead.
// ...
}
@Entity
@Table(name="SOME_TABLE")
public class SomeEntity implements Serializable, SomeInterface {
// Some attributes which conform validation group 1
public String attribute11;
public String attribute12;
public String attribute13;
private ValidationBean<Integer> validationBean1 = new ValidationBean<Integer>();
// Some attributes which conform validation group 2
public String attribute21;
private ValidationBean<String> validationBean2 = …Run Code Online (Sandbox Code Playgroud) <rich:column>
<f:facet name="header">
<h:outputText value="Expiry Date"/>
</f:facet>
<h:outputText value="#{item.endDate}">
</h:outputText>
</rich:column>
Run Code Online (Sandbox Code Playgroud)
使用上面的代码,我从数据库得到的日期是2012-09-03 00:00:00.0
现在,我想将日期模式设置为dd-MM-yyyy.
所以我要求的输出是03-09-2012.
但使用下面的代码(设置模式后)
<rich:column>
<f:facet name="header">
<h:outputText value="Expiry Date"/>
</f:facet>
<h:outputText value="#{item.endDate}">
<f:convertDateTime pattern="dd-MM-yyyy" />
</h:outputText>
</rich:column>
Run Code Online (Sandbox Code Playgroud)
我得到的输出是02-09-2012
无论数据库中的日期是什么,它都会显示输出减少一天.
提前谢谢.
我写了一个java客户端通过ssl连接到Ldap。我将 CA 证书导入到我的 java 密钥库中,并且能够通过 ssl 连接 Ldap 并提取信息。问题是它并不总是有效。通常它会抛出:CommunicationException:sun.security.validator.ValidatorException: PKIX path building failed。如果我再次运行(没有改变任何东西),它就可以工作。
这个问题让我死了好几天,作为一种解决方法,我正在捕获这个异常并重试。但我正在寻找永久修复。任何帮助将不胜感激。
下面是我获取上下文的代码:
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, securityPrincipal);
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_CREDENTIALS, securityCredential);
env.put("java.naming.provider.url", url);
return new InitialLdapContext(env, null);
Run Code Online (Sandbox Code Playgroud)
跟踪跟踪:
javax.naming.CommunicationException: simple bind failed: adapps.nms.comm:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:215)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2685)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:306)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at …Run Code Online (Sandbox Code Playgroud) 我在 Ubuntu 上使用 Netbeans。我打开了 Wicket 应用程序。我的项目有三个包。但我删除了一张。它有EventCollection。现在我的项目有两个包。现在我想运行它,但它没有运行。它给出了错误。
我做了调试。它给出了这个错误:
Attaching to localhost:11555
Not able to submit breakpoint LineBreakpoint EventCollection.java : 95, reason: The breakpoint is set outside of any class.
Invalid LineBreakpoint EventCollection.java : 95
User program running
Run Code Online (Sandbox Code Playgroud)
现有包的名称随 Events 更改,而 CategoryCollection.java 的名称随 EventCollection.java 更改
<property name="hibernate.cache.use_structured_entries">true</property>
Run Code Online (Sandbox Code Playgroud)
它能做什么?我不知道?请举个例子!
这是一个面试问题.
假设你有这样的数组
{54,23,545,65,23,4,1,2,5}
Run Code Online (Sandbox Code Playgroud)
如何对它进行排序并在一行代码中将其分类为偶数或奇数?
答案的复杂性顺序应为O(1),不使用任何for循环.结果应该是:
{2,4,54,1,5,23,23,65,545}
Run Code Online (Sandbox Code Playgroud) 我在Spring Batch示例中看到了标签所在的位置(即<job></job>).但是在我的xml文件中,我必须包含'batch'.例如<batch:job></batch:job>
这是为什么?这是一个版本的东西吗?我想通过删除批处理来稀释标签:如果可能的话,在所有标签中删除标签.
如何删除tvos中tableview单元格之间的默认空间?默认情况下,tvos 中 tableview 单元格之间的间隙为 14px,但我需要将空间增加 20px。