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
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
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
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
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
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
...@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
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
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
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
/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
/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
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
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
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
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
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
: 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
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
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
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
/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
?
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
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
@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
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
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
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
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
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
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
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
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
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
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
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?
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
37 matches
Mail list logo