restlet

Where to store images, CSS and javascript files on glassfish?

泄露秘密 提交于 2019-12-10 20:17:47
问题 I've looked around a lot (trust me :) before posting this questions and I'm still confused. Here's the scenario: Hosting a J2EE web-app on glassfish v3 using Restlet 2.0 The freemarker template files are located in the /WEB-INF folder. The templates link to jQuery/javascript files, some static images and stylesheets using relative URLs. Since it's not a good practice to store them in /WEB-INF (as stated at many places on the web) I moved the files to the WebContent folder WebContent: +-

How do I configure the web.xml for multiple restlet applications?

為{幸葍}努か 提交于 2019-12-10 18:32:28
问题 I want to create a servlet to act as the container for a bunch of restlet applications. I have done servlet for one restlet application but I don't see how I can revise the web.xml to accommodate many applications. Here is web.xml for a single restlet: (taken almost verbatim from "Restlet in Action MEAP"): <?xml version="1.0" encoding="UTF-8"?> ... <display-name>Servlet engine as a container of Restlet applications</display-name> <servlet> <servlet-name>CompanyServerApplication</servlet-name>

Restlet & MULTIPART_FORM_DATA or another way to put files on Google App Engine via Restlet

余生颓废 提交于 2019-12-10 16:44:18
问题 I tried to receive files via restlet but only gets the complete MULTIPART_FORM_DATA. How can I extract my specific file? I found some code-blocks but the types of them are not available... RESTlet: How to process multipart/form-data requests? DiskFileItemFactory factory = new DiskFileItemFactory(); factory.setSizeThreshold(1000240); // 2/ Create a new file upload handler RestletFileUpload upload = new RestletFileUpload(factory); My current code: @Put public void handleUpload(Representation

No available client connector supports the required protocol: 'HTTP'

只谈情不闲聊 提交于 2019-12-10 15:36:27
问题 Greeting. I am playing with Restlet framework, when I am running following code getting and exception Internal Connector Error (1002) - No available client connector supports the required protocol: 'HTTP'. ClientResource cr = new ClientResource( "http://127.0.0.1:8888/user/123"); UserResource resource = cr.wrap(UserResource.class); User user = new User(); user.setName("xxx"); user.setPassword("xxx"); UserValidation userValidation = resource.retrieve(user); if (userValidation != null) { System

Java accessing ServletContext from within restlet Resource

人走茶凉 提交于 2019-12-10 06:39:49
问题 I am using Tomcat server in java and wanted to be able to access the ServletContext from the restlet Resource in order to access my cached DataSource object (to pool mysql connections). org.restlet.resource.Resource comes with a Context object but that is not in any way related to the ServletContext. So after some googling around, I found the following: final String contextKey = "org.restlet.ext.servlet.ServletContext"; final String poolKey = "MyCachedDBPool"; final Map<String, Object> attrs

How to set up a Restlet server with JAXRS and JAXB?

风流意气都作罢 提交于 2019-12-09 22:56:43
问题 I've been looking all over the internet trying to find an example of how to do this. I simply want to set up a REST server which automatically serializes objects to and from XML. I'm simply trying to provide a server that can faciltate user login, logout, and access to a XML list of objects only once a user is logged in. What's required to get a simple example application up and going? I'm failing to grasp the way that the Restlet library works, and I'm entirely new to using JAXB and JAXRS. I

RestKit in android?

狂风中的少年 提交于 2019-12-09 17:51:54
问题 I have used restkit framework in ios. Which is very powerful and provides features like caching and all. I am looking whether a similar framework is available in android? I came across a framework called restlet. But didnt find any samples to work with. Is there any frameworks out there for the same, for caching data from rest services? Also could some one direct me to good tutorials for restlet in android? Thanks 回答1: In addition, there is this first application tutorial covering Restlet

Configure Restlet to Return JSPs on Google App Engine?

大兔子大兔子 提交于 2019-12-09 16:11:28
问题 I have a developed a Restlet application. I would like to return a JSP file on a URL request through Restlet. How can I achieve this without using a redirect? i.e. Let's say I have the file "contact.jsp" on mydomain.com and I want people to be able to access contact.jsp at http://mydomain.com/contact Thus, in Restlet, I would have: router.attach("/contact", MyResource.class); But how can I return the "contact.jsp" page? I know that a redirect would work, but I don't want users to see the "

how to pass parameters to RESTlet webservice from android?

我的梦境 提交于 2019-12-09 03:18:54
问题 I've been looking online for how to pass parameters to RESTlet webservice but it seem there are not much tutorial concerning RESTlet. I would like to send some parameters gathered from a form on my android application (it would be great if i could do this using JSON). 回答1: well i solved this as for the server side @Post public JSONArray serverSideFunction(Representation entity) throws JSONException { try { JSONObject req = (new JsonRepresentation(entity)).getJsonObject(); System.out.println

Running a RESTlet Tutorial, I'm receiving java.lang.NoClassDefFoundError

心不动则不痛 提交于 2019-12-08 17:40:25
问题 I'm trying to run the first server tutorial on RESTlet docs but i'm getting errors even though i added the jars to my classpath. I added org.restlet.jar and org.restlet.ext.* The code for the server is : package test; import org.restlet.Server; import org.restlet.data.Protocol; import org.restlet.resource.Get; import org.restlet.resource.ServerResource; public class Test extends ServerResource { public static void main(String[] args) throws Exception { // Create the HTTP server and listen on