<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>java_code</title>
    <description></description>
    <link>http://java-code.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>一个好的RSS地址</title>
        <author>java_code</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://java-code.javaeye.com">java_code</a>&nbsp;
          链接：<a href="http://java-code.javaeye.com/blog/212688" style="color:red;">http://java-code.javaeye.com/blog/212688</a>&nbsp;
          发表时间: 2008年07月08日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <a href="http://man.lupaworld.com/content/develop/open-open/indexrss.xml" target="_blank">http://man.lupaworld.com/content/develop/open-open/indexrss.xml</a>
          <br/>
          <span style="color:red;">
            <a href="http://java-code.javaeye.com/blog/212688#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Tue, 08 Jul 2008 12:07:46 +0800</pubDate>
        <link>http://java-code.javaeye.com/blog/212688</link>
        <guid>http://java-code.javaeye.com/blog/212688</guid>
      </item>
      <item>
        <title>cxf2.0.4 发布WEBSERVICE时候出现的问题</title>
        <author>java_code</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://java-code.javaeye.com">java_code</a>&nbsp;
          链接：<a href="http://java-code.javaeye.com/blog/173861" style="color:red;">http://java-code.javaeye.com/blog/173861</a>&nbsp;
          发表时间: 2008年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          cxf2.0.4 + spring2.0.8 + tomcat 5.5 开发环境<br />服务程序代码就省略了,下面是配置.<br />启动TOMCAT后服务正常启动JSP 也可以正常运行.<br />调用http://localhost:8080/EMSTest/DictionaryType的地址时候服务器找不到SERVER<br />,大家看看是什么原因造成的,是TOMCAT版本有问题吗?<br /><br /><pre name="code" class="java">警告: Can't find the the request for http://localhost:8080/EMSTest/DictionaryType's Observer </pre><br /><br />web.xml<br /><pre name="code" class="java">&lt;servlet>
		&lt;servlet-name>CXFServlet&lt;/servlet-name>
		&lt;display-name>CXF Servlet&lt;/display-name>
		&lt;servlet-class>
			org.apache.cxf.transport.servlet.CXFServlet
		&lt;/servlet-class>
		&lt;load-on-startup>1&lt;/load-on-startup>
&lt;/servlet>



