You could try request.getRequestURI() though I'm not sure that would be good practice. If your two pages are actually doing different things then, from an application design point of view, it makes more sense to have two separate actions, e.g. (very generally) page1.jsp?action=page1_submit and page2.jsp?action=page2_submit. That way you don't need to worry about which page generated the request. You'd just use request.getParameter("action") and then forward appropriately according to the action.