response.setContentType("text/html");
	public void doGet(HttpServletRequest request, HttpServletResponse response)			throws IOException, ServletException	{		response.setContentType("text/html");		String pathInfo = request.getPathInfo();		String queryString = request.getQueryString();		String pathTranslated = request.getPathTranslated();		String requestURI = request.getRequestURI();		String requestURL = request.getRequestURL().toString();		// contextPath := "/jGallery"		String contextPath = request.getContextPath();		String servletPath = request.getServletPath();		String nocount = request.getParameter("nocount");		boolean doCount = (!"true".equals(nocount));		// servletPath := "/galleries" with path mapping		// servletPath= "/testalbum/CRW_9753.html" with ext mapping		// /myfolder/subfolder/myimage.html		// gets split into /myfolder/subfolder/ (which is used as key for the		// Folder object)		// and imageName myimage.html		String folderPath = servletPath.substring(0, servletPath				.lastIndexOf('/') + 1);		String imageName = servletPath				.substring(servletPath.lastIndexOf('/') + 1);		urlExtention = imageName.substring(imageName.lastIndexOf('.') + 1);		// getServletContext().log("folderPath: "+folderPath);		String folderRealPath = null;		String forward = null;		Folder folder = getFolder(request.getSession(), folderPath);		try		{			if (null == folder)			{				RealPath theRealPath = PathHelper.getHttpRealPath(						getServletContext(), folderPath, dirmapping);				if (null == theRealPath)				{					response.sendError(HttpServletResponse.SC_NOT_FOUND,							request.getRequestURI());					return;				}				folderRealPath = theRealPath.getRealPath();				String imagePath = folderPath;				if (contextPath.substring(1).equals(theRealPath.getContext()))				{					// special case for image folders below jGallery's context					imagePath = contextPath + folderPath;				}				folder = createFolder(request.getSession(), folderPath,						imagePath, folderRealPath, contextPath, doCount);				folder.loadFolder();			}			int n = folder.setFileName(imageName);			if (Folder.INDEX == n)			{				forward = folder.getIndexJsp();			}			else			{				forward = folder.getSlideJsp();			}			request.setAttribute("folder", folder);			request.setAttribute("image", folder.getImage());		}		catch (GalleryNotFoundException e)		{			response.sendError(HttpServletResponse.SC_NOT_FOUND, request					.getRequestURI());			return;		}		catch (GalleryException e)		{			throw new ServletException(e.getMessage());			//            request.setAttribute("javax.servlet.error.exception",e);			//          forward = "/errorpage.jsp";		}		RequestDispatcher requestDispatcher = getServletContext()				.getRequestDispatcher(forward);		requestDispatcher.forward(request, response);	}