Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#988 closed enhancement (fixed)

Add support for servlets in extensions

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

Description (last modified by Nicklas Nordborg)

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 Tomcat, most 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 (4)

comment:1 by Nicklas Nordborg, 16 years ago

Description: modified (diff)
Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 16 years ago

(In [4221]) References #988: Add support for servlets in extensions

The main feature is now working.

comment:3 by Nicklas Nordborg, 16 years ago

Resolution: fixed
Status: assignedclosed

comment:4 by Nicklas Nordborg, 16 years ago

(In [4276]) References #988: Add support for servlets in extensions

Fixed compilation error in JSP page resulting from changes in [4221].

Note: See TracTickets for help on using tickets.