posts - 11, comments - 4, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

2009年6月11日

     摘要: class zyfsort {
3 public static void main (String[] args) {
4 int gohome[] = new int[]{12,7,54,21,1,4,65,76,34,9,3,6};
5 System.out.println("插入排序算法");
6// InsertionSort(gohome);
7 System.out.println("-------------------------------------------");
8 System.out.println("选择排序算法");
9// SelectSort(gohome);
10 System.out.println("-------------------------------------------");
11 System.ou  阅读全文

posted @ 2009-06-11 11:10 析木 阅读(26) | 评论 (0)编辑 收藏

2009年5月20日

1、在web.xml中的配置
<context-param>  
    
<param-name>contextConfigLocation</param-name>  
    
<param-value>  
        /WEB-INF/config/applicationContext.xml,   
        /WEB-INF/Hessian-servlet.xml   
    
</param-value>  
</context-param>  
           
<servlet>  
    
<servlet-name>Hessian</servlet-name>  
    
<servlet-class>  
        org.springframework.web.servlet.DispatcherServlet   
    
</servlet-class>  
    
<load-on-startup>1</load-on-startup>  
</servlet>  
           
<servlet-mapping>  
    
<servlet-name>Hessian</servlet-name>  
    
<url-pattern>/hessian/*</url-pattern>  
</servlet-mapping>
2.必须在WEB-INF目录下创建一个文件名格式为Hessian-servlet.xml的配置文件
<!-- 业务类 -->  
<bean id="hessianService" class="com.weijy.webservice.hessian.HessianServiceImpl"/>  
           
<!-- 远程服务 -->  
<bean name="/hessianService" class="org.springframework.remoting.caucho.HessianServiceExporter">  
    
<property name="service" ref="hessianService"/>  
    
<property name="serviceInterface">  
        
<value>com.cjm.webservice.hessian.HessianService</value>  
    
</property>  
</bean>
3.客户端调用
String url = "http://localhost:8888/spring2/hessian/hessianService";   
HessianProxyFactory factory 
= new HessianProxyFactory();   
HessianService hessianServer 
=    
            (HessianService)factory.create(HessianService.
class, url);   
String ret 
= hessianServer.sayHello("Raymond.chen");  
//.................... 
若使用spring则可通过 HessianProxyFactoryBean在客户端连接服务,在spring的配置中加入:
<bean id="hessianService " class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
   
<property name="serviceUrl" value="http://localhost:8888/spring2/hessian/hessianService"/>
   
<property name="serviceInterface" value="com.weijy.webservice.hessian.HessianService"/>
</bean>
加入以上的配置后,就可像使用其他的bean一样去操作了。原来实现一个webservice是可以这么简单的。

posted @ 2009-05-20 18:12 析木 阅读(856) | 评论 (0)编辑 收藏

2009年2月27日

     摘要: 首先添加相应jar包到web-inf的lib里面。

一、在web.xml添加下面代码

Apache-Axis Servlet
AxisServlet
org.apache.axis2.transport.http.AxisServlet
1
  阅读全文

posted @ 2009-02-27 11:23 析木 阅读(1323) | 评论 (0)编辑 收藏

2009年1月6日

     摘要: 如果我们的系统不是分布式的(在分布式里,我一般自己加载spring的配置文件),不是一般的application,通过自己加载Spring的配置文件的方式。而是一般的web应用,我们通过在web.xml里配置spring的配置文件。  阅读全文

posted @ 2009-01-06 13:27 析木 阅读(172) | 评论 (0)编辑 收藏

2008年10月21日

     摘要: 一、根据数据库表生成*.hbm.xml文件。
1、 从Hibernate官方网站下载Middlegen-Hibernate和hibernate-extensions,并解压。
2、在Middlegen-Hibernate-r5\config\database子目录中,根据我们选择的数据库类型打开对应的数据库文件。如我们这里选择MYSQL,打开mysql.xml  阅读全文

posted @ 2008-10-21 20:00 析木 阅读(372) | 评论 (0)编辑 收藏

我要啦免费统计