Re: The server has not found anything matching the request URI

2011-06-17 Thread gonzajg
how are you defining the routes of your classes?? could you tell the URL of your request? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/The-server-has-not-found-anything-matching-the-request-URI-tp6488146p6488515.html Sent from the Restlet Discuss mailing list arc

Re: The server has not found anything matching the request URI

2011-06-17 Thread gonzajg
I had the same problem when upgrading. I don't know if you are using any integration with spring but my problem was when setting the property for the finder. Here's an example in Restlet 1.1.x:

Re: Instance variables in ServerResource

2011-06-17 Thread gonzajg
Chris, You can safely use instance variables. A new instance is created by request. You should be careful with class (static) variables only. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Instance-variables-in-ServerResource-tp6484113p6487099.html Sent from the Re

Re: Re: How to allow Query Strings in REST URI - Spring & Restlet

2011-06-15 Thread gonzajg
I'm glad it worked for you :) On Wed, Jun 15, 2011 at 3:38 PM, aronitin [via Restlet Discuss] < ml-node+6480085-1989291684-197...@n2.nabble.com> wrote: > Hi, > > I tried it and it worked. I did not think about that :-(, I was too much > into the code. > > Thanks for the tip > > ~Nitin > > ---

RE: Re: can not return description in put

2011-06-15 Thread gonzajg
Maybe restlet is using the other put method @Override protected Representation put(Representation representation, Variant variant) throws ResourceException try overriding that one. I use anotations in resources like: @Get public Representation getResource(){ } @Put public void putResour

RE: Re: How to allow Query Strings in REST URI - Spring & Restlet

2011-06-15 Thread gonzajg
In your route I see that you included this: Try without declaring query like this: I think there's no need to declare "{query}" to get the query from the URL. aronitin wrote: > > Hi, > > I did not really get your point "You can include your routes without GET > parameters" > > What GE

Re: can not return description in put

2011-06-14 Thread gonzajg
Hi Bram, try: getResponse().setStatus(status); or Response.getCurrent().setStatus(status); hope it helps! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/can-not-return-description-in-put-tp6474740p6475166.html Sent from the Restlet Discuss mailing list archive

Re: How to allow Query Strings in REST URI - Spring & Restlet

2011-06-14 Thread gonzajg
Hi! You can include your routes without GET parameters. And then in your resource class simply use: Request.getCurrent().getResourceRef().getQueryAsForm(); You'll get a form with your GET parameters. Hope it helps! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/H

Re: Making server close persistent connections after a period

2011-06-14 Thread gonzajg
Hi Philip, I guess it depends on the server implementation you are using. If you didn't include any extension on your classpath you should be using restlet's default implementation. Could you provide your sources of the server instance? My case, I use maven with jetty plugin so I can configure co

RE: Batch calls?

2011-06-14 Thread gonzajg
Hi Jerome! Sorry for my vague question. I was meaning something like http://developers.facebook.com/docs/api/batch/ facebook API batch requests. I now that it is not REST standard. It consists of sending in the body and array of JSON (or any other rep) with method, relative and body (if method

Re: Router URI match fails

