<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>不就是個blog</title>
	<atom:link href="http://forth.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://forth.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 20 Mar 2008 09:05:52 +0000</lastBuildDate>
	<language>zh-tw</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='forth.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>不就是個blog</title>
		<link>http://forth.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://forth.wordpress.com/osd.xml" title="不就是個blog" />
	<atom:link rel='hub' href='http://forth.wordpress.com/?pushpress=hub'/>
		<item>
		<title>用Hibernate建立Membership</title>
		<link>http://forth.wordpress.com/2008/03/20/%e7%94%a8hibernate%e5%bb%ba%e7%ab%8bmembership/</link>
		<comments>http://forth.wordpress.com/2008/03/20/%e7%94%a8hibernate%e5%bb%ba%e7%ab%8bmembership/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 09:04:19 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2008/03/20/%e7%94%a8hibernate%e5%bb%ba%e7%ab%8bmembership/</guid>
		<description><![CDATA[@Entity @Table(name="memberships") @IdClass(MembershipPK.class) public class Membership { private Integer groupId; private Integer userId; @Id @Column(name="group_id") public Integer getGroupId() { return groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } @Id @Column(name="user_id") public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } } @Embeddable public class MembershipPK { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=126&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>
@Entity
@Table(name="memberships")
@IdClass(MembershipPK.class)
public class Membership {
	private Integer groupId;

	private Integer userId;

	@Id
	@Column(name="group_id")
	public Integer getGroupId() {
		return groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

	@Id
	@Column(name="user_id")
	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
}
</pre>
<pre>
@Embeddable
public class MembershipPK {
	private Integer groupId;

	private Integer userId;

	public Integer getGroupId() {
		return groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/126/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/126/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=126&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/03/20/%e7%94%a8hibernate%e5%bb%ba%e7%ab%8bmembership/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>隱形眼鏡</title>
		<link>http://forth.wordpress.com/2008/03/17/%e9%9a%b1%e5%bd%a2%e7%9c%bc%e9%8f%a1/</link>
		<comments>http://forth.wordpress.com/2008/03/17/%e9%9a%b1%e5%bd%a2%e7%9c%bc%e9%8f%a1/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 09:44:36 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/?p=125</guid>
		<description><![CDATA[戴了數年的眼鏡，鏡片鍍膜已經磨損、龜裂，所以下午就跑去換鏡片。等待的時候，順便問了一些隱形眼鏡的問題，本來想買日拋式，可是雙眼度數不同，要買就得買雙份，還在考慮的時候，老闆就說送我一副625度的季拋式試試看。所以，花了600元，不但換好鏡片，還得到隱形眼鏡、保養液、食鹽水。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=125&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>戴了數年的眼鏡，鏡片鍍膜已經磨損、龜裂，所以下午就跑去換鏡片。等待的時候，順便問了一些隱形眼鏡的問題，本來想買日拋式，可是雙眼度數不同，要買就得買雙份，還在考慮的時候，老闆就說送我一副625度的季拋式試試看。所以，花了600元，不但換好鏡片，還得到隱形眼鏡、保養液、食鹽水。</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/125/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/125/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=125&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/03/17/%e9%9a%b1%e5%bd%a2%e7%9c%bc%e9%8f%a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>Wicket和Spring</title>
		<link>http://forth.wordpress.com/2008/02/21/wicket_and_spring_config/</link>
		<comments>http://forth.wordpress.com/2008/02/21/wicket_and_spring_config/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 06:12:24 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2008/02/21/wicket_and_spring_config/</guid>
		<description><![CDATA[在Wicket程式用Spring，要在web.xml加入設定： &#60;context -param&#62; &#60;param -name&#62;contextConfigLocation&#60;/param&#62; &#60;param -value&#62;/WEB-INF/spring*.xml&#60;/param&#62; &#60;/context&#62; &#60;listener&#62; &#60;/listener&#62;&#60;listener -class&#62;org.springframework.web.context.ContextLoaderListener&#60;/listener&#62; 在WebApplication中要建立SpringComponentInjector： public class BasicApplication extends WebApplication { @Override protected void init() { super.init(); addComponentInstantiationListener(new SpringComponentInjector(this)); } } 如果還想把bean注入WebSession，要用InjectorHolder: public class BasicSession extends WebSession { public BasicSession(Request request) { super(request); InjectorHolder.getInjector().inject(this); } } 設定好之後，只要在需要注入bean的地方用@SpringBean即可，範例如下： public class SignUpPage extends BasePage { @SpringBean private UserService userService; public [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=124&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>在Wicket程式用Spring，要在web.xml加入設定：</p>
<pre class="brush: xml;">
&lt;context -param&gt;
	&lt;param -name&gt;contextConfigLocation&lt;/param&gt;
	&lt;param -value&gt;/WEB-INF/spring*.xml&lt;/param&gt;
&lt;/context&gt;

&lt;listener&gt;
	&lt;/listener&gt;&lt;listener -class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener&gt;
</pre>
<p>在WebApplication中要建立SpringComponentInjector：</p>
<pre class="brush: java;">
public class BasicApplication extends WebApplication {
	@Override
	protected void init() {
		super.init();
		addComponentInstantiationListener(new SpringComponentInjector(this));
	}
}
</pre>
<p>如果還想把bean注入WebSession，要用InjectorHolder:</p>
<pre class="brush: java;">
public class BasicSession extends WebSession {
	public BasicSession(Request request) {
		super(request);
		InjectorHolder.getInjector().inject(this);
	}
}
</pre>
<p>設定好之後，只要在需要注入bean的地方用@SpringBean即可，範例如下：</p>
<pre class="brush: java;">
public class SignUpPage extends BasePage {
	@SpringBean
	private UserService userService;

	public SignUpPage() {
		add(new SignUpForm(&quot;signUpForm&quot;));
	}

	class SignUpForm extends Form {
		private String name;

		private String email;

		private String password;

		@SuppressWarnings(&quot;unused&quot;)
		private String confirmPassword;

		public SignUpForm(String id) {
			super(id);
			PasswordTextField passwordField, confirmPasswordField;
			add(new TextField(&quot;name&quot;,  new PropertyModel(this, &quot;name&quot;)).setRequired(true).add(new StringValidator.LengthBetweenValidator(2, 32)));
			add(new TextField(&quot;email&quot;, new PropertyModel(this, &quot;email&quot;)).setRequired(true).add(EmailAddressValidator.getInstance()));
			add(passwordField        = new PasswordTextField(&quot;password&quot;,        new PropertyModel(this, &quot;password&quot;)));
			add(confirmPasswordField = new PasswordTextField(&quot;confirmPassword&quot;, new PropertyModel(this, &quot;confirmPassword&quot;)));
			add(new EqualPasswordInputValidator(passwordField, confirmPasswordField));
		}

		@Override
		protected void onSubmit() {
			User user = new User(name, email, password, User.ROLE_USER);
			try {
				userService.createUser(user);
				setResponsePage(HomePage.class);
			} catch (DuplicatedUserNameException e) {
				error(getLocalizer().getString(getId() + &quot;.nameTaken&quot;, getWebPage(), &quot;User's name is taken: &quot; + name));
			} catch (DuplicatedUserEmailException e) {
				error(getLocalizer().getString(getId() + &quot;.emailTaken&quot;, getWebPage(), &quot;User's email is taken: &quot; + email));
			}
		}
	}
}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/124/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/124/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=124&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/21/wicket_and_spring_config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>程式和內嵌Jetty共用spring context</title>
		<link>http://forth.wordpress.com/2008/02/11/%e7%a8%8b%e5%bc%8f%e5%92%8c%e5%85%a7%e5%b5%8cjetty%e5%85%b1%e7%94%a8spring-context/</link>
		<comments>http://forth.wordpress.com/2008/02/11/%e7%a8%8b%e5%bc%8f%e5%92%8c%e5%85%a7%e5%b5%8cjetty%e5%85%b1%e7%94%a8spring-context/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 05:16:03 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/?p=122</guid>
		<description><![CDATA[應用程式內嵌Jetty運行webapp時，希望程式和webapp共用同一個spring context，在web.xml設定context loader listener時，要改用自定的MyContextLoaderListener。 JettyServer.java: import org.mortbay.jetty.Server; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.webapp.WebAppContext; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; public class JettyServer implements ApplicationContextAware { private ApplicationContext applicationContext; public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; } public void start() throws Exception { int port = Integer.parseInt(System.getProperty(&#34;jetty.port&#34;, &#34;8080&#34;)); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(port); Server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=122&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>應用程式內嵌Jetty運行webapp時，希望程式和webapp共用同一個spring context，在web.xml設定context loader listener時，要改用自定的MyContextLoaderListener。</p>
<p>JettyServer.java:</p>
<pre class="brush: java;">
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class JettyServer implements ApplicationContextAware {
	private ApplicationContext applicationContext;

	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
 		this.applicationContext = applicationContext;
	}

	public void start() throws Exception {
	 	int port = Integer.parseInt(System.getProperty(&quot;jetty.port&quot;, &quot;8080&quot;));

		SelectChannelConnector connector = new SelectChannelConnector();
 		connector.setPort(port);

		Server server = new Server();
	 	server.addConnector(connector);

		WebAppContext context = new WebAppContext();
 		context.setClassLoader(applicationContext.getClassLoader());
	 	context.setAttribute(&quot;applicationContext&quot;, applicationContext);
 		context.setServer(server);
	 	context.setContextPath(&quot;/&quot;);
 		context.setWar(&quot;src/main/webapp&quot;);

		server.addHandler(context);
 		server.start();
	}
}</pre>
<p>MyContextLoader.java:</p>
<pre class="brush: java;">
import javax.servlet.ServletContext;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoader;

public class MyContextLoader extends ContextLoader {
	@Override
	protected ApplicationContext loadParentContext(ServletContext servletContext) throws BeansException {
 		return (ApplicationContext)servletContext.getAttribute(&quot;applicationContext&quot;);
	}
}</pre>
<p>MyContextLoaderListener.java:</p>
<pre class="brush: java;">
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.ContextLoaderListener;

public class MyContextLoaderListener extends ContextLoaderListener {
	@Override
	protected ContextLoader createContextLoader() {
 		return new MyContextLoader();
	}
}</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/122/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/122/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=122&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/11/%e7%a8%8b%e5%bc%8f%e5%92%8c%e5%85%a7%e5%b5%8cjetty%e5%85%b1%e7%94%a8spring-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>Maven設定Terracotta</title>
		<link>http://forth.wordpress.com/2008/02/11/maven%e8%a8%ad%e5%ae%9aterracotta/</link>
		<comments>http://forth.wordpress.com/2008/02/11/maven%e8%a8%ad%e5%ae%9aterracotta/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 03:55:40 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2008/02/11/maven%e8%a8%ad%e5%ae%9aterracotta/</guid>
		<description><![CDATA[Maven repository沒有Terracotta和Terracotta Maven Plugin，所以要在pom.xml加入： &#60;repositories&#62; &#60;repository&#62; &#60;releases&#62; &#60;enabled&#62;true&#60;/enabled&#62; &#60;/releases&#62; &#60;snapshots&#62; &#60;enabled&#62;false&#60;/enabled&#62; &#60;/snapshots&#62; &#60;id&#62;terracotta-repository&#60;/id&#62; &#60;url&#62; http://www.terracotta.org/download/reflector/maven2 &#60;/url&#62; &#60;/repository&#62; &#60;/repositories&#62; &#60;pluginrepositories&#62; &#60;pluginrepository&#62; &#60;id&#62;terracotta-snapshots&#60;/id&#62; &#60;url&#62; http://www.terracotta.org/download/reflector/maven2 &#60;/url&#62; &#60;releases&#62; &#60;enabled&#62;true&#60;/enabled&#62; &#60;/releases&#62; &#60;snapshots&#62; &#60;enabled&#62;true&#60;/enabled&#62; &#60;/snapshots&#62; &#60;/pluginrepository&#62; &#60;/pluginrepositories&#62; &#60;build&#62; &#60;plugins&#62; &#60;plugin&#62; &#60;groupid&#62;org.terracotta.maven.plugins&#60;/groupid&#62; &#60;artifactid&#62;tc-maven-plugin&#60;/artifactid&#62; &#60;version&#62;1.0.3&#60;/version&#62; &#60;configuration&#62; &#60;!-- used by tc:bootjar --&#62; &#60;!-- &#60;verbose&#62;true --&#62; &#60;!-- &#60;overwriteBootjar&#62;true --&#62; &#60;!-- &#60;bootJar&#62;target/bootjar.jar --&#62; &#60;!-- used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=121&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Maven repository沒有<a href="http://www.terracotta.org/">Terracotta</a>和<span><a href="http://forge.terracotta.org/projects/tc-maven-plugin/">Terracotta Maven Plugin</a>，所以要</span>在pom.xml加入：</p>
<pre class="brush: xml;">
	&lt;repositories&gt;
		&lt;repository&gt;
			&lt;releases&gt;
				&lt;enabled&gt;true&lt;/enabled&gt;
			&lt;/releases&gt;
			&lt;snapshots&gt;
				&lt;enabled&gt;false&lt;/enabled&gt;
			&lt;/snapshots&gt;
			&lt;id&gt;terracotta-repository&lt;/id&gt;
			&lt;url&gt;

http://www.terracotta.org/download/reflector/maven2

			&lt;/url&gt;
		&lt;/repository&gt;
	&lt;/repositories&gt;

	&lt;pluginrepositories&gt;
		&lt;pluginrepository&gt;
			&lt;id&gt;terracotta-snapshots&lt;/id&gt;
			&lt;url&gt;

http://www.terracotta.org/download/reflector/maven2

			&lt;/url&gt;
			&lt;releases&gt;
				&lt;enabled&gt;true&lt;/enabled&gt;
			&lt;/releases&gt;
			&lt;snapshots&gt;
				&lt;enabled&gt;true&lt;/enabled&gt;
			&lt;/snapshots&gt;
		&lt;/pluginrepository&gt;
	&lt;/pluginrepositories&gt;

	&lt;build&gt;
		&lt;plugins&gt;
			&lt;plugin&gt;
				&lt;groupid&gt;org.terracotta.maven.plugins&lt;/groupid&gt;
				&lt;artifactid&gt;tc-maven-plugin&lt;/artifactid&gt;
				&lt;version&gt;1.0.3&lt;/version&gt;

				&lt;configuration&gt;
					&lt;!-- used by tc:bootjar --&gt;
					&lt;!-- &lt;verbose&gt;true --&gt;
					&lt;!-- &lt;overwriteBootjar&gt;true --&gt;
					&lt;!-- &lt;bootJar&gt;target/bootjar.jar --&gt;

					&lt;!-- used by tc:start and tc:stop so DSO server could outlive mvn process --&gt;
					&lt;!-- &lt;startServer&gt;true --&gt;
					&lt;!-- &lt;spawnServer&gt;true --&gt;
					&lt;!-- &lt;config&gt;${basedir}/tc-config.xml --&gt;
					&lt;!-- &lt;jvm&gt;C:\jdk1.6.0\bin\java.exe --&gt;
					&lt;!-- &lt;jvmargs&gt;-Xmx20m --&gt;
				&lt;/configuration&gt;
			&lt;/plugin&gt;
		&lt;/plugins&gt;
	&lt;/build&gt;

	&lt;dependencies&gt;
		&lt;dependency&gt;
			&lt;groupid&gt;org.terracotta&lt;/groupid&gt;
			&lt;artifactid&gt;terracotta&lt;/artifactid&gt;
			&lt;version&gt;2.5.1&lt;/version&gt;
		&lt;/dependency&gt;
	&lt;/dependencies&gt;</pre>
<p>不過，<a href="http://www.terracotta.org/confluence/display/docs1/Eclipse+Plug-in">Terracotta DSO Eclipse Plug-in</a>比<span><a href="http://forge.terracotta.org/projects/tc-maven-plugin/">Terracotta Maven Plugin</a>好用多了。</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/121/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/121/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=121&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/11/maven%e8%a8%ad%e5%ae%9aterracotta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>blog救援完畢</title>
		<link>http://forth.wordpress.com/2008/02/08/blog%e6%95%91%e6%8f%b4%e5%ae%8c%e7%95%a2/</link>
		<comments>http://forth.wordpress.com/2008/02/08/blog%e6%95%91%e6%8f%b4%e5%ae%8c%e7%95%a2/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 21:42:27 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/?p=119</guid>
		<description><![CDATA[全靠Wayback Machine和Google，花了7個小時剪剪貼貼之後，總共救回117篇文章。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=119&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>全靠<a href="http://www.archive.org/">Wayback Machine</a>和<a href="http://www.google.com/">Google</a>，花了7個小時剪剪貼貼之後，總共救回117篇文章。</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/119/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/119/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=119&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/08/blog%e6%95%91%e6%8f%b4%e5%ae%8c%e7%95%a2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>server被偷</title>
		<link>http://forth.wordpress.com/2008/02/08/server%e8%a2%ab%e5%81%b7/</link>
		<comments>http://forth.wordpress.com/2008/02/08/server%e8%a2%ab%e5%81%b7/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 18:07:06 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/?p=24</guid>
		<description><![CDATA[放在遙遠的樓梯間機房裡的server在除夕夜9:38斷線，10點多趕到時，發現攝影機被破壞，樓梯間鐵門被撬開，機房裡的server和監視器主機都消失了。已經工作七年的server配備Intel Pentium III 700MHz CPU、512MB RAM、160GB HDD，上面運行著bento.tw、cert.tw、ruby.tw、zbwei.net，不但有email、blog、wiki、forum、電子書，最重要的是，還有大家都喜歡的神秘圖片。目前正在靠archive.org和google慢慢整裡公開的blog和wiki內容，其餘的資料就安心上路吧！blog暫時搬到http://forth.wordpress.com/，FeedBurner亦已修改至新位置。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=24&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>放在遙遠的樓梯間機房裡的server在除夕夜9:38斷線，10點多趕到時，發現攝影機被破壞，樓梯間鐵門被撬開，機房裡的server和監視器主機都消失了。已經工作七年的server配備Intel Pentium III 700MHz CPU、512MB RAM、160GB HDD，上面運行著bento.tw、cert.tw、ruby.tw、zbwei.net，不但有email、blog、wiki、forum、電子書，最重要的是，還有大家都喜歡的神秘圖片。目前正在靠archive.org和google慢慢整裡公開的blog和wiki內容，其餘的資料就安心上路吧！blog暫時搬到<a href="http://forth.wordpress.com/">http://forth.wordpress.com/</a>，FeedBurner亦已修改至新位置。</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=24&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/08/server%e8%a2%ab%e5%81%b7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>Apple IIc開箱照</title>
		<link>http://forth.wordpress.com/2008/02/05/apple-iic%e9%96%8b%e7%ae%b1%e7%85%a7/</link>
		<comments>http://forth.wordpress.com/2008/02/05/apple-iic%e9%96%8b%e7%ae%b1%e7%85%a7/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 16:57:45 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2008/02/05/apple-iic%e9%96%8b%e7%ae%b1%e7%85%a7/</guid>
		<description><![CDATA[沒想到在2008年竟然能看見Apple IIc開箱照，能從1988年5月5日完整保存至今，實在太神奇了。eBay才真的是什麼都有、什麼都賣、什麼都不奇怪。<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=76&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>沒想到在<b>2008</b>年竟然能看見<a href="http://flickr.com/photos/dansays/2234503121/in/set-72157603835099525/">Apple IIc開箱照</a>，能從1988年5月5日完整保存至今，實在太神奇了。<a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.ebay.com/">eBay</a>才真的是什麼都有、什麼都賣、什麼都不奇怪。</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=76&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/05/apple-iic%e9%96%8b%e7%ae%b1%e7%85%a7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>Java調用Ruby物件</title>
		<link>http://forth.wordpress.com/2008/02/01/java%e8%aa%bf%e7%94%a8ruby%e7%89%a9%e4%bb%b6/</link>
		<comments>http://forth.wordpress.com/2008/02/01/java%e8%aa%bf%e7%94%a8ruby%e7%89%a9%e4%bb%b6/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 02:18:49 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2008/02/01/java%e8%aa%bf%e7%94%a8ruby%e7%89%a9%e4%bb%b6/</guid>
		<description><![CDATA[RubyHelp.java: public class RubyHelper { static { System.setProperty(&#34;jruby.home&#34;, new File(&#34;&#34;).getAbsolutePath()); } private RubyHelper() { } public static Object create(String className, Class interfaceClazz, String scriptFileName) { InputStream scriptInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFileName); if (null == scriptInputStream) { throw new RuntimeException(&#34;Could not find &#34; + scriptFileName); } StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; try { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=77&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>RubyHelp.java:</p>
<pre class="brush: java;">
public class RubyHelper {
	static {
		System.setProperty(&quot;jruby.home&quot;, new File(&quot;&quot;).getAbsolutePath());
	}

	private RubyHelper() {
	}

	public static Object create(String className, Class interfaceClazz, String scriptFileName) {
		InputStream scriptInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFileName);
		if (null == scriptInputStream) {
			throw new RuntimeException(&quot;Could not find &quot; + scriptFileName);
		}
		StringBuilder sb = new StringBuilder();
		byte[] buf = new byte[8192];
		try {
			for (int n; (n = scriptInputStream.read(buf)) != -1;) {
				sb.append(new String(buf, 0, n, &quot;UTF-8&quot;));
			}
			scriptInputStream.close();
		} catch (IOException e) {
			throw new RuntimeException(&quot;Error loading &quot; + scriptFileName + &quot;: &quot; + e.getMessage());
		}
		Ruby runtime = JavaEmbedUtils.initialize(new ArrayList());
		runtime.eval(runtime.parse(sb.toString(), scriptFileName, runtime.getCurrentContext().getCurrentScope(), 0, false));
		return JavaEmbedUtils.rubyToJava(runtime, runtime.evalScriptlet(className + &quot;.new&quot;), interfaceClazz);
	}
}
</pre>
<p>HelloService.java:</p>
<pre class="brush: java;">
public interface HelloService {
	void hello();
}
</pre>
<p>hello.rb:</p>
<pre class="brush: java;">
class Hello
  def hello
    puts 'hello there'
  end
end
</pre>
<p>Test.java:</p>
<pre class="brush: java;">
public class Test {
	public static void main(String[] args) throws Exception {
		HelloService s = (HelloService)RubyHelper.create(&quot;Hello&quot;, HelloService.class, &quot;hello.rb&quot;);
		s.hello();
	}
}
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/77/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/77/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=77&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2008/02/01/java%e8%aa%bf%e7%94%a8ruby%e7%89%a9%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
		<item>
		<title>常用的ruby程式庫</title>
		<link>http://forth.wordpress.com/2007/12/27/%e5%b8%b8%e7%94%a8%e7%9a%84ruby%e7%a8%8b%e5%bc%8f%e5%ba%ab/</link>
		<comments>http://forth.wordpress.com/2007/12/27/%e5%b8%b8%e7%94%a8%e7%9a%84ruby%e7%a8%8b%e5%bc%8f%e5%ba%ab/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 02:47:11 +0000</pubDate>
		<dc:creator>forth</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://forth.wordpress.com/2007/12/27/%e5%b8%b8%e7%94%a8%e7%9a%84ruby%e7%a8%8b%e5%bc%8f%e5%ba%ab/</guid>
		<description><![CDATA[rails mongrel mongrel_cluster acts_as_cached acts_as_ferret capistrano fcgi gettext sqlite3-ruby mechanize ruby-net-ldap ruby-openid sendfile log4r rspec ZenTest<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=94&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="entry-content">
<ul>
<li>rails</li>
<li>mongrel</li>
<li>mongrel_cluster</li>
<li>acts_as_cached</li>
<li>acts_as_ferret</li>
<li>capistrano</li>
<li>fcgi</li>
<li>gettext</li>
<li>sqlite3-ruby</li>
<li>mechanize</li>
<li>ruby-net-ldap</li>
<li>ruby-openid</li>
<li>sendfile</li>
<li>log4r</li>
<li>rspec</li>
<li>ZenTest</li>
</ul>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/forth.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/forth.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/forth.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/forth.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/forth.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=forth.wordpress.com&amp;blog=25021&amp;post=94&amp;subd=forth&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://forth.wordpress.com/2007/12/27/%e5%b8%b8%e7%94%a8%e7%9a%84ruby%e7%a8%8b%e5%bc%8f%e5%ba%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9b512b8ca4f6c22011345b28deb10bd3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">forth</media:title>
		</media:content>
	</item>
	</channel>
</rss>
