1 package dolda.jsvc.j2ee;
4 import java.lang.reflect.*;
7 import javax.servlet.http.*;
8 import javax.servlet.*;
10 public class Servlet extends HttpServlet {
11 private ThreadContext tg;
13 public void init(ServletConfig cfg) throws ServletException {
14 Properties sprop = new Properties();
16 InputStream pi = Servlet.class.getClassLoader().getResourceAsStream("jsvc.properties");
22 } catch(IOException e) {
25 String clnm = (String)sprop.get("jsvc.bootstrap");
27 throw(new ServletException("No JSvc bootstrapper specified"));
30 bc = Class.forName(clnm);
31 } catch(ClassNotFoundException e) {
32 throw(new ServletException("Invalid JSvc bootstrapper specified", e));
34 tg = new ThreadContext(null, "JSvc service", J2eeContext.create(cfg), bc);
37 public void destroy() {
41 public void service(HttpServletRequest req, HttpServletResponse resp) {
43 req.setCharacterEncoding("UTF-8");
44 resp.setCharacterEncoding("UTF-8");
45 } catch(UnsupportedEncodingException e) {
48 Request rr = new J2eeRequest(getServletConfig(), req, resp);
49 RequestThread w = tg.respond(rr);
53 } catch(InterruptedException e) {