2011-06-14 Thread gonzajg
Hi Soumik, I think you are missing "/" on some of the routes. Try this: router.attach("/system", SystemResource.class); router.attach("/system/scaling", SystemScalingResource.class); router.attach("/system/instance/{server}", ServerInstanceResource.c

Batch calls?

2011-06-14 Thread gonzajg
Is there any plan to include batch calls on future restlet releases? Or how can I implement it over restlet? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Batch-calls-tp6474034p6474034.html Sent from the Restlet Discuss mailing list archive at Nabble.com.

Re: Changing content type

2011-02-17 Thread gonzajg
Tim thanks again! You helped me before with your solution to modify the objectmapper so now I did as you said and found out that by changing: private static final VariantInfo VARIANT_JSON = new VariantInfo( MediaType.APPLICATION_JSON); a new variant: private static final VariantInfo VA

Changing content type

2011-02-17 Thread gonzajg
Hi! I'm using Restlet 2.0.4 with JacksonConverterService The problem is that this configuration only accepts request with "Content-type application/json" Is there a way to ignore the content-type a parse anyway the body as application/json? I tried changing in the doinit and constructor serverRes

Re: Setting identifier with converter Service

2011-02-17 Thread gonzajg
Thanks again Thierry! Though I realized that I needed to return a representation in order for that to work so I just return an empty representation in post methods with the identifier set. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Setting-identifier-with-conve

RE: Re: catching parse exception using converter service

2011-02-15 Thread gonzajg
Thanks Thierry! I solved it by not throwing an exception for now when the parser fails. But I think it could be nice to be able to catch that exception in the statusService. Keep up the great work! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/catching-parse-except

Setting identifier with converter Service

2011-02-15 Thread gonzajg
Hi! I need to set the response header Content-Location when I create a new resource so the response contains the location of it. In Restlet 1.1 I used the representation.setIdentifier method but now in Restlet 2.0 I use a ConverterService so I have no access to the representation. What should I do

Re: catching parse exception using converter service

2011-02-14 Thread gonzajg
I'm getting also as a response of the request a 415 http code UnsupportedMediaType which is not true since the Type is correct -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/catching-parse-exception-using-converter-service-tp6024668p6024796.html Sent from the Restle

catching parse exception using converter service

2011-02-14 Thread gonzajg
Hi! I'm using Restlet 2.0.4 with a converterService (Jackson). Problem is when I receive a Json object with a parse exception, it is not caught in the StatusService (which already works with any other exception that occurs within the resource) Example: WARNING: Unable to parse the object with Jack

Re: Configure ConverterService

2011-02-10 Thread gonzajg
and version constants here > } > > And I apply it like this in my overridden createObjectMapper: > > protected ObjectMapper createObjectMapper() { > ObjectMapper mapper = super.createObjectMapper(); > mapper.registerModule(new RestletJsonMapping()); > return mapper; > } > >

Configure ConverterService

2011-02-10 Thread gonzajg
Hi! I would like to configure JacksonConverterService to ignore null values when serializing. In their manual I should: objectMapper.configure(SerializationConfig.WRITE_NULL_PROPERTIES, false); I'm using Restlet 2.0.4 with automatic org.restlet.ext.jackson.JacksonConverter Problem is when I ret

RE: Setting routes in Resources

2010-12-01 Thread gonzajg
Thanks Thierry! It's a good idea but I have different roles which need auth in different routes. I'll use the XML SpringRouter configuration because there's no way to do what I want with annotations (and it's ok). Great job with Restlet 2.0! -- View this message in context: http://restlet-discu

Re: Setting routes in Resources

2010-12-01 Thread gonzajg
any ideas? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Setting-routes-in-Resources-tp5775336p5792992.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewM

Setting routes in Resources

2010-11-25 Thread gonzajg
I have successfully configured a spring, hibernate, restlet 2.0 server so that my resources can have the route in the component value. I'm using org.restlet.ext.spring.SpringServerServlet Example: @Component("/sample") @Scope(value = BeanDefinition.SCOPE_PROTOTYPE) public class SampleResource exte

RE: Set response in guard

2010-05-20 Thread gonzajg
Thanks Thierry! I've overridden the doHandle method and now it works great. Looking forward for Restlet 2.0 and your book! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Set-response-in-guard-tp4952267p5079381.html Sent from the Restlet Discuss mailing list archi

RE: Cookie authentication

2010-05-20 Thread gonzajg
Hi Jerome, Thanks for your suggestion. I had been looking at Restlet 2.0 and saw the cookieAuthenticator but needed a stable version for production. Now I'm just using a guard with HTTP_BASIC auth and checking the cookies myself (overridden doHandle method) without challenge. I'm looking forward

Cookie authentication

2010-04-26 Thread gonzajg
Hi, i have a problem setting the challengescheme in the guard. I've created a guard that decides authentication based on the cookie sent. But when i use the following line: MyGuard mGuard = new MyGuard (getContext(),ChallengeScheme.CUSTOM, "Tradefields API Login"); In runtime i get: Challenge sc

