我看到Eclipse有两个主要的发行版 - 一个是3.6,3.7,3.8路径,另一个是4.0,4.1路径(http://www.eclipse.org/e4/).
我不清楚这两个发行版之间有什么区别?
我一直在研究从动态Web应用程序中提取信息的程序,该程序运行正常,直到我将我的tomcat服务器设置为使用自签名(因此,不受信任)证书使用SSL.错误的堆栈跟踪是:
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
Error: 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.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1584)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:848)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:877)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1089)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1116)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1100)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:857)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
at com.certicom.gls.glscs.nongui.URLReader$PostURL.setupURL(URLReader.java:34)
at com.certicom.gls.glscs.nongui.URLReader.getLogin(URLReader.java:227)
at com.certicom.gls.glscs.nongui.URLReader.testLogin(URLReader.java:436)
at com.certicom.gls.glscs.nongui.Controller.loginMenu(Controller.java:384)
at com.certicom.gls.glscs.nongui.Controller.menu(Controller.java:324)
at com.certicom.gls.glscs.nongui.Controller.<init>(Controller.java:49)
at com.certicom.gls.glscs.nongui.Controller.main(Controller.java:61)
Run Code Online (Sandbox Code Playgroud)
在Web浏览器中,当访问具有不受信任证书的HTTPS站点时,系统会向用户发出警告,并且如果他想继续,则要求例外; …
我正在迁移我们的java-ee项目以使用Maven而不是Ant.
对于以下依赖项
<dependency>
<groupId>javolution</groupId>
<artifactId>javolution</artifactId>
<version>5.4.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
尝试编译时出现以下错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
3.2:compile (default-compile) on project JAdaptiv: Compilation failure
[ERROR] error: error reading C:\Users\User.IVSTEL1\.m2\repository\javolution\
javolution\5.4.2\javolution-5.4.2.jar; invalid CEN header (bad signature)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on
project JAdaptiv: Compilation failure
error: error reading C:\Users\User.IVSTEL1\.m2\repository\javolution\javoluti
on\5.4.2\javolution-5.4.2.jar; invalid CEN header (bad signature)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161) …
Run Code Online (Sandbox Code Playgroud) 我正在搜索一种支持的方式来渲染JSF中的一段代码,我通常使用这种方法:
<ui:fragment rendered="#{condition}">
<h:outputText value="text 1"/>
<h:outputText value="text 2"/>
<h:outputText value="text 3"/>
</ui:fragment>
Run Code Online (Sandbox Code Playgroud)
由于ui:fragment不支持渲染大部分IDE(如netbeans将其标记为错误但是它可以工作,因为在JSF参数中是继承的.
解决此问题的一种方法是使用另一种结构(例如,如果您使用SEAM)
<s:div rendered="#{condition}">
....
</s:div>
Run Code Online (Sandbox Code Playgroud)
另一种方法是在所有内部内容中设置渲染,如下所示:
<h:outputText value="text 1" rendered="#{condition}"/>
<h:outputText value="text 2" rendered="#{condition}"/>
<h:outputText value="text 3" rendered="#{condition}"/>
Run Code Online (Sandbox Code Playgroud)
但我不喜欢这种方式,因为你必须将渲染添加到每个元素.
另一种方法是使用<c:if test="#{condtion}">
BUT c:如果从JSF树中删除元素,而不是你总是想要做的,特别是如果你使用AJAX.
所以你们有另一种解决方案吗?
我正在使用Spring MVC编写Web应用程序.我正在使用控制器的注释等.一切都工作正常,除了它涉及应用程序中的实际链接(表单操作,<a>
标签等)当前,我有这个(显然缩写):
//In the controller
@RequestMapping(value="/admin/listPeople", method=RequestMethod.GET)
//In the JSP
<a href="/admin/listPeople">Go to People List</a>
Run Code Online (Sandbox Code Playgroud)
当我直接输入"http:// localhost:8080/MyApp/admin/listPeople"这样的URL时,页面会正确加载.但是,上面的链接不起作用.它丢失了应用程序名称"MyApp".
有谁知道是否有办法配置Spring在那里抛出应用程序名称?
如果您需要查看我的任何Spring配置,请告诉我.我正在使用带有视图解析器等的标准调度程序servlet.
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
Run Code Online (Sandbox Code Playgroud)
请告诉我上面代码实际上做了什么.我正在寻找逐行解释.特别是第一行并告诉我为什么我们使用它,在什么情况下我们必须使用它.
我有DataSource,它在context.xml中的Tomcat 6上配置为MyDataSource.我正在通过以下方式获取它:
DataSource dataSource;
try {
dataSource = (DataSource) new InitialContext().lookup("java:comp/env/MyDataSource");
} catch (NamingException e) {
throw new DaoConfigurationException(
"DataSource '" + url + "' is missing in JNDI.", e);
}
Run Code Online (Sandbox Code Playgroud)
一切正常.现在我将此代码导出到Jboss AP 6.我将我的dataSource及其连接池配置为local-tx dataSource,名称相同.
当我执行上面的代码时,我收到了NamingException异常.经过一番调查后,我发现在Jboss下调用我的DataSource的正确方法是
dataSource = (DataSource) new InitialContext().lookup("java:/MyDataSource");
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释一下我为什么要在Jboss下的JNDI路径中省略"comp/env"?
我刚刚继承了在JSF中实现的项目.我有以下代码在Chrome中看起来不错,但Firefox在"空"列表项上呈现边框:
<ul>
<li><a href="/home">Home</li>
<li>
<s:link view="/signup.xhtml" rendered="#{someCondition}">Sign Up</s:link>
</li>
<!-- etc... -->
</ul>
Run Code Online (Sandbox Code Playgroud)
最终看起来像:
是否有一个JSF标签有条件地渲染<li>
?
我何时选择部署为JBoss SAR而不是EAR?
这是一个更普遍的问题,我正在寻找解释每个部署模型的优缺点的指南,以及哪一个适用.
我有一个杰克逊问题.
有没有办法反序列化可能有两种类型的属性,对于某些对象,它看起来像这样
"someObj" : { "obj1" : 5, etc....}
Run Code Online (Sandbox Code Playgroud)
然后对于其他人来说,它看起来像一个空数组,即
"someObj" : []
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏!
谢谢!