restlet

NoSuchMethodError: com.google.common.base.Stopwatch.createStarted()Lcom/google/common/base/Stopwatch

泄露秘密 提交于 2019-11-29 14:07:53
My app is throwing NoSuchMethodError: com.google.common.base.Stopwatch.createStarted()Lcom/google/common/base/Stopwatch error. Not sure why, because 16.0.1 do contain that class, I've checked. From what I have researched, it looks like this is a bug? I also have this code for refernence, though I think this is not the issue: FirewallRule rule = new PeriodicFirewallCounterRule(60, TimeUnit.SECONDS, new IpAddressCountingPolicy()); ((PeriodicFirewallCounterRule)rule).addHandler(new RateLimitationHandler(new UniqueLimitPolicy(10))); FirewallFilter firewallFiler = new FirewallFilter(getContext(),

Receive custom exceptions from Restlet Framework in GWT client

这一生的挚爱 提交于 2019-11-29 12:31:27
I want to use Exception handling with the Restlet Framework and GWT clients. The Restlet Framework supports the concept of annotated exceptions as described in this post; http://restlet.com/company/blog/2015/12/21/exception-handling-with-restlet-framework/ In my project i created a LocationNameException @Status(value = 409) public class LocationNameException extends Exception { ... //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public LocationNameException(String pMessage, Throwable pCause) { super(pMessage, pCause); } } And

RESTful authentication - resulting poor performance on high load?

和自甴很熟 提交于 2019-11-29 11:56:41
问题 For a RESTful web service we say that that the server shouldn't store any state. Now for every request the 'user' must be authenticated and must have an authorization for the action(s) he/she wishes to carry out. Now every request will contain authorization data for that user. Here are my confusions: Assuming there is a login and password field on the home-page. The user enters the username/password which is sent back to the server, user verified and then 'some token' is returned. Now this

RESTlet: How to process multipart/form-data requests?

大城市里の小女人 提交于 2019-11-29 08:04:35
How do you catch incoming @Post variables when it is a multipart/form-data request? For a regular Post request I would do: @Post public void postExample(Representation entity) throws Exception{ Form form = new Form(entity); System.out.println(form.getFirstValue("something")); } But because it is a multipart/form-data request the above outputs null I'm a Java newbie so be gentle :) PS: I'm not interested in processing the incoming files, just the text fields. This is a paste from one of my methods (Restlet 2.0). Here I have a form that includes one file upload plus other fields, therefore it is

fix java.net.SocketTimeoutException: Read timed out

我只是一个虾纸丫 提交于 2019-11-28 22:56:39
问题 I have a RESTful server which takes an http POST input from client to vote up songs on server. I have used Apache HTTPClient for client. public boolean vote() { HttpClient client = new DefaultHttpClient(getHttpParameters()); HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); // Timeout Limit HttpResponse response; try { HttpPost post = new HttpPost("http://127.0.0.1:8080/ws/"); StringEntity se = new StringEntity("{ \"song_id\" : \"2\" }"); se.setContentType(new BasicHeader

Fine-grained Authentication with RESTlet

强颜欢笑 提交于 2019-11-28 20:38:31
问题 I want to expose a resource using RESTlet with a fine-grained authentication. My ServerResource should be accessable via GET only for authenticated members (using BASIC Authentication). However, requests using POST should be available also for callers without any authentication. In order to clearify: http://path/myapp/user should allow anyone to register using POST , but only registered members should be able to GET a list of all users. I'm unfortunately not much into RESTlet and I only find

Restlet POST using JSON

别说谁变了你拦得住时间么 提交于 2019-11-28 18:55:00
How do I implement Restlet function which accepts JSON post? And how do I test this using curl? Thanks With Restlet 2, you can either: test the entity media-type compatibility in @Post acceptRepresentation(Representation entity) : @Post public Representation acceptRepresentation(Representation entity) throws ResourceException { if (entity.getMediaType().isCompatible(MediaType.APPLICATION_JSON)) { // ... } // ... } or use @Post with one or two parameters: @Post("json") Representation acceptAndReturnJson(Representation entity) { // ... } See these links: http://restlet.tigris.org/ds/viewMessage

RESTful application on Google App Engine Java?

我们两清 提交于 2019-11-28 13:18:52
问题 I would like to create a RESTful app on Google App Engine. I would like to provide XML and JSON services. I have briefly experimented with Restlet, Resteasy, and Jersey. I haven't had much success with any of them, other than some simple examples in Restlet. Could you share your experiences creating a Restful web application on Google App Engine using Java or provide any insight on the aforementioned toolkits on GAE? Thanks! Edit (2009-07-25): I have decided to use Restlet for the time being.

Restlet POSTing JSON to Appengine error

人盡茶涼 提交于 2019-11-28 12:50:55
We have a small app with Restlet on the GAE server and GWT and Android clients. Restlet serves GWT-serialized replies to GWT clients and JSON to Android clients. All is ok with GWT-serialization both locally and on AppEngine production servers. All is ok with Android (JSON) clients talking to local dev server. Android taking to production AppEngine server GETs JSON replies, but POST fails. There is no error or warning in logs. The function on server gets called but parameter passed is null. This is the offending code: @Post("json") public void createLocationJSON(Location location) { //

NoSuchMethodError: com.google.common.base.Stopwatch.createStarted()Lcom/google/common/base/Stopwatch

心不动则不痛 提交于 2019-11-28 07:39:36
问题 My app is throwing NoSuchMethodError: com.google.common.base.Stopwatch.createStarted()Lcom/google/common/base/Stopwatch error. Not sure why, because 16.0.1 do contain that class, I've checked. From what I have researched, it looks like this is a bug? I also have this code for refernence, though I think this is not the issue: FirewallRule rule = new PeriodicFirewallCounterRule(60, TimeUnit.SECONDS, new IpAddressCountingPolicy()); ((PeriodicFirewallCounterRule)rule).addHandler(new