因为程序结果不对
我想调试 applet 与servlet 通行过程 但 applet 的 断点好像不起作用啊??
请高手 帮忙 指点指点!!!!!!!!!!!!!
applet 中的方法
private CoastData getDataUsingHttpObject(boolean isUnZoom, String where) {
Boolean isUnzoom = new Boolean(isUnZoom);
codeBaseField.setText(getCodeBase().toString());
try {
URL urltmp = new URL(getCodeBase(),"neu/softlab/ocean/map/servlet/onlyDrawServlet");
Properties props = new Properties();
props.put("format", "object");
props.put("where", where);
props.put("isUnZoom", isUnzoom.toString()); String argString = ""; // default if (props != null) {
argString = "?" + toEncodedString(props); }
URL url = new URL(urltmp.toExternalForm() + argString);
codeBaseField.setText(url.toString());
URLConnection con = url.openConnection();
con.setUseCaches(false);
InputStream in = con.getInputStream();
ObjectInputStream result = new ObjectInputStream(in);
Object obj = result.readObject();
CoastData tmpcoastData = (CoastData) obj;
in.close();
return tmpcoastData;
}
catch (Exception e) {
e.printStackTrace();
return null;
}
}
private String toEncodedString(Properties args) {
StringBuffer buf = new StringBuffer();
Enumeration names = args.propertyNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
String value = args.getProperty(name);
buf.append(URLEncoder.encode(name) + "=" + value);
if (names.hasMoreElements()) {
buf.append("&");
}
}
return buf.toString();
}servlet 的方法public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
if ("object".equals(req.getParameter("format"))) {
ObjectOutputStream out = new ObjectOutputStream(res.getOutputStream());
if ("true".equals(req.getParameter("isUnZoom"))) {
out.writeObject(getTmpData());
}
}
}
我想调试 applet 与servlet 通行过程 但 applet 的 断点好像不起作用啊??
请高手 帮忙 指点指点!!!!!!!!!!!!!
applet 中的方法
private CoastData getDataUsingHttpObject(boolean isUnZoom, String where) {
Boolean isUnzoom = new Boolean(isUnZoom);
codeBaseField.setText(getCodeBase().toString());
try {
URL urltmp = new URL(getCodeBase(),"neu/softlab/ocean/map/servlet/onlyDrawServlet");
Properties props = new Properties();
props.put("format", "object");
props.put("where", where);
props.put("isUnZoom", isUnzoom.toString()); String argString = ""; // default if (props != null) {
argString = "?" + toEncodedString(props); }
URL url = new URL(urltmp.toExternalForm() + argString);
codeBaseField.setText(url.toString());
URLConnection con = url.openConnection();
con.setUseCaches(false);
InputStream in = con.getInputStream();
ObjectInputStream result = new ObjectInputStream(in);
Object obj = result.readObject();
CoastData tmpcoastData = (CoastData) obj;
in.close();
return tmpcoastData;
}
catch (Exception e) {
e.printStackTrace();
return null;
}
}
private String toEncodedString(Properties args) {
StringBuffer buf = new StringBuffer();
Enumeration names = args.propertyNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
String value = args.getProperty(name);
buf.append(URLEncoder.encode(name) + "=" + value);
if (names.hasMoreElements()) {
buf.append("&");
}
}
return buf.toString();
}servlet 的方法public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
if ("object".equals(req.getParameter("format"))) {
ObjectOutputStream out = new ObjectOutputStream(res.getOutputStream());
if ("true".equals(req.getParameter("isUnZoom"))) {
out.writeObject(getTmpData());
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货