[opencms-dev] Re: opencms servlets

Alexander Wallace aw at avatartechnology.com
Thu Jun 23 21:16:56 CEST 2005


Hi Pramila, allow me to cc the opencms list just in cas this can help others 
and maybe bring more light to the issue...

I was able to deploy servlets in opencms and i know for a fact that it is 
possible to use them succesfully... My problem was that whenever i called my 
servlet, i would get a new session and thus i could not remain logged in... 
This is a problem i had, and then i had to move on, so instead of using a 
servlet as a  controller, now i'm using jsps... Having said that, i know 
others use servlets just fine, but i have not gotten time to find out why i 
could not...

The way to deploy your servlets is to put them either in a jar inside of the 
lib folder of your site's module, or as compiled classes in the classes 
folder of your site module, and then publish them... You need to publish them 
cuz that's when they get copied to the actuall classes or lib folder of the 
opencms web app...   Yo also need to register your servlets in the opencms's 
web.xml file... How you call them then is just like any other, using the uri 
defined in the web.xml (tho this may be where my problem started)...

Even tho i'm not using servlets as actions for forms, etc, I'm using java 
classes for db, validation, and anything you can think of, but i start the 
process from a jsp.

I hope this helps you...

Alex.
On Thursday 23 June 2005 01:26 pm, Pramila Thakur wrote:
> Hi Alexander,
> 
> I want to use opencms for my project. I see the documentation and it is 
great. But I want to write my servlets and do some validation and use db 
query and other things.
> But I am unable to find the solutin where do I put my servlet and how do I 
call from my jsp. 
> 
> As I see only you asking this question. Did you figure out some way. Can you 
give me some insight into it.
> 
> I would really appriciate your help.
> 
> Thanks
> Pramila Thakur
> 
> 



More information about the opencms-dev mailing list