JSP model 2 architecture question


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: JSP model 2 architecture question

Hybrid View

  1. #1
    Kit Mendelson Guest

    JSP model 2 architecture question


    The project I am working on has implemented the JSP model 2 architecture
    and we are now grappling with a vexing issue related to it.
    We use a central "controller" servlet to handle all incoming
    requests and route them to the appropriate JSP (using
    RequestDispatcher.forward()) based on the session context and the form
    data submitted with each request. (We are running on WebLogic Server 5.1
    and using the WLS plug-in on the iPlanet Web Server)

    However, this means that from the web server's (and browser's) point of
    view, every page of our application has the same URI (e.g. "/XYZ").
    The problem is that our web server log is used to generate
    usage reports, but there's no page-level usage being recorded for the app.
    since all entries in the log simply point to /XYZ.

    We've looked at "URL re-writing" but that doesn't help since it relies
    on embedding the re-written URL in the links in the page body and we
    don't know the final destination of any given link until it's been
    processed by the controller servlet. We need a way for a given JSP to
    somehow "set" it's URI (e.g. "/XYZ?pageID=x.jsp") as part of the *response*
    that's sent to the browser so that it can be tracked (if that's even
    possible) at the web server. We haven't been able to find a solution
    running general searches on the Web and were wondering if anybody here has
    run into this issue, and if so what, if anything, you figured out to do
    about it.

    TIA
    -Kit

  2. #2
    Ruchi Dhar Guest

    Re: JSP model 2 architecture question


    Since forward is internal to the servlet engine the client doesn't know what
    happened after the request. The webserver log doesn't tell you anything
    regarding the forwards. The only way is before forwarding to any page log
    into the logfile. Its again difficult to write into the same log where IIS
    is wring the log because of the locks. You have to maintain your own logFile
    for all the requests and even for the servlets etc and in this case before
    forwarding to the jsp you can write log to the logFile.

    "Kit Mendelson" <christopher_mendelson@fanniemae.com> wrote:
    >
    >The project I am working on has implemented the JSP model 2 architecture
    >and we are now grappling with a vexing issue related to it.
    >We use a central "controller" servlet to handle all incoming
    >requests and route them to the appropriate JSP (using
    >RequestDispatcher.forward()) based on the session context and the form
    >data submitted with each request. (We are running on WebLogic Server 5.1
    >and using the WLS plug-in on the iPlanet Web Server)
    >
    >However, this means that from the web server's (and browser's) point of
    >view, every page of our application has the same URI (e.g. "/XYZ").
    >The problem is that our web server log is used to generate
    >usage reports, but there's no page-level usage being recorded for the app.
    >since all entries in the log simply point to /XYZ.
    >
    >We've looked at "URL re-writing" but that doesn't help since it relies
    >on embedding the re-written URL in the links in the page body and we
    >don't know the final destination of any given link until it's been
    >processed by the controller servlet. We need a way for a given JSP to
    >somehow "set" it's URI (e.g. "/XYZ?pageID=x.jsp") as part of the *response*
    >that's sent to the browser so that it can be tracked (if that's even
    >possible) at the web server. We haven't been able to find a solution
    >running general searches on the Web and were wondering if anybody here has
    >run into this issue, and if so what, if anything, you figured out to do


    >about it.
    >
    >TIA
    >-Kit



  3. #3
    Erik Pearson Guest

    Re: JSP model 2 architecture question


    I'd suggest embedding information about intended target _context_ instead
    of the actual destination page. After all, the destination is dynamic based
    on incoming data, but the action taking place on the server to arrive at
    the destination page is predictable as the action takes place. This context
    informatoin could follow a similar paradigm as the Action or Command design
    pattern in the famed GOF book. One would argue that this is more valid information
    to capture than the resulting jsps anyways.

    This information could easily be passed as path info so as to be indiscernable
    from any web server logging requests before passing off to the application
    server.

    Examples:
    /controller/changePrefs as opposed to /controller?pg=userPrefs.jsp
    /controller/logout as opposed to /controller?pg=login.jsp
    /controller/submitQuery as opposed to /controller?pg=queryResults.jsp

    $0.02 -- Erik


    "Kit Mendelson" <christopher_mendelson@fanniemae.com> wrote:
    >
    >The project I am working on has implemented the JSP model 2 architecture
    >and we are now grappling with a vexing issue related to it.
    >We use a central "controller" servlet to handle all incoming
    >requests and route them to the appropriate JSP (using
    >RequestDispatcher.forward()) based on the session context and the form
    >data submitted with each request. (We are running on WebLogic Server 5.1
    >and using the WLS plug-in on the iPlanet Web Server)
    >
    >However, this means that from the web server's (and browser's) point of
    >view, every page of our application has the same URI (e.g. "/XYZ").
    >The problem is that our web server log is used to generate
    >usage reports, but there's no page-level usage being recorded for the app.
    >since all entries in the log simply point to /XYZ.
    >
    >We've looked at "URL re-writing" but that doesn't help since it relies
    >on embedding the re-written URL in the links in the page body and we
    >don't know the final destination of any given link until it's been
    >processed by the controller servlet. We need a way for a given JSP to
    >somehow "set" it's URI (e.g. "/XYZ?pageID=x.jsp") as part of the *response*
    >that's sent to the browser so that it can be tracked (if that's even
    >possible) at the web server. We haven't been able to find a solution
    >running general searches on the Web and were wondering if anybody here has
    >run into this issue, and if so what, if anything, you figured out to do


    >about it.
    >
    >TIA
    >-Kit



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center