API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.server.impl.webapp. JOTWebappRequestProcessor View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.jot.web.server.impl.webapp;

import java.net.Socket;
import java.util.Hashtable;
import net.jot.web.server.JOTServerRequestHandler;
import net.jot.utils.JOTUtilities;
import net.jot.web.server.impl.JOTStaticServerHandler;
import net.jottools.actions.ConfigView;

/**
 * Impl. to handle a request processing.
 * There will be one inctance of this per request/thread
 * @author thibautc
 */
public class JOTWebappRequestProcessor extends JOTStaticServerHandler implements JOTServerRequestHandler{

    public void handle(Socket socket) throws Exception
    {
        super.handle(socket);
    }

    private ConfigView getViewClass(String path)
    {
        Object view = null;
        try
        {
            if (path.startsWith("/"))
            {
                path = path.substring(1, path.length());
            }
            if (path.length() == 0)
            {
                path = "home";
            }
            Class c = Class.forName("net.jottools.actions.Config" + JOTUtilities.upperFirst(path.toLowerCase()));
            if (c != null)
            {
                view = c.newInstance();
                if (!(view instanceof ConfigView))
                {
                    view = null;
                }
            }
        } catch (Exception e)
        {
            e.printStackTrace();
            view = null;
        }
        return (ConfigView) view;
    }

    public void init(Hashtable params)
    {
    }
}

Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar