eclipse中项目会默认发布在workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps目录下,然后启动其中一个server的时候在浏览器中输入localhost:8080/myapp/list这种url会报404,要怎么才能访问?
我知道有种方法,清空server双击进入属性页面将发布目录改成本地tomcat安装路径下的webapps目录下,但是这样有个问题,就是假如我有多个web工程,这样就会都放在webapps目录下,每次启动tomcat就会多个项目同时启动,这不是我要的。
我想要的就是new一个server就用eclipse默认的配置,里面部署一个项目,启动这个server就可以在浏览器访问,该怎么弄? 求大神提点一下。
2 个解决方案
#1
大神帮忙看下啊,不尽感激
#2
public static void main(String[] args) {
String a="\\u0031\\u0030\\u0030\\u591a\\u4e2a\\u004a\\u0061\\u0076\\u0061\\u0057\\u0065\\u0062\\u9879\\u76ee\\u6e90\\u7801\\u002b\\u89c6\\u9891\\u0020\\u53ea\\u8981\\u0031\\u0030\\u5143\\u0020\\u6beb\\u65e0\\u4fdd\\u7559\\u7ed9\\u4f60\\u0020\\u0020\\u0053\\u0070\\u0072\\u0069\\u006e\\u0067\\u0020\\u0068\\u0069\\u0062\\u0065\\u0072\\u006e\\u0061\\u0074\\u0065\\u0020\\u006d\\u0079\\u0062\\u0061\\u0074\\u0069\\u0073\\u6846\\u67b6\\u0020\\u000d\\u000a\\u5e73\\u5747\\u4e00\\u4e2a\\u4e00\\u6bdb\\u94b1\\u4e0d\\u5230\\u000d\\u000a\\u5fae\\u4fe1\\uff1a\\u006a\\u0061\\u0076\\u0061\\u006a\\u0064\\u0062\\u0063\\u000d\\u000a\\u5b98\\u7f51\\uff1a\\u0077\\u0077\\u0077\\u002e\\u006a\\u0061\\u0076\\u0061\\u0030\\u0039\\u0030\\u0039\\u002e\\u0063\\u006f\\u006d\\uff08\\u5b98\\u7f51\\u53ef\\u4ee5\\u0032\\u0034\\u5c0f\\u65f6\\u81ea\\u52a8\\u53d1\\u8d27\\u0020\\u652f\\u4ed8\\u5b9d\\u63a5\\u53e3\\uff09";
System.out.println(decode(a));
}
public static String decode(String unicodeStr) {
if (unicodeStr == null) {
return null;
}
StringBuffer retBuf = new StringBuffer();
int maxLoop = unicodeStr.length();
for (int i = 0; i < maxLoop; i++) {
if (unicodeStr.charAt(i) == '\\') {
if ((i < maxLoop - 5)
&& ((unicodeStr.charAt(i + 1) == 'u') || (unicodeStr
.charAt(i + 1) == 'U')))
try {
retBuf.append((char) Integer.parseInt(
unicodeStr.substring(i + 2, i + 6), 16));
i += 5;
} catch (NumberFormatException localNumberFormatException) {
retBuf.append(unicodeStr.charAt(i));
}
else
retBuf.append(unicodeStr.charAt(i));
} else {
retBuf.append(unicodeStr.charAt(i));
}
}
return retBuf.toString();
}
String a="\\u0031\\u0030\\u0030\\u591a\\u4e2a\\u004a\\u0061\\u0076\\u0061\\u0057\\u0065\\u0062\\u9879\\u76ee\\u6e90\\u7801\\u002b\\u89c6\\u9891\\u0020\\u53ea\\u8981\\u0031\\u0030\\u5143\\u0020\\u6beb\\u65e0\\u4fdd\\u7559\\u7ed9\\u4f60\\u0020\\u0020\\u0053\\u0070\\u0072\\u0069\\u006e\\u0067\\u0020\\u0068\\u0069\\u0062\\u0065\\u0072\\u006e\\u0061\\u0074\\u0065\\u0020\\u006d\\u0079\\u0062\\u0061\\u0074\\u0069\\u0073\\u6846\\u67b6\\u0020\\u000d\\u000a\\u5e73\\u5747\\u4e00\\u4e2a\\u4e00\\u6bdb\\u94b1\\u4e0d\\u5230\\u000d\\u000a\\u5fae\\u4fe1\\uff1a\\u006a\\u0061\\u0076\\u0061\\u006a\\u0064\\u0062\\u0063\\u000d\\u000a\\u5b98\\u7f51\\uff1a\\u0077\\u0077\\u0077\\u002e\\u006a\\u0061\\u0076\\u0061\\u0030\\u0039\\u0030\\u0039\\u002e\\u0063\\u006f\\u006d\\uff08\\u5b98\\u7f51\\u53ef\\u4ee5\\u0032\\u0034\\u5c0f\\u65f6\\u81ea\\u52a8\\u53d1\\u8d27\\u0020\\u652f\\u4ed8\\u5b9d\\u63a5\\u53e3\\uff09";
System.out.println(decode(a));
}
public static String decode(String unicodeStr) {
if (unicodeStr == null) {
return null;
}
StringBuffer retBuf = new StringBuffer();
int maxLoop = unicodeStr.length();
for (int i = 0; i < maxLoop; i++) {
if (unicodeStr.charAt(i) == '\\') {
if ((i < maxLoop - 5)
&& ((unicodeStr.charAt(i + 1) == 'u') || (unicodeStr
.charAt(i + 1) == 'U')))
try {
retBuf.append((char) Integer.parseInt(
unicodeStr.substring(i + 2, i + 6), 16));
i += 5;
} catch (NumberFormatException localNumberFormatException) {
retBuf.append(unicodeStr.charAt(i));
}
else
retBuf.append(unicodeStr.charAt(i));
} else {
retBuf.append(unicodeStr.charAt(i));
}
}
return retBuf.toString();
}
#1
大神帮忙看下啊,不尽感激
#2
public static void main(String[] args) {
String a="\\u0031\\u0030\\u0030\\u591a\\u4e2a\\u004a\\u0061\\u0076\\u0061\\u0057\\u0065\\u0062\\u9879\\u76ee\\u6e90\\u7801\\u002b\\u89c6\\u9891\\u0020\\u53ea\\u8981\\u0031\\u0030\\u5143\\u0020\\u6beb\\u65e0\\u4fdd\\u7559\\u7ed9\\u4f60\\u0020\\u0020\\u0053\\u0070\\u0072\\u0069\\u006e\\u0067\\u0020\\u0068\\u0069\\u0062\\u0065\\u0072\\u006e\\u0061\\u0074\\u0065\\u0020\\u006d\\u0079\\u0062\\u0061\\u0074\\u0069\\u0073\\u6846\\u67b6\\u0020\\u000d\\u000a\\u5e73\\u5747\\u4e00\\u4e2a\\u4e00\\u6bdb\\u94b1\\u4e0d\\u5230\\u000d\\u000a\\u5fae\\u4fe1\\uff1a\\u006a\\u0061\\u0076\\u0061\\u006a\\u0064\\u0062\\u0063\\u000d\\u000a\\u5b98\\u7f51\\uff1a\\u0077\\u0077\\u0077\\u002e\\u006a\\u0061\\u0076\\u0061\\u0030\\u0039\\u0030\\u0039\\u002e\\u0063\\u006f\\u006d\\uff08\\u5b98\\u7f51\\u53ef\\u4ee5\\u0032\\u0034\\u5c0f\\u65f6\\u81ea\\u52a8\\u53d1\\u8d27\\u0020\\u652f\\u4ed8\\u5b9d\\u63a5\\u53e3\\uff09";
System.out.println(decode(a));
}
public static String decode(String unicodeStr) {
if (unicodeStr == null) {
return null;
}
StringBuffer retBuf = new StringBuffer();
int maxLoop = unicodeStr.length();
for (int i = 0; i < maxLoop; i++) {
if (unicodeStr.charAt(i) == '\\') {
if ((i < maxLoop - 5)
&& ((unicodeStr.charAt(i + 1) == 'u') || (unicodeStr
.charAt(i + 1) == 'U')))
try {
retBuf.append((char) Integer.parseInt(
unicodeStr.substring(i + 2, i + 6), 16));
i += 5;
} catch (NumberFormatException localNumberFormatException) {
retBuf.append(unicodeStr.charAt(i));
}
else
retBuf.append(unicodeStr.charAt(i));
} else {
retBuf.append(unicodeStr.charAt(i));
}
}
return retBuf.toString();
}
String a="\\u0031\\u0030\\u0030\\u591a\\u4e2a\\u004a\\u0061\\u0076\\u0061\\u0057\\u0065\\u0062\\u9879\\u76ee\\u6e90\\u7801\\u002b\\u89c6\\u9891\\u0020\\u53ea\\u8981\\u0031\\u0030\\u5143\\u0020\\u6beb\\u65e0\\u4fdd\\u7559\\u7ed9\\u4f60\\u0020\\u0020\\u0053\\u0070\\u0072\\u0069\\u006e\\u0067\\u0020\\u0068\\u0069\\u0062\\u0065\\u0072\\u006e\\u0061\\u0074\\u0065\\u0020\\u006d\\u0079\\u0062\\u0061\\u0074\\u0069\\u0073\\u6846\\u67b6\\u0020\\u000d\\u000a\\u5e73\\u5747\\u4e00\\u4e2a\\u4e00\\u6bdb\\u94b1\\u4e0d\\u5230\\u000d\\u000a\\u5fae\\u4fe1\\uff1a\\u006a\\u0061\\u0076\\u0061\\u006a\\u0064\\u0062\\u0063\\u000d\\u000a\\u5b98\\u7f51\\uff1a\\u0077\\u0077\\u0077\\u002e\\u006a\\u0061\\u0076\\u0061\\u0030\\u0039\\u0030\\u0039\\u002e\\u0063\\u006f\\u006d\\uff08\\u5b98\\u7f51\\u53ef\\u4ee5\\u0032\\u0034\\u5c0f\\u65f6\\u81ea\\u52a8\\u53d1\\u8d27\\u0020\\u652f\\u4ed8\\u5b9d\\u63a5\\u53e3\\uff09";
System.out.println(decode(a));
}
public static String decode(String unicodeStr) {
if (unicodeStr == null) {
return null;
}
StringBuffer retBuf = new StringBuffer();
int maxLoop = unicodeStr.length();
for (int i = 0; i < maxLoop; i++) {
if (unicodeStr.charAt(i) == '\\') {
if ((i < maxLoop - 5)
&& ((unicodeStr.charAt(i + 1) == 'u') || (unicodeStr
.charAt(i + 1) == 'U')))
try {
retBuf.append((char) Integer.parseInt(
unicodeStr.substring(i + 2, i + 6), 16));
i += 5;
} catch (NumberFormatException localNumberFormatException) {
retBuf.append(unicodeStr.charAt(i));
}
else
retBuf.append(unicodeStr.charAt(i));
} else {
retBuf.append(unicodeStr.charAt(i));
}
}
return retBuf.toString();
}