Servlet Chaining issues in Weblogic 8.1 - Weblogic

This is a discussion on Servlet Chaining issues in Weblogic 8.1 - Weblogic ; Hi, I am observing erratic behaviour when I try to incorporate servlet chaining using RequestDispatcher in Weblogic 8.1. I have a sessionAPIServlet which works perfectly fine. I added another servlet forwardServlet which forwards the request to the sessionAPIServlet. Now, whenever ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Servlet Chaining issues in Weblogic 8.1

  1. Servlet Chaining issues in Weblogic 8.1


    Hi,
    I am observing erratic behaviour when I try to incorporate servlet chaining using
    RequestDispatcher in Weblogic 8.1. I have a sessionAPIServlet which works perfectly
    fine. I added another servlet forwardServlet which forwards the request to the
    sessionAPIServlet. Now, whenever I call the sessionAPIServlet, the forwardServlet
    gets invoked. The URL displays sessionAPIServlet but the forwardServlet gets invoked.
    I figured this by adding debug statements in the forwardServlet. When the forwardServlet
    is invoked, it works fine. The behaviour is as expected.

    I have added couple of more servlets to the same WAR deployable file(along with
    forwardServlet) which work fine standalone. When any of these servlets are invoked,
    I find that forwardServlet gets invoked instead of the called servlet.

    I noticed some anamolies in the Weblogic administration console. The Servlet Path
    for all servlets except the forwardServlet is displayed as n/a.

    I am attaching the deployable WAR file to the post. Any inputs on the issues faced
    is appreciated.

    Thanks,
    Balaji

  2. Re: Servlet Chaining issues in Weblogic 8.1


    Sorry bout the missing attached. I am entering the servlet and descriptor used
    in my application. Kindly send me a mail and I will send you the deployable file
    used.
    The forwardServlet
    ---------------------
    public class forwardServlet extends HttpServlet {

    public void service(HttpServletRequest req,HttpServletResponse res)
    throws ServletException,IOException
    {
    ServletContext sc = getServletConfig().getServletContext();
    RequestDispatcher rd =sc.getNamedDispatcher("sessionAPIServlet");
    rd.forward(req,res);

    }
    }
    The web.xml decriptior file
    -----------------------------
    "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

    Examples Web Application

    js2
    Servlet.js2

    parameter1
    735



    js2
    /Servlet/*


    games
    Servlet.games

    game1
    FirstGame


    game2
    SecondGame


    game3
    ThirdGame



    games
    /Servlet/*


    rewriteURL
    Servlet.rewriteURL


    rewriteURL
    /Servlet/*


    cookiesServlet
    Servlet.cookiesServlet


    cookiesServlet
    /Servlet/*


    sessionAPIServlet
    Servlet.sessionAPIServlet


    sessionAPIServlet
    /Servlet/*


    forwardServlet
    Servlet.forwardServlet


    forwardServlet
    /Servlet/*




    "Balaji" wrote:
    >
    >Hi,
    >I am observing erratic behaviour when I try to incorporate servlet chaining
    >using
    >RequestDispatcher in Weblogic 8.1. I have a sessionAPIServlet which works
    >perfectly
    >fine. I added another servlet forwardServlet which forwards the request
    >to the
    >sessionAPIServlet. Now, whenever I call the sessionAPIServlet, the forwardServlet
    >gets invoked. The URL displays sessionAPIServlet but the forwardServlet
    >gets invoked.
    >I figured this by adding debug statements in the forwardServlet. When
    >the forwardServlet
    >is invoked, it works fine. The behaviour is as expected.
    >
    >I have added couple of more servlets to the same WAR deployable file(along
    >with
    >forwardServlet) which work fine standalone. When any of these servlets
    >are invoked,
    >I find that forwardServlet gets invoked instead of the called servlet.
    >
    >I noticed some anamolies in the Weblogic administration console. The
    >Servlet Path
    >for all servlets except the forwardServlet is displayed as n/a.
    >
    >I am attaching the deployable WAR file to the post. Any inputs on the
    >issues faced
    >is appreciated.
    >
    >Thanks,
    >Balaji



  3. Re: Servlet Chaining issues in Weblogic 8.1

    The servlet-mappings in your web.xml are wrong. The url-patterns must be
    unique. All of the servlets have been mapped to "/Servlet/*". So the
    last one being mapped will win. Rest of them will never be invoked.

    --Vinod.


    Balaji wrote:
    > Sorry bout the missing attached. I am entering the servlet and descriptor used
    > in my application. Kindly send me a mail and I will send you the deployable file
    > used.
    > The forwardServlet
    > ---------------------
    > public class forwardServlet extends HttpServlet {
    >
    > public void service(HttpServletRequest req,HttpServletResponse res)
    > throws ServletException,IOException
    > {
    > ServletContext sc = getServletConfig().getServletContext();
    > RequestDispatcher rd =sc.getNamedDispatcher("sessionAPIServlet");
    > rd.forward(req,res);
    >
    > }
    > }
    > The web.xml decriptior file
    > -----------------------------
    > > "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    >
    > Examples Web Application
    >
    > js2
    > Servlet.js2
    >
    > parameter1
    > 735
    >

    >

    >
    > js2
    > /Servlet/*
    >

    >
    > games
    > Servlet.games
    >
    > game1
    > FirstGame
    >

    >
    > game2
    > SecondGame
    >

    >
    > game3
    > ThirdGame
    >

    >

    >
    > games
    > /Servlet/*
    >

    >
    > rewriteURL
    > Servlet.rewriteURL
    >

    >
    > rewriteURL
    > /Servlet/*
    >

    >
    > cookiesServlet
    > Servlet.cookiesServlet
    >

    >
    > cookiesServlet
    > /Servlet/*
    >

    >
    > sessionAPIServlet
    > Servlet.sessionAPIServlet
    >

    >
    > sessionAPIServlet
    > /Servlet/*
    >

    >
    > forwardServlet
    > Servlet.forwardServlet
    >

    >
    > forwardServlet
    > /Servlet/*
    >

    >

    >
    >
    > "Balaji" wrote:
    >
    >>Hi,
    >>I am observing erratic behaviour when I try to incorporate servlet chaining
    >>using
    >>RequestDispatcher in Weblogic 8.1. I have a sessionAPIServlet which works
    >>perfectly
    >>fine. I added another servlet forwardServlet which forwards the request
    >>to the
    >>sessionAPIServlet. Now, whenever I call the sessionAPIServlet, the forwardServlet
    >>gets invoked. The URL displays sessionAPIServlet but the forwardServlet
    >>gets invoked.
    >>I figured this by adding debug statements in the forwardServlet. When
    >>the forwardServlet
    >>is invoked, it works fine. The behaviour is as expected.
    >>
    >>I have added couple of more servlets to the same WAR deployable file(along
    >>with
    >>forwardServlet) which work fine standalone. When any of these servlets
    >>are invoked,
    >>I find that forwardServlet gets invoked instead of the called servlet.
    >>
    >>I noticed some anamolies in the Weblogic administration console. The
    >>Servlet Path
    >>for all servlets except the forwardServlet is displayed as n/a.
    >>
    >>I am attaching the deployable WAR file to the post. Any inputs on the
    >>issues faced
    >>is appreciated.
    >>
    >>Thanks,
    >>Balaji

    >
    >



+ Reply to Thread