&lt;servlet-mapping>
		&lt;servlet-name>CXFServlet&lt;/servlet-name>
		&lt;url-pattern>/*&lt;/url-pattern>
&lt;/servlet-mapping></pre><br /><br /><br />service.xml<br /><br /><pre name="code" class="java">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" >
&lt;beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
<a href="http://www.springframework.org/schema/beans" target="_blank">http://www.springframework.org/schema/beans</a> http://www.springframework.org/schema/beans/spring-beans.xsd
<a href="http://cxf.apache.org/jaxws" target="_blank">http://cxf.apache.org/jaxws</a> http://cxf.apache.org/schemas/jaxws.xsd">

	&lt;import resource="classpath:META-INF/cxf/cxf.xml" />
	&lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	&lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	
	&lt;bean id="dictionary" class="com.gdcn.bpaf.service.impl.DictionaryTypeServiceImpl" />
  	&lt;jaxws:endpoint id="dictionaryType" implementor="#dictionary" address="/DictionaryType" />

	&lt;bean id="catalog" class="com.gdcn.bpaf.service.impl.SysCatalogServiceImpl" />
  	&lt;jaxws:endpoint id="sysCatalog" implementor="#catalog" address="/SysCatalog" /> 
	
	&lt;bean id="serialNo" class="com.gdcn.bpaf.service.impl.SysSerialNoServiceImpl" />
  	&lt;jaxws:endpoint id="sysSerialNo" implementor="#serialNo" address="/SysSerialNo" />

&lt;/beans></pre><br /><br /><br />client.xml<br /><pre name="code" class="java">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;!--
	Licensed to the Apache Software Foundation (ASF) under one
	or more contributor license agreements. See the NOTICE file
	distributed with this work for additional information
	regarding copyright ownership. The ASF licenses this file
	to you under the Apache License, Version 2.0 (the
	"License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at
	
	http://www.apache.org/licenses/LICENSE-2.0
	
	Unless required by applicable law or agreed to in writing,
	software distributed under the License is distributed on an
	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
	KIND, either express or implied. See the License for the
	specific language governing permissions and limitations
	under the License.
-->
&lt;!-- START SNIPPET: beans -->
&lt;beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
<a href="http://www.springframework.org/schema/beans" target="_blank">http://www.springframework.org/schema/beans</a> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
<a href="http://cxf.apache.org/jaxws" target="_blank">http://cxf.apache.org/jaxws</a> http://cxf.apache.org/schema/jaxws.xsd">

    &lt;bean id="client" class="com.gdcn.bpaf.service.IDictionaryTypeService" 
      factory-bean="clientFactory" factory-method="create"/>
    
	&lt;bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
	  &lt;property name="serviceClass" value="com.gdcn.bpaf.service.IDictionaryTypeService"/>
	  &lt;property name="address" value="http://localhost:8080/EMSTest/DictionaryType"/>
	&lt;/bean>
	  
&lt;/beans>
&lt;!-- END SNIPPET: beans --></pre><br /><br /><br /><br />客户端调用代码,SWT的桌面客户端调用<br /><pre name="code" class="java">public class testUI {

	protected Shell shell;

	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			testUI window = new testUI();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window
	 * @throws Exception 
	 */
	public void open() throws Exception {
		final Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}

	/**
	 * Create contents of the window
	 * @throws Exception 
	 */
	protected void createContents() throws Exception {
		shell = new Shell();
		shell.setSize(500, 375);
		shell.setText("SWT Application");

		final Label label = new Label(shell, SWT.NONE);
		label.setText(testServiceMethod());
		label.setBounds(132, 98, 213, 73);
		//
	}
	
	 public  String testServiceMethod() throws Exception {
	        // START SNIPPET: client
	        ClassPathXmlApplicationContext context 
	            = new ClassPathXmlApplicationContext(new String[] {"com/ems/test/client-beans.xml"});

	        com.gdcn.bpaf.service.IDictionaryTypeService client = (IDictionaryTypeService)context.getBean("client");

	        com.gdcn.bpaf.model.BPAFDictionaryType response = client.getDictionaryTypeByCode("test");
	        System.out.println("Response: " + response.getDictionary_name());
	        return response.getDictionary_name();
	        // END SNIPPET: client
	    }</pre>}
          <br/>
          <span style="color:red;">
            <a href="http://java-code.javaeye.com/blog/173861#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 19 Mar 2008 18:26:31 +0800</pubDate>
        <link>http://java-code.javaeye.com/blog/173861</link>
        <guid>http://java-code.javaeye.com/blog/173861</guid>
      </item>
      <item>
        <title>SPRING中关于事务代理的疑问</title>
        <author>java_code</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://java-code.javaeye.com">java_code</a>&nbsp;
          链接：<a href="http://java-code.javaeye.com/blog/153730" style="color:red;">http://java-code.javaeye.com/blog/153730</a>&nbsp;
          发表时间: 2008年01月07日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          问题描述:<br />  我的BEAN是通过了事务代理,代理方式为SPRING AOP形式的代理.<br />当SPRING容器 注入我需要的对象时,只能以接口的形式注入.而我的需求是要获取这个对象的真实实现类这个对象.如果去除代理的配置,则可以获取我需要的真实的实现类对象,但是脱离了事务,也不是我需要的.<br /><br />具体配置和代码:<br /><br /><pre name="code" class="java">
