Hi Vito,

On 12/21/2010 11:51 AM, Vito Impagliazzo wrote:
> I have written a gwt servlet which I could successfully use in a gwt client
> inserted through a component into a xwiki page. I now wonder how I can check
> user authentication from the gwt servlet, since even though I can lookup
> other components, the context variables are empty.

First of all, you should know that we have a generic GWT-RPC servlet 
which is mapped to all URLs ending with .gwtrpc and which looks up XWiki 
components. In other words, you can implement a RemoteService as an 
XWiki component without touching the web.xml file (i.e. without adding a 
new servlet mapping).

See 
http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module 
for details about XWiki components. You can take as an example 
http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-client/src/main/java/org/xwiki/gwt/wysiwyg/client/cleaner/HTMLCleaner.java
 
with its implementation 
http://svn.xwiki.org/svnroot/xwiki/platform/web/trunk/xwiki-gwt-wysiwyg-server/src/main/java/com/xpn/xwiki/wysiwyg/server/internal/cleaner/DefaultHTMLCleaner.java
 
.

If you still want to use your own GWT-RPC servlet then in order to have 
the XWiki context initialized you need to map the 
XWikiContextInitializationFilter to your servlet. Checkout web.xml to 
see what is done for "gwtrpc" servlet.

Hope this helps,
Marius

>
> thanks
> Vito Impagliazzo
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to