Xybrek | 8 Feb 07:49 2015
Picon

Restlet cannot process query parameter on ROOT path

I have this code:

 <at> Override
public Restlet createInboundRoot() {

     Router router = new Router(getContext());

     Redirector forward = new Redirector(getContext(), SOME_URL,
             Redirector.MODE_CLIENT_FOUND);

     router.attach("/" + "{id}", forward);
     router.attach("/rest/", RootServerResource.class);

     MyFilter myFilter = new MyFilter(getContext());
     myFilter.setNext(router);

     return myFilter;
}

The problem with this code is that Restlet cannot seem to process query 
parameter on ROOT path:

http://localhost:8080/?test=test

Filter does not trigger.

However, when through the /rest/ part

http://localhost:8080/rest/?test=test

(Continue reading)

Jerome Louvel | 3 Feb 16:30 2015

Restlet Framework 2.3.1 released

Hi all,

We have just pushed the first maintenance version on the "stable" branch.
Here are the bug fixed:
- Reintroduced registration by default of the internal HTTP server connectors in JEE edition. - FormDataSet not properly serializing text/plain files. Issue #1006. Reported by johnjaylward. - Fixed fileupload extension for GAE and JEE editions. - Fixed potential NPE. Issue #1004. Reported by Philippe Perrault. - Reference scheme reverts to http when using https. Issue #998. Reported by Stephen C. Pope. - Fixed bug that prevented client code to properly consume error responses #1004 and #1018. Reported by Philippe Perrault and spraguep.
Xybrek | 15 Jan 13:27 2015
Picon

Is there any concrete example on how to use Restlet File Upload extension with Google App Engine?

Is there any concrete example on how to use Restlet File Upload 
extension with Google App Engine?

There are lots of example for Restlet File Upload but not for the GAE 
edition of Restlet? Is there any complete Upload example to do file 
upload with Restlet?

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

Xybrek | 14 Jan 01:45 2015
Picon

CRUD Operation for Calling ServerResouce with ClientProxy

I have this ServerResource that is called by a ClientProxy:

public class GaeThingServerResource extends SelfInjectingServerResource
         implements ThingResource {
     private static final Logger LOG
             = Logger.getLogger(GaeThingServerResource.class.getName());
      <at> Override
     public ThingItem createThing(ThingItem Thing) {
         store().put(Thing);
         return Thing;
     }
      <at> Override
     public ThingItem readThing(Long id) {
         LOG.info("Read Thing id=" + id);
         ThingItem result = store().get(ThingItem.class, id);
         return result;
     }
      <at> Override
     public ThingItem updateThing(ThingItem Thing) {
         LOG.info("Updating Thing=" + Thing.toString());
         store().put(Thing);
         return Thing;
     }
      <at> Override
     public void deleteThing(Long id) {
         LOG.info("Delete Thing id=" + id);
         store().delete(ThingItem.class, id);
     }
}

This is called by:

public interface ThingResourceProxy extends ClientProxy {
      <at> Get
     public void readThing(Long id, Result<ThingItem> callback);
      <at> Delete
     public void deleteThing(Long id, Result<Void> callback);
      <at> Post
     public void createThing(ThingItem thing, Result<ThingItem> callback);
      <at> Put
     public void updateThing(ThingItem thing, Result<ThingItem> callback);
      <at> Get
     public void list(Result<ThingResultItem> callback);
}

With this code:

                 ThingResourceProxy thingResource = 
GWT.create(ThingResourceProxy.class);

