Re: Serve static content using SpringBeanRouter?

2014-06-04 Thread Jerome Louvel
SpringBeanRouter. To not have to use the {imageId} path variable (for your file names I guess), you can set the route's matchingMode to Template.STARTS_WITH. I'm not sure exactly how to do it with SpringBeanRouter, but with a regular router you would do this: myRouter.attach(/v1/images

Re: Serve static content using SpringBeanRouter?

2014-05-30 Thread Jorge Gallardo
SpringBeanRouter. To not have to use the {imageId} path variable (for your file names I guess), you can set the route's matchingMode to Template.STARTS_WITH. I'm not sure exactly how to do it with SpringBeanRouter, but with a regular router you would do this: myRouter.attach(/v1/images

Serve static content using SpringBeanRouter?

2014-05-29 Thread Jorge Gallardo
Hello all, Im trying to serve static content from the filesystem but I cant. I was able to do it with a plain and simple Reslet application but not using SpringBeanRouter. Here is the code: @Component(/v1/images/{imageId}) @Scope(prototype) public class ImagesResource extends

Re: Serve static content using SpringBeanRouter?

2014-05-29 Thread Jerome Louvel
Hi Jorge, Normally, you shouldn't embed a Directory inside a ServerResource but directly attach it to your SpringBeanRouter. To not have to use the {imageId} path variable (for your file names I guess), you can set the route's matchingMode to Template.STARTS_WITH. I'm not sure exactly how to do

Re: How to signup a ChallengeAuthenticator when using SpringBeanRouter

2011-04-27 Thread Daniele Dellafiore
that as the inbound router. Maybe I'll try when I'll have a more complete solution. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/How-to-signup-a-ChallengeAuthenticator-when-using-SpringBeanRouter-tp5588475p6309297.html Sent from the Restlet Discuss mailing list archive

How to signup a ChallengeAuthenticator when using SpringBeanRouter

2010-09-30 Thread infinity
I have a working app with restlet 2.0 and Server resources configured through SpringBeanRouter ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:util=http://www.springframework.org/schema/util

RE: Unable to setup SpringBeanRouter configure

2009-10-08 Thread Jerome Louvel
...@gmail.com] Envoyé : lundi 5 octobre 2009 22:34 À : discuss@restlet.tigris.org Objet : Re: Unable to setup SpringBeanRouter configure Works with 2.0M5. Thanks Pritam wrote: I'm using 2.0M4, will try 2.0M5. Can you point out the file in which this bug was fixed so that I could test in the interim

Re: Unable to setup SpringBeanRouter configure

2009-10-05 Thread Rhett Sutphin
Hi Infinity, On Oct 5, 2009, at 10:03 AM, infinity wrote: I'm trying to setup a SpringBeanRouter as per the javadocs since I cannot use SpringRouter if I use spring prototype beans for attachements acc to this http://n2.nabble.com/Unable-to-inject-Protoype-beans-into-a-singleton-bean

Re: Unable to setup SpringBeanRouter configure

2009-10-05 Thread infinity
param-value component /param-value /context-param Btw, I corrected the virtual host configuration from the parent post. pl refer the same. Rhett Sutphin wrote: Hi Infinity, On Oct 5, 2009, at 10:03 AM, infinity wrote: I'm trying to setup a SpringBeanRouter

Re: Unable to setup SpringBeanRouter configure

2009-10-05 Thread Rhett Sutphin
SpringRouter, SpringBeanRouter, or something else) are relative to the attachment point of the router. Rhett !-- Configuration parameters -- context-param description Comma separated list of Spring context configuration files. /description param

Re: Unable to setup SpringBeanRouter configure

2009-10-05 Thread infinity
/mock/1/data/Contact/{userId} I'm guessing that's not what you want. Router attachment URIs (whether you use SpringRouter, SpringBeanRouter, or something else) are relative to the attachment point of the router. Rhett I think you're mistaken. Did you look at the updated configuration

Re: Unable to setup SpringBeanRouter configure

2009-10-05 Thread infinity
/ws/contact/{operation} http://servername:port/mock/mock/1/data/Contact/{userId} I'm guessing that's not what you want. Router attachment URIs (whether you use SpringRouter, SpringBeanRouter, or something else) are relative to the attachment point of the router. Rhett I think you're

Re: SpringBeanRouter

