*Tim:
*
1) thanks for sharing!
2) there is an error in my first post; I really meant mode 2:
The "/WEB-INF/web.xml" file contains a parameter named
"org.restlet.component". Its value must be the path of a class that
inherits from |Component|
<http://www.restlet.org/documentation/2.0/$%7Bedition.id%7D/api/org/restlet/Component.html>.
It is used to instantiate and attach the described component,
contained applications and connectors.
3) I have several components running on a different tomcat context
paths in the same tomcat;
4) re: "Without autoWire=true, I'd have to code paths differently
depending on how I was deploying the Component."
this is exactly my point: with autoWire=false and patternUri like
this: getDefaultHost().attach("/{servletId}/mail", new MailApp());
you get extra attribute in the request: {servletId} which is tomcat
context path; so inside your attached app you deal with uri like
this: "/accounts"
this allows me to run "staging" and "release" components in the same
tomcat on different context paths;
5) re: "I also do most testing as a standalone Component, and I
wrote about the details these multiple deployment possibilities here:"
me too! I have a launcher to simulate servlet environment;
Thank you,
Andrei
-------- Original Message --------
Subject: Re: org.restlet.autoWire=false
From: Tim Peierls <[email protected]>
To: [email protected]
Date: Wed 08 Jun 2011 03:45:11 PM CDT
> I use ServerServlet in mode 2 with autoWire=true so I can deploy as a
> regular Tomcat servlet (with additional URI path determined by war
> name) or under Elastic Beanstalk (with no additional path). Mode 2
> makes more sense to me, because I'm dealing with a Component already.
>
> I also do most testing as a standalone Component, and I wrote about
> the details these multiple deployment possibilities here:
>
> http://restlet-discuss.1400322.n2.nabble.com/Different-deployment-schemes-for-the-same-Restlet-based-Application-td6398049.html#a6398696
>
> Without autoWire=true, I'd have to code paths differently depending on
> how I was deploying the Component.
>
> --tim
>
> On Wed, Jun 8, 2011 at 9:03 AM, Andrei Pozolotin
> <[email protected] <mailto:[email protected]>> wrote:
>
> your currect javadoc:
>
> http://www.restlet.org/documentation/2.0/jee/ext/org/restlet/ext/servlet/ServerServlet.html
>
> and your book:
> http://www.manning.com/louvel/
>
> makes an impression that "the correct way" to use component inside
> a servlet (mode 3) is to use org.restlet.autoWire=true (the
> default you force on the unknowing) which forces a prepend of all
> route paths with tomcat servlet context;
>
> that was rather misleading;
>
> it took me some time to understand that a better way would be to
> use org.restlet.autoWire=false and pattern mapping like this:
>
> getDefaultHost().attach(/{servletId}/mail, new MailApp());
>
> that allows to avoid cludges with trying to read
> "org.restlet.ext.servlet.offsetPath" and you now get your tomcat
> offsetPath injected as {servletId} for free :-)
>
> I sugest you clarify this in your book, and possibly change
> default settings to org.restlet.autoWire=false
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2760549