Re: client perfomance question

2007-07-02 Thread Evgeny Shepelyuk
Hi Jerome!

Ok so if i understood correctly. I can use Client instance inside my 
applications (not restlet meaning of application, but just external app that 
contacts my RESTful service) as singleton ?
I can create on instance of clietn, set my settings to it and share it to all 
my JSP/classes that needs to contact my RESTFul service.




Restlet and Velocity template location.

2007-07-02 Thread Stuart Owen
Hi,
I'm trying to use the TemplateRepresentation for the Velocity extension as part
of a webapp, but I am having problems configuring the template location. The API
docs for TemplateRepresentation species that only the template name is required
and the full path is resolved by the configuration.
I've tried setting webapp.resource.loader.path=/templates/ within my
WEB-INF/velocity.properties, which works for the VelocityViewServlet, but
doesn't appear to be picked up by Restlet.

So any advice on how I configure restlet to use my velocity.properties within a
webapp?

thanks,
Stuart


Re: client perfomance question

2007-07-02 Thread Jerome Louvel

Hi Evgeny,

Yes, you can use a Client instance as a singleton as you describe. There 
is no need for a full Restlet application for that.


Cheers,
Jerome


Evgeny Shepelyuk a écrit :

Hi Jerome!

Ok so if i understood correctly. I can use Client instance inside my 
applications (not restlet meaning of application, but just external app that 
contacts my RESTful service) as singleton ?
I can create on instance of clietn, set my settings to it and share it to all 
my JSP/classes that needs to contact my RESTFul service.


Re: Second 1.1 beta 1 snapshot

2007-07-02 Thread Sean Landis

  - Added JAXB 2.0 and StAX 1.0 libraries.

Hi Jerome,
Is there a reason that JAXB 2.1.3 wasn't used?

Thanks,
Sean


Re: form submission fails to redirect on success

2007-07-02 Thread Avi Flax

Jerome:

That seems like a great solution. I took a look at Response.java and I
really like that you also added a setLocationRef() method, but kept
setRedirectRef() and getRedirectRef(), both for backwards
compatibility and because sometimes those methods really do make
sense. Very nice!

Thanks,
Avi

On 6/30/07, Jerome Louvel [EMAIL PROTECTED] wrote:


Hi all,

There is indeed some ambiguity in the redirectRef property name as it
indeed is used for resource creations as well (indicated in the Javadocs).

In order to clarify this, I've added a locationRef property and deprecated
redirectRef in SVN trunk. I hope this sounds good to everyone, let me know
otherwise.

Best regards,
Jerome


Re: Restlet and Velocity template location.

2007-07-02 Thread Avi Flax

Stuart, I myself had some issues with this recently, when developing
my first Restlet app. However, my app is standalone, i.e. it doesn't
use the Servlet adapter to run inside a Servlet Server, it uses one of
the included extensions to embed an HTTP server. I think that may make
a big difference in how to reference templates, so I'm not sure my
experience/setup would be helpful for you. If you'd like, though, I'd
be happy to share. Hopefully someone will have some advice for your
specific situation.

--
Avi Flax
Lead Technologist
arc90 | http://arc90.com

On 7/2/07, Stuart Owen [EMAIL PROTECTED] wrote:

Hi,
I'm trying to use the TemplateRepresentation for the Velocity extension as part
of a webapp, but I am having problems configuring the template location. The API
docs for TemplateRepresentation species that only the template name is required
and the full path is resolved by the configuration.
I've tried setting webapp.resource.loader.path=/templates/ within my
WEB-INF/velocity.properties, which works for the VelocityViewServlet, but
doesn't appear to be picked up by Restlet.

So any advice on how I configure restlet to use my velocity.properties within a
webapp?

thanks,
Stuart



RE: Second 1.1 beta 1 snapshot

2007-07-02 Thread Jerome Louvel

Hi Sean,

The reason was that upon JavaSE 6.0 support (with includes JAXB 2.0) in
Restlet 2.0, I wanted to be automatically compatible. 

But, now that I think about it again, we could also maintain a JAXB 2.1
extension along with a org.restlet.resource.JaxbRepresentation class added
to Restlet 2.0.

Best regards,
Jerome  

 -Message d'origine-
 De : news [mailto:[EMAIL PROTECTED] De la part de Sean Landis
 Envoyé : lundi 2 juillet 2007 17:36
 À : discuss@restlet.tigris.org
 Objet : Re: Second 1.1 beta 1 snapshot
 
 
   - Added JAXB 2.0 and StAX 1.0 libraries.
 
 Hi Jerome,
 Is there a reason that JAXB 2.1.3 wasn't used?
 
 Thanks,
 Sean


Re: access local file in tomcat container

2007-07-02 Thread Thierry Boileau

Hello Julien,

if you want to access files that are located inside your WebContent 
directory, you can use the integrated war client just as follow:
   Representation rep = 
getContext().getDispatcher().get(war:///files/file.xml).getEntity();

and then use the representation as you want.
NB: you can reuse parameters used for routing. For example, if your 
restlet has been reached according to the template 
/segment/{myParameter}:
   Representation rep = 
getContext().getDispatcher().get(war:///files/file{myParameter}.xml).getEntity();



What is the relationship between a restlet and a servlet ? none ?

The relation between a servlet and a restlet is made with the 
ServerServlet extension [1], and more precisely with the ServerServlet 
class which transmits servlet calls to your restlets, and the 
ServletContextAdapter that instantiates the war client and transmits all 
servlet context parameters to the restlet context parameters.


Is there a way to get to javax.servlet.ServletContext from an 
org.restlet.Application ?



Here is the way to get the servletContext:
ServletContextAdapter adapter = (ServletContextAdapter) getContext();
ServletContext servletContext = adapter.getServletContext();

Please feel free to ask for more details.

Best regards,
Thierry Boileau
[1] 
http://www.restlet.org/documentation/1.0/ext/com/noelios/restlet/ext/servlet/package-summary.html