I use Eclipse and OSGi manifests, so the Restlet bundles are open in my IDE
and declared as dependencies of my GWT project -- I need org.restlet and
org.restlet.ext.servlet.  But however you get the jars onto the classpath
will be fine -- I'll document a few other choices when I write this up
officially.  Then in the war directory of my GWT project, I place a
WEB-INF/lib/web.xml with contents like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>

<servlet>
<servlet-name>adapter</servlet-name>
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
<init-param> <!--  In my case I have a dummy value here, as my component
takes care of application attachment ... but see the ServerServlet docs-->
  <param-name>org.restlet.application</param-name>
  <param-value>org.restlet.Application [or your actual
Application]</param-value>
</init-param>
<init-param>
  <param-name>org.restlet.component</param-name>
  <param-value>[my component here]</param-value>
</init-param>
</servlet>
 <servlet-mapping>
<servlet-name>adapter</servlet-name>
<url-pattern>/r/*</url-pattern>
</servlet-mapping>

</web-app>


On Fri, Jan 1, 2010 at 12:16 PM, Bryan Hunt <bh...@mac.com> wrote:

> Rob,
>
> How are you registering the ServerServlet with the embedded Jetty that GWT
> is launching?
>
> Bryan
>
> On Jan 1, 2010, at 9:18 AM, Rob Heittman wrote:
>
> We should write some now that GWT 2.0 is not a moving target any more.
>  When working with Jetty and Dev Mode under 2.0 trunk, I have always just
> used the ServerServlet to attach Restlet to a path.  I do not believe it is
> really possible any more to attach Restlet to the root of the container (/),
> at least not without surgery to GWT's DefaultServlet, which in turn is a
> modified version of Jetty's that understands how to handle GWT modules ...
> and I hope we don't have to attack that.
>
> All I do in practice, in my GWT 2.0 client applications, is make sure the
> root of any RESTful resources is configurable, and set it differently in Dev
> Mode than in production.  Then I usually attach Restlet (usually a
> redirector to my "real" Restlet server side running somewhere else) to /r
> under GWT using ServerServlet, same as any other JEE container.
>
> If that practice sounds sane to everybody else, I'll write it up.
>
> On Fri, Jan 1, 2010 at 9:56 AM, Bryan Hunt <bh...@mac.com> wrote:
>
>> I'm starting to look at using Restlet 2.0 with GWT 2.0.  The docs for
>> setting up a project:
>>
>>
>> http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/186-restlet.html
>>
>> talk about setting up the old GWT Hosted Mode.  The new Dev Mode seems to
>> be using Jetty instead of Tomcat, and there doesn't seem to be any web.xml
>> files for configuring the shell servlet.  Are there any new docs on how to
>> set up a project using Restlet 2.0 with GWT 2.0 Dev Mode?
>>
>> Bryan
>>
>> ------------------------------------------------------
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434081
>>
>
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434095

Reply via email to