Hmm, ok, why couldn't you just call:

http://localhost:8000/open/?id=273648267834

having id's in the path makes no sense to me... what is the argument that 
REST provides for this? And can you give an example of a practical example 
when you need to put an id in the path and where an id in the query 
wouldn't suffice?

Cheers,

/marc

On Fri, 6 Jun 2008, Erik Martino wrote:

> The reason I reported it as a bug, was because the access to Chain and
> Chain get(String path) method was restricted so that extensions like this
> wasn't possible. For me it is important that Rupy is compact, if the access
> is restricted it is necessary for features to enter the core and rupy will
> grow in size. It is better IMHO to make it extendible instead and extra
> features optional.
> 
> /erik
> 
> On Fri, Jun 6, 2008 at 1:51 PM, Erik Martino <[EMAIL PROTECTED]> wrote:
> 
> > I wanted to support REST like urls fx
> > http://localhost:8000/open/273648267834
> >
> > public class OpenService extends Service {
> >     private static final String OPEN_PREFIX = "/open/";
> >     private static final String OPEN_PATH = OPEN_PREFIX + "*";
> >
> >     @Override
> >     public void filter(Event event) throws Event, Exception {
> >         String path = event.query().path();
> >         final String id = path.substring(OPEN_PREFIX.length());
> >         // do something with id
> >     }
> >
> >     @Override
> >     public String path() {
> >         return OPEN_PATH;
> >     }
> > }
> >
> > If I have a service with path /open/*
> >
> > and my request is
> >
> > http://localhost:8000/open/with/extra/path/information
> >
> > i should  check for all of these services
> >
> > /open/with/extra/path/information
> > /open/with/extra/path/*
> > /open/with/extra/*
> > /open/with/*
> > /open/*
> >
> > which matches OpenService and let it handle the request. The wildCardPath
> > was a quick and dirty attempt at achieving that. If you want me to I could
> > try and make a better and more effecient implementation (and a test).
> >
> > /erik
> >
> > public class CaosHttpDaemon extends Daemon {
> >
> >     public CaosHttpDaemon(Properties properties) {
> >         super(properties);
> >     }
> >
> >     public Chain get(String path) {
> >         Chain chain = null;
> >         while (path != null && chain == null) {
> >             chain = super.get(path);
> >             path = wildCardPath(path);
> >         }
> >         return chain;
> >     }
> >
> >     private String wildCardPath(String path) {
> >         if (path.endsWith("/*")) path = path.substring(0,path.length()-2);
> >
> >         int lastSlash = path.lastIndexOf('/');
> >         if (lastSlash < 0)
> >             return null;
> >         int nextToLastSlash = path.lastIndexOf('/', lastSlash);
> >         if (nextToLastSlash < 0)
> >             return null;
> >         String string = path.substring(0, nextToLastSlash) + "/*";
> >         System.out.println(string);
> >         return string;
> >
> >     }
> > }
> >
> >
> >
> > On Fri, Jun 6, 2008 at 1:34 PM, Marc Larue <[EMAIL PROTECTED]> wrote:
> >
> >> Hi Erik,
> >>
> >> I can't get my head around the Wildcard Paths code you sent. Could you
> >> explain in plain english what it is you are trying to achieve. Preferrably
> >> with a useful example! :)
> >>
> >> Cheers,
> >>
> >> /marc
> >>
> >
> >
> >
> > --
> > /erik martino
> 
> 
> 
> 
> -- 
> /erik martino
> 

Reply via email to