restlet学习心得——Component



 几天看了ajax的关于restlet的文章,受益匪浅,这里首先要表示感谢!

       在看用Component进行对application管理的时候,老是发现一个500的错误,上面显示大概是无法获得connecter对象的原因。百思不得其解,最后发现原来是我的restlet包的版本不对,改为1.1.9后马上好了。

下面顺便把配置默认Component的方法贴出来:

<context-param>
		<param-name>org.restlet.application</param-name>
		<param-value>firstResource.FirstResourceApplication</param-value>
	</context-param>

 这段代码要从web.xml中去掉,也就是不配置application,交给component去配置。

然后在web-inf文件夹下建一个restlet.xml的文件加入:

<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.restlet.org/schemas/1.1/Component"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.restlet.org/schemas/1.1/Component">
	<defaultHost>
		<attach uriPattern="/customers/" targetClass="application.CustomerApplication" />
		<attach uriPattern="/orders/" targetClass="application.OrderApplication" />
		<!--
			<attach uriPattern="/efgh/{xyz}"
			targetDescriptor="clap://class/org/restlet/test/MyApplication.wadl"/>
		-->
	</defaultHost>
</component>

    更多详细的说明可以参见ajax的文章,其中还有比较详细的解说

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值