System.out.println("tokens.size= " + tokens.length); for (int i = 0; i < tokens.length; i++) { System.out.println("   tokens[" + i + "]: " + tokens[i]); }
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {		HttpServletRequest request = (HttpServletRequest) req;        HttpServletResponse response = (HttpServletResponse) res;                String uri = request.getRequestURI();                if(!StringUtils.contains(uri, "/exames")){        	chain.doFilter(request, response);        	return;        }                String context = request.getContextPath();        String newURI = uri.replaceFirst(app, "");        String[] tokens = newURI.split("/");                StringBuffer forwardURI = new StringBuffer(context);                if(tokens.length >= 2 && !(tokens[1].equalsIgnoreCase("exames"))){        	forwardURI.append(notFoundURI);        }        else{	        	        if(tokens.length == 2){	        	String degreeCode = tokens[tokens.length - 2];	        	Integer degreeId;                try {                    degreeId = getDegreeId(degreeCode);                } catch (FenixServiceException e) {                    throw new ServletException(e);                }                if(degreeId != null){		        	forwardURI.append(forwardExamsList);		        	forwardURI.append("&degreeID=");		        	forwardURI.append(degreeId);		        } else {		        	forwardURI.append(notFoundURI);		        }	        } else {	        	forwardURI.append(notFoundURI);	        }	                }        response.sendRedirect(forwardURI.toString());	}