&lt;bean id="txProxyTemplate" abstract="true"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        &lt;property name="transactionManager">
            &lt;ref bean="transactionManager"/>
        &lt;/property>
        &lt;property name="transactionAttributes">
            &lt;props>
            	&lt;prop key="add*">PROPAGATION_REQUIRED&lt;/prop>
            	&lt;prop key="mod*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="save*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="create*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="del*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="update*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="logicSave*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="logicCreate*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="logicDel*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="logicUpdate*">PROPAGATION_REQUIRED&lt;/prop>
                &lt;prop key="*">PROPAGATION_REQUIRED,readOnly&lt;/prop>
            &lt;/props>
        &lt;/property>
    &lt;/bean>

&lt;!-- 新版本 标准和规范基础数据处理 -->	
	&lt;bean id="standardLibDAO" class="com.gdcn.dpm.ywgl.dao.impl.StandardLibDAOImpl" parent="baseDAO" />
	&lt;bean id="service_StandardLib" parent="txProxyTemplate">
		&lt;property name="target">
			&lt;bean class="com.gdcn.dpm.ywgl.service.impl.StandardLibServiceImpl">
				&lt;property name="standardLibDAO" ref="standardLibDAO" />
				&lt;property name="dao_CustomBaseHibernate" ref="standardLibDAO" />
			&lt;/bean>
		
	&lt;/bean>

注入的SET代码:
IStandardLibService  service_StandardLib;
public void setService_StandardLib(IStandardLibService service_StandardLib) {
		this.service_StandardLib = service_StandardLib;
		
	}
//上面的代码能成功注入

StandardLibServiceImpl  service_StandardLib;
public void setService_StandardLib(StandardLibServiceImpl service_StandardLib) {
		this.service_StandardLib = service_StandardLib;
		
	}
//上面的代码注入失败,报Failed to convert property value of type [$Proxy29] to required type [com.gdcn.dpm.ywgl.service.impl.StandardLibServiceImpl] for property 'service_StandardLib' 异常提示

