public ModelAndView PostURIParser(HttpServletRequest request, HttpServletResponse response)
    {
        String URI = request.getRequestURI();
        ModelAndView MAV = null;
        Matcher match = this.P.matcher(URI);//threads
        Matcher match2 = this.P2.matcher(URI);//create
        Matcher match3 = this.P3.matcher(URI);//thread by name
        Matcher match4 = this.P4.matcher(URI);//thread by ID
        Matcher match8 = this.P8.matcher(URI);
        Matcher match7 = this.P7.matcher(URI);
        Matcher match9 = this.P9.matcher(URI);
        Matcher match10 = this.P10.matcher(URI);
        Matcher match11 = this.P11.matcher(URI);
        Matcher match12 = this.P12.matcher(URI);
//        P9 = Pattern.compile("(/threads/)(/viewAll/)(edit)");
//        private static final Pattern P10 = Pattern.compile("(/threads/)([0-9]+)(/edit)");///thread/${thread.threadID}/edit
//        private static final Pattern P11 = Pattern.compile("(/threads/)([0-9]+)(/post/)([0-9]+)(/edit)");
        if(match12.find())
        {
            int threadID = Integer.parseInt(match12.group(2));
            MAV = ppc.removePost(threadID);
        }
        else if(match11.find())
        {
            int threadID = Integer.parseInt(match11.group(2));
            int postID = Integer.parseInt(match11.group(4));
            MAV = ppc.editPost(threadID, postID);
        }
        else if(match10.find())
        {
            int threadID = Integer.parseInt(match10.group(2));
            MAV = tpc.editThread(threadID);
        }
        else if(match9.find())
        {
            MAV = tpc.deleteThread();
        }
        else if(match7.find())
        {
            int threadID = Integer.parseInt(match7.group(2));
            int postID = Integer.parseInt(match7.group(4));
            MAV = ppc.addComment(threadID, postID);
        }

        else if(match8.find())
        {
            int ID = Integer.parseInt(match8.group(2));
            MAV = ppc.createPost(ID);
        }
        else if(match2.find())
        {
            MAV = tpc.createThread();
        }
        else if(match4.find())
        {

            int ID = Integer.parseInt(match4.group(2));
            MAV = threadGet.getThread(ID);
        }
        return MAV;
    }