lushuaiyin的博客
lushuaiyin · 共 1200 篇文章
HttpClient入门
HttpClient 基本功能的使用 GET 方法 使用 HttpClient 需要以下 6 个步骤: 1. 创建 HttpClient 的实例 2. 创建某种连接方法的实例,在这里是 GetMethod。在 GetMethod 的构造函数中传入待连接的地址 3. 调用第一步中创建好的实例的 execute 方法来执行第二步中创建好的 method 实例 4. 读 response 5. 释放连接。无论执行方法是否成功,都必须释放连接 6. 对得到后的内容进行处理 根据以上步骤,我们来编写用GET方法来取得某网页内容的代码。 大部分情况下 HttpClient 默认的构造函数已经足够使用。 …
2011-08-31 20:57 · 评论(0)
HttpClient入门
HttpClient 基本功能的使用 GET 方法 使用 HttpClient 需要以下 6 个步骤: 1. 创建 HttpClient 的实例 2. 创建某种连接方法的实例,在这里是 GetMethod。在 GetMethod 的构造函数中传入待连接的地址 3. 调用第一步中创建好的实例的 execute 方法来执行第二步中创建好的 method 实例 4. 读 response 5. 释放连接。无论执行方法是否成功,都必须释放连接 6. 对得到后的内容进行处理 根据以上步骤,我们来编写用GET方法来取得某网页内容的代码。 大部分情况下 HttpClient 默认的构造函数已经足够使用。 …
2011-08-31 20:57 · 评论(0)
HttpClient入门
HttpClient 基本功能的使用 GET 方法 使用 HttpClient 需要以下 6 个步骤: 1. 创建 HttpClient 的实例 2. 创建某种连接方法的实例,在这里是 GetMethod。在 GetMethod 的构造函数中传入待连接的地址 3. 调用第一步中创建好的实例的 execute 方法来执行第二步中创建好的 method 实例 4. 读 response 5. 释放连接。无论执行方法是否成功,都必须释放连接 6. 对得到后的内容进行处理 根据以上步骤,我们来编写用GET方法来取得某网页内容的代码。 大部分情况下 HttpClient 默认的构造函数已经足够使用。 …
2011-08-31 20:57 · 评论(0)
在struts.xml文件中使用spring代理,管理action
使用代理,指明处理action的xml文件,然后原来action里指定的类都改成type="org.springframework.web.struts.DelegatingActionProxy" <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/action-servlet.xml"/> </plug-in> 例子 你要spring管理action 可以这样子实现一下 …
2011-08-31 20:56 · 评论(0)
在struts.xml文件中使用spring代理,管理action
使用代理,指明处理action的xml文件,然后原来action里指定的类都改成type="org.springframework.web.struts.DelegatingActionProxy" <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/action-servlet.xml"/> </plug-in> 例子 你要spring管理action 可以这样子实现一下 …
2011-08-31 20:56 · 评论(0)
在struts.xml文件中使用spring代理,管理action
使用代理,指明处理action的xml文件,然后原来action里指定的类都改成type="org.springframework.web.struts.DelegatingActionProxy" <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/action-servlet.xml"/> </plug-in> 例子 你要spring管理action 可以这样子实现一下 …
2011-08-31 20:56 · 评论(0)
连接字符串
com.mysql.jdbc.Driver org.gjt.mm.mysql.Driver ////////////////////////////////////////////// JDBC连接字符串大全(2009-06-13 07:54:07)转载标签: jdbc杂谈 分类: Java 各种数据库的JDBC连接大全 MySQL JDBC Name: Connector/J 3.0 URL: http://www.mysql.com/ Version: 3.0.8-stable Download URL: http://www.mysql.com/downloads/api-jdbc-s…
2011-08-31 20:55 · 评论(0)
连接字符串
com.mysql.jdbc.Driver org.gjt.mm.mysql.Driver ////////////////////////////////////////////// JDBC连接字符串大全(2009-06-13 07:54:07)转载标签: jdbc杂谈 分类: Java 各种数据库的JDBC连接大全 MySQL JDBC Name: Connector/J 3.0 URL: http://www.mysql.com/ Version: 3.0.8-stable Download URL: http://www.mysql.com/downloads/api-jdbc-s…
2011-08-31 20:55 · 评论(0)
连接字符串
com.mysql.jdbc.Driver org.gjt.mm.mysql.Driver ////////////////////////////////////////////// JDBC连接字符串大全(2009-06-13 07:54:07)转载标签: jdbc杂谈 分类: Java 各种数据库的JDBC连接大全 MySQL JDBC Name: Connector/J 3.0 URL: http://www.mysql.com/ Version: 3.0.8-stable Download URL: http://www.mysql.com/downloads/api-jdbc-s…
2011-08-31 20:55 · 评论(0)
web.xml中配置spring字符编码过滤器
<filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true<…
2011-08-31 20:53 · 评论(0)
web.xml中配置spring字符编码过滤器
<filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true<…
2011-08-31 20:53 · 评论(0)
web.xml中配置spring字符编码过滤器
<filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true<…
2011-08-31 20:53 · 评论(0)
struts2action与struts.xml传参问题
struts2 通过配置struts.xml看action之间如何传递参数2010-11-11 113752 分类: 默认分类 标签:struts 两个 action 之间 传递 字号大中小 订阅 . 需求功能是这样:Action1 获取数据库配置内容,得到相应Model的 动态URL ,这里的URL 有的是Action有的是JSP页面。 1.使用result 类型中的 redirect 类型,如下: result name=success type=redirect${dynamicUrl}objectId=${objectId}¶m1=${param1}result 这样传参才能…
2011-08-31 20:48 · 评论(0)
struts2action与struts.xml传参问题
struts2 通过配置struts.xml看action之间如何传递参数2010-11-11 113752 分类: 默认分类 标签:struts 两个 action 之间 传递 字号大中小 订阅 . 需求功能是这样:Action1 获取数据库配置内容,得到相应Model的 动态URL ,这里的URL 有的是Action有的是JSP页面。 1.使用result 类型中的 redirect 类型,如下: result name=success type=redirect${dynamicUrl}objectId=${objectId}¶m1=${param1}result 这样传参才能…
2011-08-31 20:48 · 评论(0)
struts2action与struts.xml传参问题
struts2 通过配置struts.xml看action之间如何传递参数2010-11-11 113752 分类: 默认分类 标签:struts 两个 action 之间 传递 字号大中小 订阅 . 需求功能是这样:Action1 获取数据库配置内容,得到相应Model的 动态URL ,这里的URL 有的是Action有的是JSP页面。 1.使用result 类型中的 redirect 类型,如下: result name=success type=redirect${dynamicUrl}objectId=${objectId}¶m1=${param1}result 这样传参才能…
2011-08-31 20:48 · 评论(0)