Code example for StringTokenizer

Methods: hasMoreElementsnextToken

0
            RequestDispatcher dispatcher = request.getRequestDispatcher(pathInContext + "/");
            dispatcher.forward(request,response);
        } 
        else 
        { 
            StringTokenizer strtok = new StringTokenizer(pathInfo,"/");
             
            String who = null;
            boolean isPhoto = false;
            int action = __ACTION_NONE;
             
            if (strtok.hasMoreElements())
            { 
                String tmp = strtok.nextToken();
                 
                if ("photo".equalsIgnoreCase(tmp))
                    isPhoto = true;
                else 
                    who = tmp;
            } 
             
            if (who == null && strtok.hasMoreElements())
            { 
                who = strtok.nextToken();
            } 
 
            String tmp = request.getParameter(__ACTION_PARAM);
            action = (tmp == null?__ACTION_NONE:Integer.parseInt(tmp.trim()));
           
Stop searching for code, let great code find you!  Add Codota to your java IDE