</pre><br />请朋友们给点意见或建议.苦恼我一天了.
          <br/>
          <span style="color:red;">
            <a href="http://java-code.javaeye.com/blog/153730#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 07 Jan 2008 17:59:02 +0800</pubDate>
        <link>http://java-code.javaeye.com/blog/153730</link>
        <guid>http://java-code.javaeye.com/blog/153730</guid>
      </item>
      <item>
        <title>struts 如何获取 file 类型数据</title>
        <author>java_code</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://java-code.javaeye.com">java_code</a>&nbsp;
          链接：<a href="http://java-code.javaeye.com/blog/150171" style="color:red;">http://java-code.javaeye.com/blog/150171</a>&nbsp;
          发表时间: 2007年12月22日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <strong>看了STRUTS源代码<br />怎么也没看到 ActionForm 里面的<br />MultipartRequestHandler multipartRequestHandler<br />如何获取到到request的数据的代码</strong><br /><br />以下为RequestUtils拷贝属性方法,忘大侠们指点一二:<br /><br /> public static void populate(Object bean, String prefix, String suffix,<br />        HttpServletRequest request)<br />        throws ServletException {<br />        // Build a list of relevant request parameters from this request<br />        HashMap properties = new HashMap();<br /><br />        // Iterator of parameter names<br />        Enumeration names = null;<br /><br />        // Map for multipart parameters<br />        Map multipartParameters = null;<br /><br />        String contentType = request.getContentType();<br />        String method = request.getMethod();<br />        boolean isMultipart = false;<br /><br />        if (bean instanceof ActionForm) {<br />            ((ActionForm) bean).setMultipartRequestHandler(null);<br />        }<br /><br />        MultipartRequestHandler multipartHandler = null;<br />        if ((contentType != null)<br />            && (contentType.startsWith("multipart/form-data"))<br />            && (method.equalsIgnoreCase("POST"))) {<br />            // Get the ActionServletWrapper from the form bean<br />            ActionServletWrapper servlet;<br /><br />            if (bean instanceof ActionForm) {<br />                servlet = ((ActionForm) bean).getServletWrapper();<br />            } else {<br />                throw new ServletException("bean that's supposed to be "<br />                    + "populated from a multipart request is not of type "<br />                    + "\"org.apache.struts.action.ActionForm\", but type "<br />                    + "\"" + bean.getClass().getName() + "\"");<br />            }<br /><br />            // Obtain a MultipartRequestHandler<br />            multipartHandler = getMultipartHandler(request);<br /><br />            if (multipartHandler != null) {<br />                isMultipart = true;<br /><br />                // Set servlet and mapping info<br />                servlet.setServletFor(multipartHandler);<br />                multipartHandler.setMapping((ActionMapping) request<br />                    .getAttribute(Globals.MAPPING_KEY));<br /><br />                // Initialize multipart request class handler<br />                multipartHandler.handleRequest(request);<br /><br />                //stop here if the maximum length has been exceeded<br />                Boolean maxLengthExceeded =<br />                    (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);<br /><br />                if ((maxLengthExceeded != null)<br />                    && (maxLengthExceeded.booleanValue())) {<br />                    ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);<br />                    return;<br />                }<br /><br />                //retrieve form values and put into properties<br />                multipartParameters =<br />                    getAllParametersForMultipartRequest(request,<br />                        multipartHandler);<br />                names = Collections.enumeration(multipartParameters.keySet());<br />            }<br />        }<br /><br />        if (!isMultipart) {<br />            names = request.getParameterNames();<br />        }<br /><br />        while (names.hasMoreElements()) {<br />            String name = (String) names.nextElement();<br />            String stripped = name;<br /><br />            if (prefix != null) {<br />                if (!stripped.startsWith(prefix)) {<br />                    continue;<br />                }<br /><br />                stripped = stripped.substring(prefix.length());<br />            }<br /><br />            if (suffix != null) {<br />                if (!stripped.endsWith(suffix)) {<br />                    continue;<br />                }<br /><br />                stripped =<br />                    stripped.substring(0, stripped.length() - suffix.length());<br />            }<br /><br />            Object parameterValue = null;<br /><br />            if (isMultipart) {<br />                parameterValue = multipartParameters.get(name);<br />            } else {<br />                parameterValue = request.getParameterValues(name);<br />            }<br /><br />            // Populate parameters, except "standard" struts attributes<br />            // such as 'org.apache.struts.action.CANCEL'<br />            if (!(stripped.startsWith("org.apache.struts."))) {<br />                properties.put(stripped, parameterValue);<br />            }<br />        }<br /><br />        // Set the corresponding properties of our bean<br />        try {<br />            BeanUtils.populate(bean, properties);<br />        } catch (Exception e) {<br />            throw new ServletException("BeanUtils.populate", e);<br />        } finally {<br />            if (multipartHandler != null) {<br />                // Set the multipart request handler for our ActionForm.<br />                // If the bean isn't an ActionForm, an exception would have been<br />                // thrown earlier, so it's safe to assume that our bean is<br />                // in fact an ActionForm.<br />                ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);<br />            }<br />        }<br />    }
          <br/>
          <span style="color:red;">
            <a href="http://java-code.javaeye.com/blog/150171#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 22 Dec 2007 18:37:46 +0800</pubDate>
        <link>http://java-code.javaeye.com/blog/150171</link>
        <guid>http://java-code.javaeye.com/blog/150171</guid>
      </item>
      <item>
        <title>关于struts2.0模板标签</title>
        <author>java_code</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://java-code.javaeye.com">java_code</a>&nbsp;
          链接：<a href="http://java-code.javaeye.com/blog/79826" style="color:red;">http://java-code.javaeye.com/blog/79826</a>&nbsp;
          发表时间: 2007年05月14日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          我想知道 struts1.1的tiles模板的标签 struts2.0是怎么处理的 .
          <br/>
          <span style="color:red;">
            <a href="http://java-code.javaeye.com/blog/79826#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 14 May 2007 14:50:26 +0800</pubDate>
        <link>http://java-code.javaeye.com/blog/79826</link>
        <guid>http://java-code.javaeye.com/blog/79826</guid>
      </item>
  </channel>
</rss>