2009-04-14 Thread Jim Alateras
Rhett, Thanks for the quick turnaround and suggestions On 14/04/2009, at 2:19 PM, Rhett Sutphin wrote: Hi Jim, On Apr 13, 2009, at 7:56 PM, Jim Alateras wrote: I am currently using s custom class to attach routes to a router but am now looking at using the SpringBeanRouter but have

Re: SpringBeanRouter

2009-04-14 Thread Rhett Sutphin
but am now looking at using the SpringBeanRouter but have a couple of questions. 1. In the example below if i also want to support the a query string would i change the bean name to /studies?{query} You should set the bean name to whatever you were formerly passing to Router#attach

SpringBeanRouter

2009-04-13 Thread Jim Alateras
I am currently using s custom class to attach routes to a router but am now looking at using the SpringBeanRouter but have a couple of questions. 1. In the example below if i also want to support the a query string would i change the bean name to /studies?{query} 2. How do i specify

Re: SpringBeanRouter

2009-04-13 Thread Rhett Sutphin
Hi Jim, On Apr 13, 2009, at 7:56 PM, Jim Alateras wrote: I am currently using s custom class to attach routes to a router but am now looking at using the SpringBeanRouter but have a couple of questions. 1. In the example below if i also want to support the a query string would i change

Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-09 Thread Paul Austin
to name groups of matches. Paul On 8-Apr-09, at 4:18 PM, Rhett Sutphin wrote: Hi Paul, On Apr 8, 2009, at 10:18 AM, Paul Austin wrote: Jerome, Here is an implementation which extends SpringBeanRouter, it could easily be integrated into the super class. Thanks for the suggestion. I've

RE: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-08 Thread Jerome Louvel
: discuss@restlet.tigris.org Objet : Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to / Here is a class which fixes the issue. Probably a better solution would be to change the Route class so that if the remainingPart is it sets it to / before doing the regex matching

Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-08 Thread Paul Austin
which would allow me to set the default restlet. Could you also have a setAttachment(String path, String beanName) method and setAttachments(ListString beanNames) bean id=router class=...SpringBeanRouter p:defaultAttachment=myRootResource / BTW setXXX methods are easier to work with in Spring

Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-08 Thread Paul Austin
Jerome, Here is an implementation which extends SpringBeanRouter, it could easily be integrated into the super class. import java.util.Map; import java.util.Map.Entry; import org.restlet.Finder; import org.restlet.ext.spring.SpringBeanRouter; import org.springframework.beans.BeansException

Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-08 Thread Rhett Sutphin
Hi Paul, On Apr 8, 2009, at 10:18 AM, Paul Austin wrote: Jerome, Here is an implementation which extends SpringBeanRouter, it could easily be integrated into the super class. Thanks for the suggestion. I've added something similar in SpringBeanRouter in trunk r4711, but I only added

