Tuesday, April 18, 2006

use domino servlets unpacked

As many others like you Domino devs out there, I am also approaching Java. For the moment, Java under Domino. And I am also playing more and more with servlets, due to their feature of being loaded into memory. I think this makes things a little faster.

I used to like packing files (classes) into *.jar files, then deploy them on the domino server using ftp, issue 'tell http restart' and test. No more this approach, at least the jar packing. Why ? Because if you deploy a new servlet into domino\servlet\someServlet.jar, you also have to specify the same relative path into the server document (the Classpath field). If you have many servlets, you may end up deal with the 32k limit for the Classpath field.

Solution is to leave the Classpath field to its default domino\servlet path, then recreate the folder hierarchy on the domino server

Example: using Eclipse, I like to keep things organized. I use packages, thus the servlet code is looking something like:

package ro.radu.mypackage ;
public class MyServlet extends HttpServlet {
....
}

When compiled, on the Domino server, I go and create the proper folder hierarchy: domino\servlet\ro\radu\mypackage and copy the MyServlet.class into the last folder.

This is old news, I know :)

The advantage is that you can have one Eclipse project called DominoServlets, and all little servlets can be developed under the same Eclipse package, deployment meaning:
- copy your class file on the Domino server proper path
- if new, modify the servlet.properties file under /domino/data to add an alias or whatever needed.
Post a Comment

Disclaimer: The information in this weblog is provided "AS IS" with no warranties whatsoever, and confers no rights to any institution/person/organization. These are my personal thoughts and ideas. When I am inspired by others I give credit, I do not assume other's work and efforts. This site is NOT supported, approved, blessed etc. by Lotus Software and/or IBM Corporation.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 License.