<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elton&#039;s Blog &#187; Java</title>
	<atom:link href="http://blog.prosight.me/index.php/category/agile-web-development/java/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.prosight.me</link>
	<description>移动开发，敏捷web开发，Linux服务器部署维护，web UI和UE设计，摄影</description>
	<lastBuildDate>Wed, 08 Feb 2012 00:22:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>通过JNI实现Java对C/C++的调用</title>
		<link>http://blog.prosight.me/index.php/2011/07/769?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e9%2580%259a%25e8%25bf%2587jni%25e5%25ae%259e%25e7%258e%25b0java%25e5%25af%25b9cc%25e7%259a%2584%25e8%25b0%2583%25e7%2594%25a8</link>
		<comments>http://blog.prosight.me/index.php/2011/07/769#comments</comments>
		<pubDate>Fri, 29 Jul 2011 08:20:17 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[jni]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=769</guid>
		<description><![CDATA[JNI是Java Native Interface的缩写，中文为JAVA本地调用。从Java1.1开始，Java Native Interface(JNI)标准成为java平台的一部分，它允许Java代码和其他语言写的代码进行交互。JNI一开始是为了本地已编译语言，尤其是C和C++而设计的，但是它并不妨碍你使用其他语言，只要调用约定受支持就可以了。 大致步骤 编写带有native声明的方法的java类 使用javac命令编译所编写的java类 使用javah命令生成扩展名为h的头文件 使用C/C++实现本地方法 将C/C++编写的文件生成动态连接库 1) 编写java程序： 1 2 3 4 5 6 7 8 9 10 11 12 public class HelloNative&#123; public native void greeting&#40;&#41;;//所有native所修饰的都是本地方法 &#160; static&#123; System.loadLibrary&#40;&#34;HelloNative&#34;&#41;;//载入本地库 &#125; &#160; public static void main&#40;String&#91;&#93; args&#41;&#123; new HelloNative&#40;&#41;.greeting&#40;&#41;; // System.out.println(System.getProperty(&#34;java.library.path&#34;)); &#125; &#125; 声明native方法：如果你想将一个方法做为一个本地方法的话，那么你就必须声明该方法为native的，并且不能实现。其中方法的参数和返回值在后面讲述。 Load动态库：System.loadLibrary(“HelloNative”);加载动态库（我们可以这样理解：我们的方法 greeting()没有实现，但是我们在下面就直接使用了，所以必须在使用之前对它进行初始化）这里一般是以static块进行加载的。同时需要注意的是System.loadLibrary();的参数“HelloNative”是动态库的名字。 2) 编译 1 javac [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2011/07/769/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SpringMVC+Freemarker UTF-8编码 完全解决方案</title>
		<link>http://blog.prosight.me/index.php/2011/06/711?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=springmvcfreemarker-utf-8%25e7%25bc%2596%25e7%25a0%2581-%25e5%25ae%258c%25e5%2585%25a8%25e8%25a7%25a3%25e5%2586%25b3%25e6%2596%25b9%25e6%25a1%2588</link>
		<comments>http://blog.prosight.me/index.php/2011/06/711#comments</comments>
		<pubDate>Fri, 17 Jun 2011 13:21:40 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[freemarker]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=711</guid>
		<description><![CDATA[最近用SpringMVC+Freemarker+AJAX作了个例子.遇到了一些关于中文编码的问题.通过查资料把问题解决了. 在这里总结一下. 先解决Freemarker的中文问题. 在Spring的配置文件里要添加一些配置项. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 &#60;bean id=&#34;freemarderConfig&#34; class=&#34;org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer&#34;&#62; &#60;property name=&#34;templateLoaderPath&#34; value=&#34;/ftl/&#34;/&#62; &#60;property name=&#34;freemarkerVariables&#34;&#62; &#60;map&#62; &#60;entry key=&#34;xml_escape&#34; value-ref=&#34;fmXmlEscape&#34;/&#62; &#60;/map&#62; &#60;/property&#62; &#60;property name=&#34;freemarkerSettings&#34;&#62; &#60;props&#62; &#60;prop key=&#34;defaultEncoding&#34;&#62;UTF-8&#60;/prop&#62; &#60;/props&#62; &#60;/property&#62; &#60;/bean&#62; &#60;bean id=&#34;fmXmlEscape&#34; class=&#34;freemarker.template.utility.XmlEscape&#34;/&#62; [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2011/06/711/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring MVC 3.0.5+Spring 3.0.5+MyBatis3.0.4全注解实例详解（一）</title>
		<link>http://blog.prosight.me/index.php/2011/05/700?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring-mvc-3-0-5spring-3-0-5mybatis3-0-4%25e5%2585%25a8%25e6%25b3%25a8%25e8%25a7%25a3%25e5%25ae%259e%25e4%25be%258b%25e8%25af%25a6%25e8%25a7%25a3%25ef%25bc%2588%25e4%25b8%2580%25ef%25bc%2589</link>
		<comments>http://blog.prosight.me/index.php/2011/05/700#comments</comments>
		<pubDate>Tue, 24 May 2011 02:09:16 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[mybatis]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=700</guid>
		<description><![CDATA[Spring更新到3.0之后，其MVC框架加入了一个非常不错的东西——那就是REST。它的开放式特性，与Spring的无缝集成，以及Spring框架的优秀表现，使得现在很多公司将其作为新的系统开发框架。大象根据实际的项目经验，以之前SSH2例子为基础，对其进行一次大改造，详细的为大家讲解如何实现SSM3全注解式的开发。 这次大象将采取两种构建方式，一是很多人喜欢用的MyEclipse，另一个，则是用Eclipse+Maven。这一篇，将主要讲解开发环境设置与Maven构建方式。 1、开发环境 JDK1.6.0_18 Eclipse3.2.1 MyEclipse5.1.0 Eclipse-JEE-HELIOS-SR2 Maven3.0.1 m2eclipse0.12.1.20110112-1712 Tomcat6.0.10 maven-jetty-plugin6.1.26 MySQL5.0.27 Navicat Lite for MySQL 8.1.20 每个人的开发环境可能会有差异，但有一点我需要说明的是，JDK的版本不得低于1.5，因为用到了很多1.5版才支持的新特性。Tomcat、Jetty、Maven和MySQL请不要低于我所用的版本，因为我没在其它的版本上进行测试。Navicat则是MySQL数据库的图形化操作工具。接下来我将介绍如何在Eclipse3.6中，使用m2eclipse插件构建web应用及测试开发环境。 2、设置Maven Maven的安装很简单，只需要解压即可，请设置PATH变量，这样可以使用命令行进行操作，然后就要在%MAVEN_HOME%conf目录下，对settings.xml作下修改 这就是设置本地仓库，目录可以根据自己的实际情况更改，不过请使用”/”正斜杠，因为我在实际使用中，发现反斜杠有时候获取不到资源。对于个人使用，设置好这个就OK了，至于Nexus配置不在本文讨论范围内，大家如有兴趣可以去看看juven xu的博客，他是目前公认的Maven专家。 3、安装m2eclipse 选择Help->Install New Software&#8230;在弹出的窗口中，点击Add&#8230;又会弹出一个小窗口，输入m2eclipse的安装地址，如下图所示： 输入完成后，点击OK，这时Eclipse就开始查找这个插件了，请耐心等一会。 插件找到后，请勾选要安装的内容，接下来就是一般的安装流程了，此处省略500字。安装完成请重新启动Eclipse，然后再对这个插件进行一番设置。 4、设置m2eclipse 进入Perferences，选择Maven，去掉Download repository index updates on startup前的勾，默认情况是会在每次启动Eclipse的时候自动去Maven中央仓库下载索引，这无疑是非常不好的，要知道Maven中央仓库所包含的jar资源非常庞大，而且每天都会有很多新的项目上传，弄不好Eclipse还没开始用，就被这些东西搞挂掉了。 接下来选择Installations将这个插件自带的Maven换成之前安装的Maven，这样就保证了版本的一致性。 设置好这个之后，再点击User Settings，用本机maven的settings.xml替换默认的配置文件，因为默认的设置是会将本地仓库放到系统盘符Documents and Settings用户目录.m2repository这个目录下面。 大家可以看到，用maven中的配置文件替换后，下面的Local Repository自动变更为settings.xml中的设置。 5、创建maven工程 做完这些，我们就可以开始创建Maven工程了。选择New->other&#8230;->Maven->Maven Project，然后选择下一步 请设置工作空间路径，大象的默认工作空间放在eclipse的根目录下面，这里的Location显示的应该为空，为了进行说明，特将路径显示出来。确定没问题后，Next> 这个列表显示的就是maven支持的所有项目创建类型，我们是开发web应用，所以请选择maven-archetype-webapp 最后一步输入我们要创建的项目，在Maven世界中，使用坐标来唯一标识一个构件，可以理解为项目，资源等等。Group Id表示当前项目所属的实际项目，Artifact Id定义实际项目中的一个Maven项目，根据名字就可以看出来，Group Id是一个大范围，而Artifact Id是一个小范围。比如大家都很熟悉的spring，就分成了spring-core.jar、spring-beans.jar、spring-context.jar等等。在maven里面，它的Group Id就是org.springframework，而Artifact Id则为spring-core、spring-beans、spring-context。怎么样？理解了没有？ 到此，项目生成了，请展开src/main，在main目录下新建一个java文件夹，打开ssm3的项目属性，选择Java [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2011/05/700/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>通过URL Rewrite来设置JBoss的301跳转</title>
		<link>http://blog.prosight.me/index.php/2010/07/622?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e9%2580%259a%25e8%25bf%2587url-rewrite%25e6%259d%25a5%25e8%25ae%25be%25e7%25bd%25aejboss%25e7%259a%2584301%25e8%25b7%25b3%25e8%25bd%25ac</link>
		<comments>http://blog.prosight.me/index.php/2010/07/622#comments</comments>
		<pubDate>Wed, 28 Jul 2010 07:54:57 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=622</guid>
		<description><![CDATA[Introduction The rewrite valve implements URL rewrite functionnality in a way that is very similar to mod_rewrite from Apache HTTP Server. Configuration The rewrite valve is configured as a regular valve, by adding the following to server.xml as child of an Engine or Host element (or inside a context.xml file): 1 &#60;Valve className=&#34;org.jboss.web.rewrite.RewriteValve&#34; /&#62; The [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2010/07/622/feed</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Tomcat 设计模式分析</title>
		<link>http://blog.prosight.me/index.php/2010/05/605?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tomcat-%25e8%25ae%25be%25e8%25ae%25a1%25e6%25a8%25a1%25e5%25bc%258f%25e5%2588%2586%25e6%259e%2590</link>
		<comments>http://blog.prosight.me/index.php/2010/05/605#comments</comments>
		<pubDate>Fri, 28 May 2010 22:46:56 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[设计模式]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=605</guid>
		<description><![CDATA[门面设计模式 门面设计模式在 Tomcat 中有多处使用，在 Request 和 Response 对象封装中、Standard Wrapper 到 ServletConfig 封装中、ApplicationContext 到 ServletContext 封装中等都用到了这种设计模式。 门面设计模式的原理 这么多场合都用到了这种设计模式，那这种设计模式究竟能有什么作用呢？顾名思义，就是将一个东西封装成一个门面好与人家更容易进行交流，就像一个国家的外交部一样。 这种设计模式主要用在一个大的系统中有多个子系统组成时，这多个子系统肯定要涉及到相互通信，但是每个子系统又不能将自己的内部数据过多的暴露给其它系统，不然就没有必要划分子系统了。每个子系统都会设计一个门面，把别的系统感兴趣的数据封装起来，通过这个门面来进行访问。这就是门面设计模式存在的意义。 门面设计模式示意图如下： 图 1. 门面示意图 Client 只能访问到 Façade 中提供的数据是门面设计模式的关键，至于 Client 如何访问 Façade 和 Subsystem 如何提供 Façade 门面设计模式并没有规定死。 Tomcat 的门面设计模式示例 Tomcat 中门面设计模式使用的很多，因为 Tomcat 中有很多不同组件，每个组件要相互交互数据，用门面模式隔离数据是个很好的方法。 下面是 Request 上使用的门面设计模式： 图 2. Request 的门面设计模式类图 从图中可以看出 HttpRequestFacade 类封装了 HttpRequest 接口能够提供数据，通过 HttpRequestFacade 访问到的数据都被代理到 HttpRequest [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2010/05/605/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用MyFace快速构建基于JSF的应用</title>
		<link>http://blog.prosight.me/index.php/2010/02/570?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e4%25bd%25bf%25e7%2594%25a8myface%25e5%25bf%25ab%25e9%2580%259f%25e6%259e%2584%25e5%25bb%25ba%25e5%259f%25ba%25e4%25ba%258ejsf%25e7%259a%2584%25e5%25ba%2594%25e7%2594%25a8</link>
		<comments>http://blog.prosight.me/index.php/2010/02/570#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:20:03 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[mvn]]></category>
		<category><![CDATA[MyFace]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=570</guid>
		<description><![CDATA[如果大家使用Apache MyFace的JSF实现来搭建JSF应用，可以利用Apache提供的便捷maven方法来快速搭建一个初始的应用。 1 2 3 4 5 6 7 8 9 10 mvn archetype:generate -DarchetypeCatalog=http://myfaces.apache.org …… Choose archetype: 1: http://myfaces.apache.org -&#62; myfaces-archetype-helloworld &#40;Simple Web application using Apache Myfaces&#41; 2: http://myfaces.apache.org -&#62; myfaces-archetype-helloworld-facelets &#40;Simple Web application using Apache Myfaces and Facelets&#41; 3: http://myfaces.apache.org -&#62; myfaces-archetype-helloworld-portlets &#40;Simple Web application using Apache Myfaces and Portlets&#41; 4: http://myfaces.apache.org -&#62; [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2010/02/570/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl.</title>
		<link>http://blog.prosight.me/index.php/2010/01/560?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=it-appears-the-jsp-version-of-the-container-is-older-than-2-1-and-unable-to-locate-the-el-ri-expression-factory-com-sun-el-expressionfactoryimpl</link>
		<comments>http://blog.prosight.me/index.php/2010/01/560#comments</comments>
		<pubDate>Sat, 16 Jan 2010 14:14:52 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[el-ri.jar]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=560</guid>
		<description><![CDATA[今天调试一个jboss应用的时候发现这个错误。 严重: Unable to instantiate ExpressionFactory &#8216;com.sun.el.ExpressionFactoryImpl&#8217; 2008-9-12 11:36:47 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. If not using JSP or the EL RI, make [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2010/01/560/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>在JBOSS服务器上使用Myfaces的JSF实现</title>
		<link>http://blog.prosight.me/index.php/2010/01/558?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8jboss%25e6%259c%258d%25e5%258a%25a1%25e5%2599%25a8%25e4%25b8%258a%25e4%25bd%25bf%25e7%2594%25a8myfaces%25e7%259a%2584jsf%25e5%25ae%259e%25e7%258e%25b0</link>
		<comments>http://blog.prosight.me/index.php/2010/01/558#comments</comments>
		<pubDate>Sat, 16 Jan 2010 13:58:55 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[myfaces]]></category>

		<guid isPermaLink="false">http://blog.prosight.me/?p=558</guid>
		<description><![CDATA[JBOSS AS服务器默认使用的JSF实现是SUN的RI，要把他替换成Myfaces需要： 1.移除JBoss服务器的现有的JSF实现RI 修改JBOSS_HOME下的server< config-name>deployjboss-web.deployerconfweb.xml文件，把JSF的监听器注掉，并删除jboss-web.deployer 目录下的jsf-libs文件夹 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 &#60;!-- &#60;context-param&#62; &#60;param-name&#62;com.sun.faces.injectionProvider&#60;/param-name&#62; &#60;param-value&#62;org.jboss.web.jsf.integration.injection.JBossInjectionProvider&#60;/param-value&#62; &#60;/context-param&#62; --&#62; &#60;!-- Comment/Remove this --&#62; &#60;!-- Configures JSF for a web application if the javax.faces.webapp.FacesServlet is declared --&#62; &#60;!-- in web.xml. [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2010/01/558/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tomcat 启动gzip压缩输出页面大小及其他优化</title>
		<link>http://blog.prosight.me/index.php/2009/06/91?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tomcat-%25e5%2590%25af%25e5%258a%25a8gzip%25e5%258e%258b%25e7%25bc%25a9%25e8%25be%2593%25e5%2587%25ba%25e9%25a1%25b5%25e9%259d%25a2%25e5%25a4%25a7%25e5%25b0%258f%25e5%258f%258a%25e5%2585%25b6%25e4%25bb%2596%25e4%25bc%2598%25e5%258c%2596</link>
		<comments>http://blog.prosight.me/index.php/2009/06/91#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:07:23 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.prosight.me/blog/?p=91</guid>
		<description><![CDATA[在输出的页头中加入 1 Content-Encoding: gzip 可以有效的减少页面的大小，一般可以减小1/3左右。 对于tomcat来说修改起来也很见到， 在tomcat下的conf/server.xml文件中，修改 1 2 3 4 5 6 &#60;connector port=&#34;8080&#34; maxHttpHeaderSize=&#34;8192&#34; useBodyEncodingForURI=&#34;true&#34; maxThreads=&#34;1000&#34; minSpareThreads=&#34;25&#34; maxSpareThreads=&#34;75&#34; enableLookups=&#34;false&#34; redirectPort=&#34;8443&#34; acceptCount=&#34;100&#34; compression=&#34;on&#34; compressionMinSize=&#34;2048&#34; compressableMimeType=&#34;text/html,text/xml,text/javascript,text/css,text/plain&#34; connectionTimeout=&#34;20000&#34; disableUploadTimeout=&#34;true&#34; URIEncoding=&#34;UTF-8&#34;/&#62; 就可以对html,xml,css,javascript和纯文本进行压缩。 其中 maxHttpHeaderSize：Http的Header的最大限制 maxThreads：Tomcat可创建的最大的线程数 minSpareThreads：初始化创建的线程数 maxSpareThreads：一旦创建的线程超过这个数，Tomcat就将关闭不再需要的Socket线程 enableLookups：使用允许DNS查询，通常情况下设置为false acceptCount：当所有可以使用的处理请求的线程树都被使用时，可以放到请求队列中的请求数，超过这个数的请求将不予处理。其实，该属性与ServerSocket(int port,int backlog)中的backlog参数意义相同，具体可参考ServerSocket的JDK API connectionTimeout：网络连接超时，单位毫秒。设置为0表示永不超时]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2009/06/91/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EJB3入门（4）实体Bean</title>
		<link>http://blog.prosight.me/index.php/2009/06/65?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ejb3%25e5%2585%25a5%25e9%2597%25a8%25ef%25bc%25884%25ef%25bc%2589%25e5%25ae%259e%25e4%25bd%2593bean</link>
		<comments>http://blog.prosight.me/index.php/2009/06/65#comments</comments>
		<pubDate>Wed, 17 Jun 2009 00:07:33 +0000</pubDate>
		<dc:creator>Elton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ejb3]]></category>

		<guid isPermaLink="false">http://www.prosight.me/blog/?p=65</guid>
		<description><![CDATA[实体Bean就是跟数据库中某个表对应的一个类。 类的每个实例对应数据库的一行记录。如果用过hibernate的人一定很熟悉这个概念。这个就是所谓的ORM模型。Jboss就是使用的Hibernate来实现的。 假设数据库中有这样一个表 我们来写一个EJB应用，来把用户的密码得到。 先对Jboss做相关配置，便于读取数据库。 设置数据源 拷贝jboss安装目录下docs/jca中的mysql-ds.xml到default/deploy目录中，对其中的参数进行修改 1 2 3 4 5 6 7 8 9 10 11 12 13 14 &#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62; &#60;datasources&#62; &#60;local-tx-datasource&#62; &#60;jndi-name&#62;ejb&#60;/jndi-name&#62; &#60;connection-url&#62;jdbc:mysql://localhost:3306/ejb&#60;/connection-url&#62; &#60;driver-class&#62;com.mysql.jdbc.Driver&#60;/driver-class&#62; &#60;user-name&#62;root&#60;/user-name&#62; &#60;password&#62;&#60;/password&#62; &#60;exception-sorter-class-name&#62;org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter&#60;/exception-sorter-class-name&#62; &#60;metadata&#62; &#60;type-mapping&#62;mySQL&#60;/type-mapping&#62; &#60;/metadata&#62; &#60;/local-tx-datasource&#62; &#60;/datasources&#62; 再将mysql的驱动拷贝到default/lib中 在源代码目录下的META-INF中建立配置文件persistence.xml，以便ejb项目可以使用jboss的数据源 1 2 3 4 5 6 7 8 9 10 11 12 13 14 &#60;?xml version=&#34;1.0&#34; [...]]]></description>
		<wfw:commentRss>http://blog.prosight.me/index.php/2009/06/65/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

