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] > 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=2760545

