protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{	
		if (active(request)) //if there is an active user
		{
			if (request.getRequestURI().equals(request.getContextPath() + "/blabs")) //if there is no string after blabs/
			{					
				//current user blab feed (following and own blabs)

				List<Blab> blabs = (List<Blab>)blabMain.getFeed(user.getEmail());
				
				if (blabs.size() == 0)
					request.setAttribute("noMessages", "You have no blabs to display");
				
				request.setAttribute("pageTitle", "Blab Feed");
				request.getSession().setAttribute("blabs", blabs);
				request.setAttribute("list", true);
				request.getRequestDispatcher("/blabs.jsp").forward(request, response);
				return;
			}
			else //if there is a string after blabs/
			{
				//find the last occurrence of /
				int last = request.getRequestURI().lastIndexOf('/');
				String uri = request.getRequestURI().substring(last + 1);
				
				try //parse the uri string into an integer
				{					
					int id = Integer.parseInt(uri);
					
					//single blab
					
					Blab blab = blabMain.getBlab(id);
					
					if (blab.getContent() == null) //if this blab does not exist
					{
						request.getRequestDispatcher("/404.jsp").forward(request, response);
						return;
					}
					
					request.getSession().setAttribute("blabs", blab);
					request.setAttribute("list", false);
					request.setAttribute("pageTitle", "Blab: #" + uri);
					request.getRequestDispatcher("/blabs.jsp").forward(request, response);
				}
				catch (NumberFormatException nfe) //the uri parsed is actually a string
				{										
					//blabs for a specific user
					
					ProfileMain profileMain = new ProfileMain();
					profileMain.setDataSource(dataSource);
					String email = profileMain.getEmail(uri);
					
					if ((profileMain.getUser(email)).getUsername() == null) //if the user does not exist
					{
						request.getRequestDispatcher("/404.jsp").forward(request, response);
						return;
					}

					List<Blab> blabs = blabMain.getBlabs(email);
					
					if (blabs.size() == 0) //if this user has not blabbed yet
						request.setAttribute("noMessages", "This user has not blabbed yet");
					
					request.getSession().setAttribute("blabs", blabs);
					request.setAttribute("list", true);
					request.setAttribute("pageTitle", "Blabs by: @" + uri);
					request.getRequestDispatcher("/blabs.jsp").forward(request, response);
				}
				
				return;
			}
		}
		else
		{
			response.sendRedirect(request.getContextPath() + "/login"); //must be logged in to blab
			return;
		}
	}