客户端调用代码: String url = "http://localhost:8080/Test/testServer.do";
HttpClient httpClient = new HttpClient();
HttpMethod httpMethod = new GetMethod(url);
httpClient.executeMethod(httpMethod);
String result=httpMethod.getResponseBodyAsString();
System.out.println("返回结果: "+result);请教:服务器端代码,该怎么写?
HttpClient httpClient = new HttpClient();
HttpMethod httpMethod = new GetMethod(url);
httpClient.executeMethod(httpMethod);
String result=httpMethod.getResponseBodyAsString();
System.out.println("返回结果: "+result);请教:服务器端代码,该怎么写?
解决方案 »
- http://schemas.xmlsoap.org/soap/envelope/}Server.userException
- session取不到值???求解
- hibernate配置的一个小问题
- hibernate 可以通过配置 substitutions 转义单引号吗?如果可以如何写呢?
- 怎样将值传给确定的<html:radio>,让其选定
- 谁有关于使用corba的完整例子
- 如何实现JAVA回调方法跨平台?急!!!
- 读hibernate文档的时候遇到的问题
- 怎样触发Servlet 链,请大家帮忙!
- weblogic我受不了了,我快对weblogic失望透了
- c#和xna一起开发游戏 那java和哪个软件一起呢
- org.springframework.web.context.support.XmlWebApplicationContext
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>xxx.ooo.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/testServer.do</url-pattern>
</servlet-mapping> 应用发布时,Context路径为:Test
response.getOutputStream();
使用response.getWriter().write("HelloWorld");下面客户端代码不能取到值
String url = "http://localhost:8080/Test/testServer.do";
HttpClient httpClient = new HttpClient();
HttpMethod httpMethod = new GetMethod(url);
httpClient.executeMethod(httpMethod);
String result=httpMethod.getResponseBodyAsString();
System.out.println("返回结果: "+result);
http://localhost:8080/Test/testServer.do
能看到什么?你的Servlet是怎么写的?