[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] How to use JSPs with HTTP Whiteboard?


I am trying to use org.eclipse.equinox.jsp.jasper.JspServlet fromÂorg.eclipse.equinox.jsp.jasper together with the HTTP Whiteboard.

Currently I am attempting to register a JspServlet instance with Declarative Services like this:

  service = Servlet.class,
  property = {
public class GreeterForm extends JspServlet {
  private GreeterManager greeters;

  public GreeterForm() {
    super(FrameworkUtil.getBundle(GreeterForm.class), "/");

  public void setGreeterManager(GreeterManager greeters) {
    this.greeters = greeters;

  public void init(ServletConfig config) throws ServletException {
    config.getServletContext().setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());

  public void service(ServletRequest req, ServletResponse res) throws IOException, ServletException {
    req.setAttribute("greeters", greeters);
    super.service(req, res);

My bundle requires both a bundle that provides the JSTL API and one that provides the JSTL implementation.
There is an "/index.jsp" in the bundle root that uses some tags from JSTL.

The goal is to use OSGi services in a JSP. However the JspServlet crashes in a variety of ways, which I gave up trying to fix.

Is there a standard way to combine HTTP Whiteboard and JSPs?
Moreover does the JSP support require other parts of Tomcat? Notice for example the init() method.

Thanks in advance,