HTML Email
Anyone have any luck sending HTML email through restlet? I've tried explicitly setting the content type on the request, but the client always seems to receive an email of type text/plain. Here's basically what I'm doing: Client client = new Client(Protocol.SMTP); request.getAttributes().put(Content-type,text/html); Anyone have any tips on how to send HTML email? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2368598
RE: bug?
Actually, I've just renamed the method to doCatch as the error term was ambiguous regarding Java terminology (ie. errors vs exceptions). Same logic. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : dimanche 5 juillet 2009 15:45 À : discuss@restlet.tigris.org Objet : Re: bug? Great! I'm really looking forward to this and the OnError bit making it into a release. :) -- -a Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts. -- L. Stein On Jul 5, 2009, at 8:20 AM, Jerome Louvel wrote: Hi Schley, FYI, this has been fixed in SVN trunk. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com Schley Andrew Kutz a écrit : I want to prevent the use of HTTP VERB annotations in order to force sub-classes to respond with specific class types via abstract methods that I prototype in a base class. I marked the isAnnotated() method as @Override and final and returned false. However, when it returns false I get the following error: java.lang.NullPointerException at org .restlet .engine.resource.AnnotationUtils.getAnnotation(AnnotationUtils.java: 106) at org .restlet.resource.ServerResource.getAnnotation(ServerResource.java: 649) at org.restlet.resource.ServerResource.doHandle(ServerResource.java: 329) at org .restlet .resource.ServerResource.doNegotiatedHandle(ServerResource.java:592) at org .restlet .resource.ServerResource.doConditionalHandle(ServerResource.java:260) at org.restlet.resource.ServerResource.handle(ServerResource.java: 921) at com.h9labs.vangaea.server.rest.BaseResource.handle(BaseResource.java: 159) at org.restlet.resource.Finder.handle(Finder.java:510) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Router.handle(Router.java:490) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org .restlet.engine.application.StatusFilter.doHandle(StatusFilter.java: 153) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111) at org .restlet .engine.application.ApplicationHelper.handle(ApplicationHelper.java: 71) at org.restlet.Application.handle(Application.java:396) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Router.handle(Router.java:490) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.routing.Router.handle(Router.java:490) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:201) at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111) at org.restlet.Component.handle(Component.java:397) at org.restlet.Server.handle(Server.java:350) at org.restlet.engine.ServerHelper.handle(ServerHelper.java:71) at org .restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java: 149) at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java: 932) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 362) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org .mortbay .jetty.handler.RequestLogHandler.handle(RequestLogHandler.java: 49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.Server.handle(Server.java:324) at
RE: GAE + Restlet issue
Hi Matt, I've protected this part of the code against NPEs in SVN trunk. That should help. Otherwise, did you modify the ConnectorService in your component? Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Matt [mailto:mjwat...@gmail.com] Envoyé : mardi 30 juin 2009 04:59 À : discuss@restlet.tigris.org Objet : GAE + Restlet issue Hi there, I'm trying to use GAE and Restlet together. All works fine on the local development server. The first initial deploy to the live server worked fine. 1.latest.[applicationid].appspot.com works as expected. However on my subsequent deploys I keep getting: 1001.latest.[applicationid].appspot.com --- fails with the following error from the logs # org.restlet.Restlet handle: Unable to start the Restlet java.lang.NullPointerException at org.restlet.engine.component.ComponentHelper.checkVirtualHost(ComponentHelpe r.java:89) at org.restlet.engine.component.ComponentHelper.start(ComponentHelper.java:183) at org.restlet.Component.startHelper(Component.java:539) at org.restlet.Component.start(Component.java:513) at org.restlet.Restlet.handle(Restlet.java:172) at org.restlet.Component.handle(Component.java:394) at org.restlet.Server.handle(Server.java:350) at org.restlet.engine.ServerHelper.handle(ServerHelper.java:69) at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:149) at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:932) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler .java:1093) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFi lter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler .java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Transa ctionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler .java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHa ndlerMap.java:237) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnectio n.java:830) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcReque stParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest (JettyServletEngineAdapter.java:125) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235 ) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingReque st(RuntimePb.java:4755) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingReque st(RuntimePb.java:4753) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApp licationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359) at com.google.net.rpc.impl.Server$2.run(Server.java:800) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56 ) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpan Builder.java:510) at com.google.net.rpc.impl.Server.startRpc(Server.java:756) at com.google.net.rpc.impl.Server.processRequest(Server.java:348) at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.ja va:459) at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java:419) at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.ja va:762) at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207) at
RE: HTML Email
Hi there, When using the SMTP client connector, you need to POST mails using a special XML document as specified here: http://www.restlet.org/documentation/snapshot/ext/org/restlet/ext/javamail/J avaMailClientHelper.html In the body element, you should try to add your HTML content as a CDATA section. Let us know if this still doesn't work. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : webp...@tigris.org [mailto:webp...@tigris.org] Envoyé : mardi 7 juillet 2009 02:25 À : discuss@restlet.tigris.org Objet : HTML Email Anyone have any luck sending HTML email through restlet? I've tried explicitly setting the content type on the request, but the client always seems to receive an email of type text/plain. Here's basically what I'm doing: Client client = new Client(Protocol.SMTP); request.getAttributes().put(Content-type,text/html); Anyone have any tips on how to send HTML email? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23685 98 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2368732
RE: Need help with S3App.java example, from RESTful Web Services (O'Reilly)
Hi woodHack, I've just did a test and it worked for me. I created an AWS account *and* signed up for the S3 service (you need this step). I was able to retrieve the list of buckets (empty initially) fine. See also the slightly updated classes attached. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : R.H. [mailto:lnrha...@gmail.com] Envoyé : mercredi 1 juillet 2009 03:19 À : discuss@restlet.tigris.org Objet : Need help with S3App.java example, from RESTful Web Services (O'Reilly) I am trying to run the S3App.java (RESTful Web Services publisher O'Reilly) and getting a HTTP response code of 403 Forbidden. S3App.java extends S3Authorized.java which defines the following keys (constants), public final static String PUBLIC_KEY = 0F9DBXKB5274JKTJ8DG2; public final static String PRIVATE_KEY = GuUHQ086WawbwvVl3JPl9JIk4VOtLcllkvIb0b7w; which are not allowing me to authenticate properly. I have compiled, S3App, S3Authorized, S3Bucket, and S3Object, successfully. Please might someone shed some light on what I am doing wrong? I tried the following work around. I created an account at AWS. When doing so, I was assigned an Access Key ID and a Secret Access Key. I updated the code's original PUBLIC_KEY value by replacing it with the value of my AWS_Access_Key_ID and PRIVATE_KEY with my AWS_Secret_Access_Key value. The work around failed. I figured this was a long shot and would probably fail; because I was assuming the AWS_Secret_Access_Key is suppose to be used to create signatures for requests made to retrieve S3 content. However, I could have misunderstood the intent of an AWS_Secret_Access_Key and how to use it properly. I have attached all the java code. Cheers and thanks for reading, woodHack -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2368812 S3App.java Description: Binary data S3Authorized.java Description: Binary data