Opened 16 years ago

Last modified 16 years ago

#988 closed enhancement

Add support for servlets in extensions — at Initial Version

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 2.7
Component: web Version:
Keywords: Cc:

Description

This is "needed" by the MeV launcher. It currently uses the MevExport servlet. I guess it may continue to use that servlet, but since it is really part of the MeV functionality it would be better to move it out of the core.

Here is a rough plan:

  • Extension JAR files may include a META-INF/servlet.xml file that defines servlets. We can use the same tags and formats as we use in web.xml, meaning that each servlet gets a NAME mapped to a CLASS.
  • In the web client core we map *.servlet to the already existing ExtensionsServlet. This will act as a wrapper for invoking the servlets from extensions.
  • Invoking the extension servlet can be done by linking to ~/NAME.servlet where ~ is the home directory of the extension. This is usually /extensions/JARFILENAME
  • This request will be handled by the ExtensionsServlet which can extract the JARFILENAME, load the JAR, check META-INF/servlet.xml, find NAME and then create and invoke the CLASS.

Note 1. Parsing servlet.xml is probably better done when initialising the extensions system.

Note 2. In most cases servlets are reused. I don't know if this is really necessary. It may be better to create a new instance for each request. We don't have to cache instances and we don't have to worry about classloading issues if the extension JAR file is updated.

Change History (0)

Note: See TracTickets for help on using tickets.