Re: Restlet and DAO

2010-04-26 Thread gonzajg
Hi Nico, How about injecting your DAO on a BaseResource class and extending this in every resource? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Restlet-and-DAO-tp4962381p4962395.html Sent from the Restlet Discuss mailing list archive at Nabble.com.

Set response in guard

2010-04-23 Thread gonzajg
Hi, is there a way of setting the cookie for the response in the guard? I have only access to the request. Thanks! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Set-response-in-guard-tp4952267p4952267.html Sent from the Restlet Discuss mailing list archive at Nabb

RE: Message from guard?

2010-04-23 Thread gonzajg
But in the checkSecret method of the guard i only have the request. How do I set the response within the guard? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Message-from-guard-tp4950612p4951266.html Sent from the Restlet Discuss mailing list archive at Nabble.co

Message from guard?

2010-04-23 Thread gonzajg
Hi, is there a way of notifying the resource that a session has expired to renew the cookie in the response? My logic is the following: request arrives and is managed by guard if (request has a cookie){ cookie will contain 2 sessions (one from a social network (socialSession) and other from my

Re: HTTPS and HTTP?

2010-04-22 Thread gonzajg
Thanks Tal! I solved it your way i think. But without load balancer. I added HTTP server on port 80 and HTTPS on port 81 and the login resource checks the protocol like this: if(request.getProtocol() != Protocol.HTTPS) Hope that's right and make my app secure. Thank you again! -- View this messa

HTTPS and HTTP?

2010-04-22 Thread gonzajg
Hi, i'd like to know if there's a way to have on the same application running HTTPS resources and HTTP. My idea is to have a login resource via HTTPS where a session is returned if user/password are ok and then check the session in other HTTP resources (so the overload of HTTPS is saved) Thanks!

Re: XML dom nodes

2009-10-28 Thread gonzajg
Thanks for your idea John! I finally used this code and navigate through the document but don't know if it's the most efficient way: ByteArrayOutputStream buff = new ByteArrayOutputStream(); response.getEntity().write(buff); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); Do

XML dom nodes

2009-10-27 Thread gonzajg
hi, i have a restlet server which returns domrepresentations as answers when i get a resource and try to go through its nodes as the restlet example with xpath i get the following exception: java.lang.IllegalArgumentException: InputStream cannot be null at javax.xml.parsers.DocumentBuilder.

Re: No entity in empty PUT

2009-10-23 Thread gonzajg
ull if that decision doesn't not impact other methods. Ex: If you accept POST it will modify your Entity. I only used it because I accept DELETE and PUT only in that resource. Hope it helps. I listen for better solutions though... gonzajg wrote: > > I've read that Restlet returns an

No entity in empty PUT

2009-10-23 Thread gonzajg
I've read that Restlet returns an error if a no-content PUT is sent and that maybe they will change this behaviour. I favor this a my reason is the following: If i want to upload a resource to a collection like PUT users/1/friends/4 There's no need for a content on this PUT. It's absurd to have a

Re: Get secrets in resources

2009-10-21 Thread gonzajg
thanks Laurent! it worked! Laurent Rustuel wrote: > > Hello, > gonzajg a écrit : > > Is there a way to get the challengeresponse in resources? > You should be able to get them in a ServerResource using > ServerResource#getChallengeResponse() > Then you could do

Re: Guard access

2009-10-19 Thread gonzajg
ntials, asking for > 'em only once per "realm", and sending the proper Authorization header > preemptively on subsequent requests. This is normal behaviour. > > Hope this helps you further understand what's going on... > > On Mon, Oct 19, 2009 at 1:26 PM, gonzajg w

Guard access

2009-10-19 Thread gonzajg
Hi, I need to secure some resources and separate the methods. Example: users/1/wall GET for everyone POST only for user 1 users/1/privatemessages GET only for user 1 i've been reading for a while documentation and found out that you can override the dohandle method of the guard for each guard