我有以下代码用于存储重复键的树形图,它似乎覆盖了现有的密钥.
TreeMap<String, Integer> tm=new TreeMap<>();
tm.put("vivek", 1);
tm.put("vivek", 2);
System.out.println(tm);
Run Code Online (Sandbox Code Playgroud)
它打印{vivek=2}所以它意味着地图允许在密钥的基础上覆盖?
我们开始检查我的应用程序的性能,因为它在一段时间后变慢.我正在使用jvisualvm来观察原因.任何人都可以告诉我如何在Unix中使用jvisualvm,就像在Windows中我们可以通过UI检查它.我们也可以在Unix中拥有相同的视图.
让我的jvisualvm路径是/ Prj/tools/java/bin/jvisualvm
当我使用帮助时,
Usage: /Prj/tools/java/bin/../lib/visualvm//platform7/lib/nbexec {options} arguments
General options:
--help show this help
--jdkhome <path> path to Java(TM) 2 SDK, Standard Edition
-J<jvm_option> pass <jvm_option> to JVM
--cp:p <classpath> prepend <classpath> to classpath
--cp:a <classpath> append <classpath> to classpath
Core options:
--laf <LaF classname> use given LookAndFeel class instead of the default
--fontsize <size> set the base font size of the user interface, in points
--locale <language[:country[:variant]]> use specified locale
--userdir <path> use specified directory to store user settings …Run Code Online (Sandbox Code Playgroud) 我正在查看sightly中使用的表达式选项.我尝试了下面的代码行,但似乎只是在页面上呈现文本,有人可以提供一些选项和一些很好的例子.
${'Assets' @ i18n, locale='fr-CH', hint='Translation Hint'}
${'Page {0} of {1}' @ format = [count,total] }
Run Code Online (Sandbox Code Playgroud)
我已经尝试并理解下面的代码来包含parsys
<div data-sly-resource ="${@path='question_list', resourceType='wcm/foundation/components/parsys'}"></div>
Run Code Online (Sandbox Code Playgroud)
此外,我可以从中获取数据狡猾的[元素]的整个列表.
谢谢
我已将 hybris 服务器从 mac 复制到 windows 机器。在 Mac 中,hybris 实例运行良好,但在 Windows 中出现一些错误,因此无法看到 hybris 登录页面。下面是堆栈跟踪。
ERROR [localhost-startStop-3] [ContextLoader] Context initialization failed
java.lang.NullPointerException: null
at java.net.URI$Parser.parse(URI.java:3042) ~[?:1.8.0_201]
at java.net.URI.<init>(URI.java:588) ~[?:1.8.0_201]
at java.net.URI.create(URI.java:850) ~[?:1.8.0_201]
at com.hybris.backoffice.BackofficeModulesManager.lambda$8(BackofficeModulesManager.java:533) ~[classes/:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_201]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_201]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_201]
at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_201]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_201]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_201]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_201]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_201]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_201]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_201]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_201]
at com.hybris.backoffice.BackofficeModulesManager.assureCorrectExistingModulesStructure(BackofficeModulesManager.java:532) ~[classes/:?]
at com.hybris.backoffice.BackofficeApplicationContext.prepareRefresh(BackofficeApplicationContext.java:96) ~[classes/:?]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:512) ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) ~[spring-web-4.3.17.RELEASE.jar:4.3.17.RELEASE]
at …Run Code Online (Sandbox Code Playgroud) 我正在寻找 Facebook 页面上发布的信息。我可以按如下方式访问api https://graph.facebook.com/v2.8/203511053776284/feed?limit=100&access_token=XXXXXXXXXXX&format=json。我可以获得以下数据,但没有与帖子相关的图像。
data": [
{
"message": "This is my first post",
"created_time": "2018-05-16T08:05:02+0000",
"id": "203511053776284_203511440442912"
}
]
Run Code Online (Sandbox Code Playgroud)
任何方法都可以从 Facebook 页面获取所有信息。
我以这种方式有3个OSGi捆绑包,实现的类具有相同的名称,但是在不同的捆绑包中:
Bundle A (com.adobe) ---- Interface ( foo() )
Bundle B (org.custom) ---- ChildClassA ( foo() {} )
Bundle C (myprj.adobe) ---- ChildClassA ( foo() {} )
Run Code Online (Sandbox Code Playgroud)
我有一个摘要如下:
Interface refObj;
refObj.foo();
Run Code Online (Sandbox Code Playgroud)
我如何从另一个包中注入特定实现类的对象。
谢谢,
我的对话框中有3个复选框小部件,并且在没有选择代码的情况下执行逻辑,问题是当我勾选option1选项2时,它们在内容节点中将它们的值设置为"ON".但是如果我编辑相同的组件option1,则选择option2,我取消选择一个并单击ok,仍然在内容节点属性中存在值为"ON"的情况.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
title="dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Select Options">
<items jcr:primaryType="cq:WidgetCollection">
<facebook
jcr:primaryType="cq:Widget"
fieldLabel="Facebook"
name="./facebook"
xtype="checkbox"/>
<twitter
jcr:primaryType="cq:Widget"
fieldLabel="Twitter"
name="./twitter"
xtype="checkbox"/>
<linkedin
jcr:primaryType="cq:Widget"
fieldLabel="Linkedin"
name="./linkedin"
xtype="checkbox"/>
</items>
</tab1>
</items>
</items>
</jcr:root>
Run Code Online (Sandbox Code Playgroud) 我想使用Optional实用程序在JDK8中执行空检查.这是我写的代码,它给了我一个错误:
java.util.Optional stringToUse = java.util.Optional.of(childPage.getContentResource().getValueMap().get("jcr:description").toString());
stringToUse.ifPresent(description = stringToUse);
Run Code Online (Sandbox Code Playgroud)
这里"jcr:description"可以存在与否.如果它存在,我想在描述变量中使用该值,如果为null,则只需设置空白字符串以进行描述.Lambda表达式也可以在这里使用吗?谢谢
嗨我在jquery下使用锚标签后添加跨度.
以下是我的代码:
$(document).ready(function(){
$("a.ext-or-pdf-link").append("<span class=test>test</span>");
});
Run Code Online (Sandbox Code Playgroud)
但这是在<a>标签内添加span 但我想以<a>这种方式添加<a ...> text </a><span class=test>test</span>.
任何的想法?
谢谢
我有监听器选择器隐藏和显示基于所选值的文本字段.我想实现将要强制填写的值.我在我的监听器中使用allowdBlank为true但它不起作用.以下是我的倾听者.
function(selection,record,path)
{
var dialog=selection.findParentByType('panel');
var email = dialog.getComponent('email1');
var url = dialog.getComponent('url1');
if(record == 'email'){
url.hide();
url.setValue("");
email.show(); //how to make email manadory
}
if(record == 'link'){
email.hide();
email.setValue("");
url.show();
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