thingResource.getClientResource().setReference("/rest/thing/" + id);
                 thingResource.readThing(id, new Result<ThingItem>() {
                    //...
                 };

However readThing method the Long id is always null, when is called, 
what could be the problem?

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

Xybrek | 13 Jan 21:42 2015
Picon

HTTP/1.1 422 Unprocessable Entity - Error

How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422 
Unprocessable Entity" error?

Is it fine to have these two dependency in the project (or just one?):

       <dependency>
           <groupId>org.restlet.gae</groupId>
           <artifactId>org.restlet.ext.jackson</artifactId>
           <version>2.2.0</version>
       </dependency>
       <dependency>
           <groupId>org.restlet.gae</groupId>
           <artifactId>org.restlet.ext.json</artifactId>
           <version>2.2.1</version>
       </dependency>

If this is not the issue what could be the problem that GWT ClientProxy 
is getting this error? The Actual method in the ServerResource doesn't 
seem to get invoked at all, since the LOG would not show. So Where is 
this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the 
actual ServerResource, how to deal with this?

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

Xybrek | 3 Jan 20:41 2015
Picon

Re: Redirect whole browser traffic to restlet proxy

On Tuesday, 07 October, 2014 08:12 PM, Jovan Jovanovic wrote:
> Hi everybody,
>
> after a lot of tries to build a proxy server I found it really easy using Restlet. Although I have an obvious
issue after setting all the traffic from Chrome to go through my proxy, I get redirection loop (as also the
routed URL is trying to go through proxy). Here is the code that I am using:
>
>   public static void main(String[] args) throws Exception {
>      Component component = new Component();
>      component.getClients().add(Protocol.HTTP);
>      component.getServers().add(Protocol.HTTP, 8111);
>      Application application = new RestletProxy();   component.getDefaultHost().attachDefault(application);
>          component.start();
>      }
>       <at> Override
>      public Restlet createInboundRoot() {
>        Router router = new Router(getContext());
>        String target = "http://www.google.com";
>        Redirector redirector = new  Redirector(getContext(), target);
>        router.attachDefault(redirector);
>        return router;
>      }
>
> So I am just trying to redirect every single request to google. Is it possible using restlet?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3089543
>

I just want to share that yes it is possible, I have a running proxy in 
heroku that runs Restlet proxy and redirects all traffic to a given URL

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

Tim Peierls | 19 Dec 20:34 2014
Picon

Trouble going from 2.2 to 2.3

The default connectors for various editions have changed between 2.2 and 2.3 (actually between 2.3-RC1 and 2.3.0). JEE edition no longer registers HTTP or HTTPS server helpers; JSE still does.

Assuming this was intentional and not an oversight, the change causes problems for me. For several versions now I've been able to maintain one build that works both as a standalone deployment and when embedded in a WAR for deployment in a production server running Tomcat. I've used the JEE edition because of the dependency on org.restlet.ext.servlet.ServerServlet.

(Why use Tomcat at all? There are better connectors for production purposes. Short answer is that it plays well with AWS Elastic Beanstalk.)

With this latest change, however, the standalone deployment no longer works. I get message: No available server connector supports the required protocols: 'HTTP' Please add the jar of a matching connector to your classpath.

It's because no HttpServerHelper has been registered in these lines for JEE (the "jee" token was added to the #ifndef list only a few days ago). I'd be happy to add the jar of a matching connector if there was one that the JEE edition supported, but the obvious candidates, Jetty and Simple, don't seem to be available for that edition.

I'd be happy to switch to the JSE edition, but then I wouldn't be able to compile against org.restlet.ext.servlet.

There's an existing issue which is vaguely related:


I'm not filing my own issue yet, because I don't see it as a bug, but I'd like advice on what to do here. I'd prefer not to have to make separate builds -- it was a really nice property that I could run the same code and libraries either standalone or deployed as a WAR.

--tim
Jerome Louvel | 18 Dec 22:49 2014

Restlet Framework 2.3.0 released!

Hi all,

Check out the details about the new version here!

We also updated the technical documentation on the web site with better styling, a navigation bar in the user guide and more. The Javadocs area will get the update soon as well.

Thanks,
Jerome
--



Jerome Louvel | 29 Nov 08:52 2014

Restlet Framework 2.3 RC1 and 2.2.3 released

Hi all,

We have just released version 2.3 RC1 that will soon become our new "stable" version, as well a 2.2.3 that includes several bug fixes including a critical security fix for Directory. Please test and send any feed-back, 2.3.0 is planned for next week!

Recent changes in the 2.3 branch include:
  • support for SPDY via the Jetty 9.2 extension, 
  • automatic serialization of Java exceptions as HTTP error responses on both client-side and server-side via the <at> Status annotation, StatusService and ConverterService,
  • an enhanced APISpark extension including an API introspector for Restlet API/JAX-RS API/Jackson annotations as well as a firewall service with rate limitation (integration with APISpark is optional),
  • compatibility with GWT 2.7,
  • Jackson extension now configured to produce more compact JSON by ignoring null values by default,
  • update HTTP client connectors timeout default value to prevent connections to stay around forever if not consumed,
  • Swagger 1.2 & 2.0, RAML 0.8  support added and improved via dedicated extensions
Changes log for 2.3:

To download those version:
Koen Maes | 20 Nov 15:18 2014
Picon

"segment" router or subrouter

Hi

My Restlet application is now mapped in the web.xml to "/app" and "/app/*". I have a whole bunch of routes
setup underneath this base URL in a function called setupApp(router).

Now, I plan to refactor things a bit and I want to change my web.xml so *every* call is intercepted by Restlet
so "/*".

The existing routings like "/app/user/{userId}" must keep on working.

**Now I can manually add the first segment "app" to my existing routings so they keep on working. **

But there must be an easier way to do this. I expect something like this to work :

public synchronized Restlet createInboundRoot() {

  Router router = new Router(this.getContext());

  Router subRouter = new Router(this.getContext());
  router.add("/app/*", subRouter);
  setupApp(subRouter);

  // add new stuff to the router
  router.add("index.html", IndexRouter.class);

}

// existing code but now with first segment /app added ?
// in the original code, the main router is passed in
public void setupApp(Router subRouter) {

  subRouter.add("/user/{userId}", UserResource.class);
  subRouter.add("/user/{userId}", UserResource.class);

}

thx for the pointers ...

Koen

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

Jerome Louvel | 19 Nov 00:54 2014

New Restlet web site and framework logo

Hi all,

We just released our brand new Restlet web site this morning, with a new visual identity and consolidating all our products, Restlet Framework, APISpark (GA today) and the Restlet Studio (preview) in one place: http://restlet.com

Here is also the new logo:



Note that some technical resources on the framework haven't been fully migrated yet, but no worry we are actively working on them as I write. Thanks for your patience and do not hesitate to report issue if they are not fixed by the end of this week.

We are also completing version 2.3 of the framework including some great contributions such as support for Swagger 1.2/2.0, RAML 0.8, Jetty 9.2 (client-side and SPDY), firewall with rate-limitation and more.

Stay tuned!

Gmane