Registering sling servlet for resource

2011-02-13 Thread Unmesh Joshi
Hi, I am trying to register a servlet for resource type, and its not working. It works just fine if I register for path. 1. I have a component (JSP) in CQ as /test/login 2. I am having form as following 3. I have a servlet registerd to handle POST request. The servlet is registe

Re: Registering sling servlet for resource

2011-02-13 Thread Alexander Klimetschek
On 13.02.11 20:00, "Unmesh Joshi" wrote: >/* @scr.property name="sling.servlet.resourceTypes" value="test/login"*/ If this is the complete javadoc annotations for the servlet class, then the following is missing: - @scr.component / @scr.service marking it as a component and service (providing an

Re: Registering sling servlet for resource

2011-02-13 Thread Unmesh Joshi
Thanks!. Adding /*@scr.property name="sling.servlet.methods" value="POST"*/ did the trick. On Mon, Feb 14, 2011 at 1:43 AM, Alexander Klimetschek wrote: > On 13.02.11 20:00, "Unmesh Joshi" wrote: >>/* @scr.property name="sling.servlet.resourceTypes" value="test/login"*/ > > If this is the co

Using ResourceProviders or Servlets for handling GET requests

2011-02-13 Thread Unmesh Joshi
Hi, In Sling, we can Servlets are written for handling POST request. (Even JSPs and other scripts can be used, but I will like to stick to Servlets) For GET requests, either Servlets or ResourceProviders can be used. What is the common idiom or good design practice? ResourceProviders or Servlets?

Re: Using ResourceProviders or Servlets for handling GET requests

2011-02-13 Thread Justin Edelson
ResourceProviders and Servlets do completely different things. ResourceProviders provide resources. Servlets produce representations of resources. Justin On Feb 13, 2011, at 4:23 PM, Unmesh Joshi wrote: > Hi, > > In Sling, we can Servlets are written for handling POST request. (Even > JSPs a

Re: Problems deploying to a servlet container

2011-02-13 Thread Justin Edelson
On Sat, Feb 12, 2011 at 7:25 PM, Nicolai Willems wrote: > On Sun, Feb 13, 2011 at 12:11 AM, Justin Edelson > wrote: >> >> >> On Feb 12, 2011, at 5:06 PM, Nicolai Willems wrote: >> >>> >>> >>> On Sat, Feb 12, 2011 at 10:22 PM, Justin Edelson >>> wrote: >>> On 2/12/11 4:16 PM, Nicolai Willems wr

Re: Using ResourceProviders or Servlets for handling GET requests

2011-02-13 Thread Unmesh Joshi
So If I have a content page, say /content/mysite/accounts.html. And I want to handle GET request for this, there are following options. 1. If I have a template/component backing accounts.html, which is JSP, I can call a service in JSP scriptlet So, the sequence is GET /content/mysite/accounts.htm

Re: Problems deploying to a servlet container

2011-02-13 Thread Nicolai Willems
On Mon, Feb 14, 2011 at 2:45 AM, Justin Edelson wrote: > On Sat, Feb 12, 2011 at 7:25 PM, Nicolai Willems wrote: >> On Sun, Feb 13, 2011 at 12:11 AM, Justin Edelson >> wrote: >>> >>> >>> On Feb 12, 2011, at 5:06 PM, Nicolai Willems wrote: >>> On Sat, Feb 12, 2011 at 10:22 PM, Jus

Re: request.getCharacterEncoding() always returns ISO-8859-1

2011-02-13 Thread Peter Dotchev
Hi Vidar, Thank you for the suggestion. I will try it. Now I found that request filters are described here http://sling.apache.org/site/filters.html Best regards, Peter On Fri, Feb 11, 2011 at 3:27 PM, Vidar Ramdal-2 [via Apache Sling] < ml-node+2473494-998661287-5...@n3.nabble.com> wrote: > O