@Override
	public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
		HttpServletRequest request = (HttpServletRequest) req;
		String path = request.getRequestURI();
		boolean go = false;
		String fbdW = PropertiesGetter.getProperty("urlConverter.shorten.forbiddenwords");
		String[] forbiddenW = fbdW.split(";");
		for (int i = 0; i < forbiddenW.length; i++) {
			if (path.contains(forbiddenW[i])) {
				go = true;
				break;
			}
		}
		if (go == true) {
			chain.doFilter(req, resp);
		} else if (path.equals("/") || path.equals("") || path == null) {
			request.getRequestDispatcher("UrlShorter.html").forward(req, resp);
		} else {
			String code = path.replaceAll("/", "");
			try {
				PersistenceManager pm = PMF.get().getPersistenceManager();
				Key key = KeyFactory.createKey(KeyFactory.createKey(TotalInformation.class.getSimpleName(), PropertiesGetter.getProperty("administation.totalInfomation.id")), UrlInformation.class.getSimpleName(), code);
				UrlInformation url = null;
				try {
					url = pm.getObjectById(UrlInformation.class, key);
				} catch (Exception e) {
				}
				HttpServletResponse response = (HttpServletResponse) resp;
				if (url != null) {
					response.sendRedirect(url.getUrl());
				} else {
					request.getRequestDispatcher("UrlShorter.html").forward(req, resp);
				}
			} catch (Exception e) {
			}
		}
	}