我使用HttpURLConnection来做HTTP POST,但我总是得不到完整的响应.我想调试这个问题,但是当我逐步完成它的工作时.我认为这一定是一个时间问题,所以我添加了Thread.sleep,它确实使我的代码工作,但这只是一个临时的解决方法.我想知道为什么会发生这种情况以及如何解决.这是我的代码:
public static InputStream doPOST(String input, String inputMimeType, String url, Map<String, String> httpHeaders, String expectedMimeType) throws MalformedURLException, IOException {
URL u = new URL(url);
URLConnection c = u.openConnection();
InputStream in = null;
String mediaType = null;
if (c instanceof HttpURLConnection) {
//c.setConnectTimeout(1000000);
//c.setReadTimeout(1000000);
HttpURLConnection h = (HttpURLConnection)c;
h.setRequestMethod("POST");
//h.setChunkedStreamingMode(-1);
setAccept(h, expectedMimeType);
h.setRequestProperty("Content-Type", inputMimeType);
for(String key: httpHeaders.keySet()) {
h.setRequestProperty(key, httpHeaders.get(key));
if (logger.isDebugEnabled()) {
logger.debug("Request property key : " + key + " / value : " + httpHeaders.get(key));
}
} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试实现一个相当复杂的页面流(100多页)作为传统的Web应用程序.我找到了一些选择,但没有一个是100%令人信服的
此外,我发现了许多像这样的废弃项目:http://javasteps.sourceforge.net/
我想知道为什么所有这些项目都被放弃了,2012年实现复杂页面流的方式是什么?
我有一个包含数千个编译警告的大型Java项目.我想找到一种方法来阻止开发人员提交带有警告的文件,因此逐渐所有警告都会消失.如果我提交带有编译错误的文件Eclipse会显示错误消息,但我无法找到任何方法来执行相同的警告.我发现最接近的是提交警告检查器http://commitwarncheck.sourceforge.net/但是它没有真正集成到提交过程中,它只提供了一个视图.有没有更好的解决方案?
我注意到在某些情况下,IE8中的表单元素不能透明.结果取决于位置:相对CSS标签.以下HTML演示了此问题:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>title</title>
<style type="text/css">
.ie-opaque {
zoom : 1;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50);
}
.relative {
position: relative;
}
</style>
</head>
<body>
<div class="ie-opaque">
<form>
<fieldset>
<ol>
<li class="relative">
<label for="test">label</label>
<input id="test"/>
</li>
<li class="relative">
<button>push</button>
</li>
<li>
<label for="test">label</label>
<input id="test"/>
</li>
<li>
<button>push</button>
</li>
</ol>
</fieldset>
</form>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在IE8中,项目3和4是透明的,1和2不是.知道为什么吗?
我有一个 Spring Batch (2.2.2) 应用程序,由于某种原因无法使作业参数增量工作。该步骤声明如下:
<job id="job1" xmlns="http://www.springframework.org/schema/batch" incrementer="incrementer">
<step id="step1" parent="step" />
</job>
<bean id="incrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer" />
Run Code Online (Sandbox Code Playgroud)
当我将断点放入增量器时,它甚至没有被调用。
使用相同的参数两次调用作业会出现以下异常:
A job instance already exists and is complete for parameters={fail=false}. If you want to run this job again, change the parameters.
Run Code Online (Sandbox Code Playgroud)
我在这里检查了官方样品
https://github.com/spring-projects/spring-batch-admin/tree/master/spring-batch-admin-sample
它有同样的问题
java ×3
architecture ×1
eclipse ×1
javascript ×1
opacity ×1
page-flow ×1
spring-batch ×1
subclipse ×1
svn ×1