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:

entry key=/users/{id}/resource2?{query} 

Try without declaring query like this:

entry key=/users/{id}/resource2 

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 GET parameters you are talking about here? My Server Resource is
 being instantiated by the SpringRouter settings defined in the xml file.
 
 I'm already fetching the query params as described below.
 
 String view = getQuery().getFirstValue(view);
 
 But the real problem is 404 is being thrown before the server resource is
 instantiated. Routers are not able to identify the incoming request
 http://xyz:8080/resource2?view=filtered and hence throwing 404.
 
 Nitin
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2765509
 


--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/How-to-allow-Query-Strings-in-REST-URI-Spring-Restlet-tp6474960p6478585.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


RE: Re: can not return description in put

2011-06-15 Thread Bram van der Waaij
Nop, unfortunately both options produce the same result. 
The clientresource.getStatus().getDescription() call on a Get returns my 
message from the setStatus at the server

The clientresource.getStatus().getDescription() call on a Put returns the 
description of the status error code (400 - Bad request) instead of my message.

Any further ideas how to fix this?

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


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 putResource(){
}

etc.

So I really don't know if overriding put methods work.

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/can-not-return-description-in-put-tp6474740p6479427.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


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

2011-06-15 Thread Nitin Arora
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

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


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

 --

 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2766308


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://restlet-discuss.1400322.n2.nabble.com/How-to-allow-Query-Strings-in-REST-URI-Spring-Restlet-tp6474960p6480085.html
  To unsubscribe from How to allow Query Strings in REST URI - Spring 
 Restlet, click 
 herehttp://restlet-discuss.1400322.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=6474960code=Z29uemFAaXN0b2NrbWFuYWdlci5jb218NjQ3NDk2MHwtMzc3OTU5MzY0.




--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/How-to-allow-Query-Strings-in-REST-URI-Spring-Restlet-tp6474960p6480246.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Re: how to use conditional get in restlet ?

2011-06-15 Thread Matt Kennedy
I'm moving this to the disc...@restlet.itgris.org, the code list is more for 
the restlet codebase itself. 

Anyhow, the answer to your question is two-fold:

First, Conditional Get means something very specific in HTTP parlance and it 
isn't what you describe.  A conditional get is a GET request that sends a 
special header that tells the server to not bother to send a response if the 
resource that is being requested hasn't been modified since the last time the 
client made the request.  So it isn't really for what you're talking about.

So, to do what you'd like to do, just use a query parameter.  For example:

http://www.example.com/people?age=over20

-Matt


On Jun 15, 2011, at 4:08 PM, infoSyS wrote:

 I am currently designing an API using the restlet framework; Can anyone
 please give me a clue on how to use conditional GET requests in RESTlet ?
 what I mean is : lets say I have the name and date of birth of many persons
 and I want to GET the name of persons that are older than 20 years, how
 could this be done ? Thanks in advance.
 
 --
 View this message in context: 
 http://restlet-code.1609877.n2.nabble.com/how-to-use-conditional-get-in-restlet-tp6480367p6480367.html
 Sent from the Restlet Code mailing list archive at Nabble.com.
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458dsMessageId=2766359

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