Application deployment using Server-Side Knopflerfish

132 views Asked by At

I have written a simple web application in java. There is a button in the index.jsp page when clicked, a method from a jar file called which print something. The index.jsp is like this:

<html>
  <head>
    <title></title>
  </head>
  <body>
    <form action="indexServlet.do">
      <input type="submit" value="Click me!"/>
    </form>
  </body>
</html>

My IndexServlet is like this:

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class IndexServlet extends HttpServlet {
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.getWriter().println(Test.getMessage());
    }
}

I want to run the program with Apache Tomcat and change the Test.jar when the program is running, I want to change the method getMessage() in Test.jar. How can I do this with Knopflerfish OSGi? I mean replace Test.jar with another jar file, Test.jar, but getMessage() in new Test.jar file print something else.

There is an article OSGi Web application development with Server-Side Equinox but it is not in knopflerfish.

0

There are 0 answers