我在Vista 64位上使用Java 6 64位和STANDALONE Tomcat 6.0.18.我正在使用struts 1.3.10和tile进行Web应用程序.现在,当我对java或jsp文件进行更改时,在重新加载页面时它们不可见.我必须在Tomcat Manager中手动重新加载Web应用程序才能查看更改.我的网络应用配置如下:
$CATALINA_BASE/conf/Catalina/localhost/dashboard.xml
<Context docBase="D:/mydata/projects/PatchworkSystems/development/Dashboard/webapp"
path="/dashboard"
reloadable="true" antiJARLocking="true" antiResourceLocking="true" debug="1" />
Run Code Online (Sandbox Code Playgroud)
任何帮助是极大的赞赏.
谢谢Quadir
我正在尝试使用ProcessBuilder和Process执行命令(例如ps -ef | grep apache).只要'ps -ef'的输出很小,代码就可以工作.但如果输出太大,程序就会挂起.有没有办法来解决这个问题?这是基于[ http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html]的代码
#### Program.java ####
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class Program {
private List<String> command;
public Program(String commandString) throws IOException {
this(commandString, null);
}
public List<String> getCommand() {
return this.command;
}
private void setCommand(String filename, String location, String commandString, List<String> parameters) throws IOException {
if(filename != null) {
commandString = new File(location, filename).getCanonicalPath();
}
this.command =
Collections.synchronizedList(new ArrayList<String>());
this.command.add(commandString); …Run Code Online (Sandbox Code Playgroud) 在下面的代码中,我试图通过产生优先级较低的线程来获得更高优先级的线程.但它似乎不起作用,优先级较低的线程似乎在较低优先级的线程完成后运行.谁能解释我做错了什么?
import java.util.ArrayList;
import java.util.List;
public class TestThreadPriority extends Thread {
static List<String> messages = new ArrayList<String>();
public void run() {
Thread t = Thread.currentThread();
int priority = t.getPriority();
String name = t.getName();
messages.add(name + ":" + priority);
Thread.yield();
messages.add(name + ":" + priority);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Thread t = Thread.currentThread();
t.setPriority(MIN_PRIORITY);
int priority = t.getPriority();
String name = t.getName();
messages.add(name + ":" + priority);
Thread tp1 = new TestThreadPriority();
tp1.setPriority(MIN_PRIORITY); …Run Code Online (Sandbox Code Playgroud)