[1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-07 Thread Paul Austin
/servlet-class /servlet servlet-mapping servlet-namebpf/servlet-name url-pattern/*/url-pattern /servlet-mapping The root restlet is a SpringBeanRouter and I have a mapping for / to a resource as shown below. bean id=root class=org.restlet.ext.spring.SpringBeanRouter / bean name

Re: [1.1.3] Tomcat + RestletFrameworkServlet mapping SpringBeanRouter to /

2009-04-07 Thread Paul Austin
? public class RootSpringBeanRouter extends SpringBeanRouter { @Override public void handle(Request request, Response response) { Reference resourceRef = request.getResourceRef(); if (resourceRef.getRemainingPart().equals()) { resourceRef.addSegment(); } super.handle(request

RE: Re: SpringBeanRouter enhancement

2009-02-18 Thread Daniel Woo
Sorry, I got no time to write a full fledged unit test class, I simply submitted a ticket in your backlog :-) http://restlet.tigris.org/issues/show_bug.cgi?id=735 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1184490

RE: SpringBeanRouter enhancement

2009-02-18 Thread Jerome Louvel
@restlet.tigris.org Objet : Re: SpringBeanRouter enhancement Hi Daniel, This is a reasonable fix. Can you open a ticket in the issue tracker? If you'd care to submit a patch with unit tests, that would be even better. Thanks, Rhett On Feb 16, 2009, at 12:50 AM, Daniel Woo wrote: Hi guys

RE: Re: SpringBeanRouter enhancement

2009-02-18 Thread Jerome Louvel
d'origine- De : Daniel Woo [mailto:daniel.y@gmail.com] Envoye : mercredi 18 fevrier 2009 09:56 A : discuss@restlet.tigris.org Objet : RE: Re: SpringBeanRouter enhancement Sorry, I got no time to write a full fledged unit test class, I simply submitted a ticket in your backlog :-) http

Re: SpringBeanRouter enhancement

2009-02-16 Thread Rhett Sutphin
Hi Daniel, This is a reasonable fix. Can you open a ticket in the issue tracker? If you'd care to submit a patch with unit tests, that would be even better. Thanks, Rhett On Feb 16, 2009, at 12:50 AM, Daniel Woo wrote: Hi guys, The SpringBeanRouter.resolveUri() method in 1.1.1 has a

SpringBeanRouter enhancement

2009-02-15 Thread Daniel Woo
Hi guys, The SpringBeanRouter.resolveUri() method in 1.1.1 has a potential problem, if you specify restlet in Spring configuration file without an id like this way: bean name=/product-folders scope=prototype class=... /bean Your BeanFinder will never be attached the URI /product-folders. The

RE: Re: SpringBeanRouter issues

2009-01-16 Thread Daniel Woo
issues, I gave up and revert to 1.1.1. Anyway I did read through your code SpringBeanRouter and SpringBeanFinder, it seems your solution is smarter than mine and SpringBeanFinder is totally not affected :-) I 99% believe your change should work. Once you guys release 1.2 officially I will switch

Re: SpringBeanRouter issues

2009-01-13 Thread Jerome Louvel
Hi Daniel, Thanks for sharing your experience and for the enhancement suggestion. I've just made the SpringBeanRouter implement ApplicationContextAware, using the context received to instantiate the finders. Changes are checked in SVN trunk. However, I'm not sure however about injecting

Re: SpringBeanRouter issues

2009-01-13 Thread Rhett Sutphin
prefer the current style -- it allows you to change the finder type by subclassing SpringBeanRouter and overriding createFinder -- especially since you're going to have to modify the prototype finders anyway (to give them the resource bean name). Rhett On Jan 13, 2009, at 4:00 PM, Jerome

RE: Re: SpringBeanRouter issues

2009-01-11 Thread Daniel Woo
can make SpringBeanRouter implement ApplicationContextAware. I made it this way, the AOP interceptor successfully executed. I changed very little to your SpringBeanRouter and SpringBeanFinder: SpringBeanRouter: make it ApplicationContextAware, and holds an ApplicationContext. Each time

RE: Re: SpringBeanRouter issues

2009-01-09 Thread postmaster
I think you can make SpringBeanRouter implement ApplicationContextAware. I made it this way, the AOP interceptor successfully executed. I changed very little to your SpringBeanRouter and SpringBeanFinder: SpringBeanRouter: make it ApplicationContextAware, and holds an ApplicationContext. Each

SpringBeanRouter issues

2009-01-08 Thread postmaster
of org.restlet.ext.spring.SpringBeanRouter which is injected by the Spring container into the Application. Hence Application.createRoot() returns the injected SpringBeanRouter as root router. So far, everything works but 1. Each resource bean must have an explicit ID, otherwise bean lookup will fail

Re: SpringBeanRouter issues

2009-01-08 Thread Rhett Sutphin
configuration file appcontext.xml, and the root router is an instance of org.restlet.ext.spring.SpringBeanRouter which is injected by the Spring container into the Application. Hence Application.createRoot() returns the injected SpringBeanRouter as root router. So far, everything works

bug in the spring SpringBeanRouter

2008-04-01 Thread Michael Böckling
After lots of debugging, it seems wildcards don't work in the SpringBeanRouter, since the * is improperly escaped. The SpringBeanRouter also does not work when placed in the [servlet-name]-servlet.xml, it must be placed in the main applicationContext.xml. Can you confirm this?

Re: bug in the spring SpringBeanRouter

2008-04-01 Thread Rhett Sutphin
On Apr 1, 2008, at 3:20 PM, Michael Böckling wrote: After lots of debugging, it seems wildcards don't work in the SpringBeanRouter, since the * is improperly escaped. I haven't tried using *. SpringBeanRouter is taking the bean name and passing it directly to attach. I'm not aware