Navigation Menu

Skip to content

Commit

Permalink
Ignore empty path info.
Browse files Browse the repository at this point in the history
  • Loading branch information
alesj committed Jun 13, 2011
1 parent 19c4100 commit d58728c
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -32,11 +32,16 @@ public class RemoteClient extends HttpServlet
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
// TODO -- who's actually issuing empty path request?
String pathInfo = req.getPathInfo();
if (pathInfo == null)
return;

try
{
RequestContext requestContext = getActiveContext(beanManager, RequestContext.class);
Bean<KleinStadt> stadtBean = Utils.getBean(beanManager, KleinStadt.class);
if (req.getPathInfo().equals("/request1"))
if (pathInfo.equals("/request1"))
{
assertNotNull("Expected a bean for stateful session bean Kassel", stadtBean);
CreationalContext<KleinStadt> creationalContext = beanManager.createCreationalContext(stadtBean);
Expand All @@ -46,7 +51,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
assertTrue("Expected SFSB bean to be destroyed", frankfurt.isKleinStadtDestroyed());
return;
}
else if (req.getPathInfo().equals("/request2"))
else if (pathInfo.equals("/request2"))
{
KleinStadt kassel = requestContext.get(stadtBean);
assertNull("SFSB bean should not exist after being destroyed", kassel);
Expand Down

0 comments on commit d58728c

Please sign in to comment.