struts2与cxf配置.优化

内容很简单.我之前配置cxf总是出来404我是看着demo做的啊,怎么会呢.

 

我就从项目中找啊找.我的项目是Spring2.5.6+Hibernate3.3.1+Struts2.1.8.1+urlrewrite3.2+cxf2.3.5

 

这个是我的web.xml

通常的都是这么配置的,但是你其他的写完了之后呢就会发现总是出现404错误.



	
		contextConfigLocation
		classpath:cngrideye-config.xml
	
	
        org.springframework.web.context.ContextLoaderListener
    
    
      
    	org.springframework.web.util.IntrospectorCleanupListener  
  	
  	
    
		CXFServlet
		org.apache.cxf.transport.servlet.CXFServlet
		1
	

	
		CXFServlet
		/services1/*
	
	
	   
	    UrlRewriteFilter   
	       
	        org.tuckey.web.filters.urlrewrite.UrlRewriteFilter   
	       
	       
	        logLevel   
	        WARN   
	       
	   
	   
	    UrlRewriteFilter   
	    /*
	  
	 
	
		struts2
		
		org.apache.struts2.dispatcher.FilterDispatcher
		
	
	
		struts2
		/*
		REQUEST     
        FORWARD     
       	INCLUDE    
		
	
	
	
	
	
	
		index.jsp
	
	
		BASIC
	
 


 

我的cxf配置如下.




	
	
	
	


 

 

404如下:

 


 

这时候就有多种解决方法了.

第一就是:把struts2匹配原则改一下改成*.action

第二就是:把cxf匹配改一下,改成*.ws

第三就是:吧bean里面修改改成helloword.ws

 

我建议用第三种.

 

你可能感兴趣的:(struts2与cxf配置.优化)