Can WebLogic do Servlet chaining?

Is there any way to do servlet chaining, or more specifically, for a servlet
          to process the output of another servlet efficiently in WebLogic?
          Sure a servlet can make another HTTP request on its own servlet engine but
          that seems way too inefficient and heavy handed.
          J.
          James Strachan
          =============
          email: [email protected]
          web: http://www.metastuff.com
          

Check out XSPs from cocoon. xml.apache.org
          -- bk
          James Strachan wrote:
          > JSP includes go straight to the HTTP response - there's no way of
          > redirecting them to some internal buffer for post processing. (*)
          >
          > I'd like to be able to do simple Servlet chaining at the Servlet or JSP
          > level. i.e. I want to post process the output of one servlet / JSP page to
          > do things like caching or XSL styling. This is a totally reasonable request
          > IMHO. Imagine a complex portal with alot of included JSP files - I'd like to
          > be able to cache whole chunks of the page - a chunk may have many includes
          > inside it..
          >
          > Right now there is no way of doing such a thing in WebLogic AFAIK. You have
          > to go through every JSP file and add caching / styling to it rather than
          > being able to 'pipeline' or 'servlet chain' which is less than ideal. (Also
          > remember there is a 64K code size limit on the bytecode that can exist in a
          > Java class - so JSP files should be kept small to void hitting this
          > barrier). I can't quite believe noone else has hit this problem.
          >
          > There are workarounds such as to do the include using seperate internal HTTP
          > requests, RMI calls or JMS messages all of which seem to be far too
          > heavyweight.
          >
          > (*)
          > <aside>
          > One side effect of the JSP include always going straight to the response
          > means that you can't use WebLogics <cache> tag if you are using any kind of
          > JSP include. e.g. the following snippet doesn't work as expected :-
          >
          > <cache>
          > something
          > <jsp:include file="foo.jsp" flush="true"/>
          > something else
          > </cache>
          >
          > since you are not allowed to do an include inside a body tag,. Even if you
          > were the output of the include goes straight to the response, not the body
          > tag.
          >
          > So you have to close and reopen the cache tags around each include which may
          > break your XML complience for complex pages and is error prone and much more
          > inefficent to boot:-
          >
          > <cache>
          > something
          > </cache>
          > <jsp:include file="foo.jsp" flush="true"/>
          > <cache>
          > something else
          > </cache>
          >
          > </aside>
          >
          > --
          > J.
          >
          > James Strachan
          > =============
          > email: [email protected]
          > web: http://www.metastuff.com
          >
          > "Jaggu Dada" <[email protected]> wrote in message
          > news:[email protected]...
          > >
          > > Hi --
          > >
          > > Why not use JSP includes? The only servlet "chaining" that is
          > > reasonable
          > > is to use a servlet to process an initial request, and make some
          > > decision
          > > (based on the querystr, for example) then, without having written
          > > anything
          > > back to the client, do a server side redirect (with RequestDispatcher)
          > > to
          > > a servlet or JSP that does some work. If I understand you correctly,
          > > servlets
          > > were not designed to do what you are proposing.
          > >
          > > Hope this helps,
          > >
          > > -jaggu
          > >
          > > James Strachan wrote:
          > > >
          > > > Hi Joe
          > > >
          > > > Thanks for that. Sure that would work too though its probably a heavier
          > > > weight than just plain old HTTP.
          > > >
          > > > I was looking for something a little more lightweight such that I could
          > > > include 10-20 servlet chains per web page on a complex portal without
          > too
          > > > much performance hit. i.e. using synchronous servlet 'pipelining' to
          > > > generate complex pages without having to do many internal HTTP / JMS
          > > > requests.
          > > >
          > > > --
          > > > J.
          > > >
          > > > James Strachan
          > > > =============
          > > > email: [email protected]
          > > > web: http://www.metastuff.com
          > > >
          > > > "Joe Trung" <[email protected]> wrote in message
          > > > news:[email protected]...
          > > > >
          > > > > Hi Jim,
          > > > > I chain my servlets via jms: the queue is output/input bin
          > > > >
          > > > > Joe
          > > > >
          > > > >
          > > > > "James Strachan" <[email protected]> wrote:
          > > > > >Is there any way to do servlet chaining, or more specifically, for a
          > > > servlet
          > > > > >to process the output of another servlet efficiently in WebLogic?
          > > > > >
          > > > > >Sure a servlet can make another HTTP request on its own servlet
          > engine
          > > > but
          > > > > >that seems way too inefficient and heavy handed.
          > > > > >
          > > > > >J.
          > > > > >
          > > > > >James Strachan
          > > > > >=============
          > > > > >email: [email protected]
          > > > > >web: http://www.metastuff.com
          > > > > >
          > > > > >
          > > > > >
          > > > >
          

Similar Messages

  • Does weblogic server have Servlet chaining concept?

    I saw JRun which has the servlet chaining function. Does anyone know how to
              do it in the weblogic server?
              Thank you.
              li
              

    WLS does not support Servlet Chaining
              Kumar
              li wrote:
              > I saw JRun which has the servlet chaining function. Does anyone know how to
              > do it in the weblogic server?
              >
              > Thank you.
              >
              > li
              

  • Servlet chaining problem..

    import java.io.*;
        import javax.servlet.*;
        import javax.servlet.http.*;
        public class Deblink extends HttpServlet {
          public void doGet(HttpServletRequest req, HttpServletResponse res)
                                       throws ServletException, IOException {
            String contentType = req.getContentType();  // get the incoming type
            if (contentType == null) return;  // nothing incoming, nothing to do
            res.setContentType(contentType);  // set outgoing type to be incoming type
            PrintWriter out = res.getWriter();
            BufferedReader in = req.getReader();
            String line = null;
            while ((line = in.readLine()) != null) {
              line = replace(line, "<BLINK>", "");
              line = replace(line, "</BLINK>", "");
              out.println(line);
          public void doPost(HttpServletRequest req, HttpServletResponse res)
                                        throws ServletException, IOException {
            doGet(req, res);
          private String replace(String line, String oldString, String newString) {
            int index = 0;
            while ((index = line.indexOf(oldString, index)) >= 0) {
              // Replace the old string with the new string (inefficiently)
              line = line.substring(0, index) +
                     newString +
                     line.substring(index + oldString.length());
              index += newString.length();
            return line;
    What is pre request fo above code to work.
    I had tried this many time but it is not working, what will be calling servlet look like

    And can you explain why your title is "Servlet chaining problem"?

  • Servlet Chaining and OAS 4.0.8.1

    I am using the Request Dispatcher Concept for my application where a servlet either initiates a bean or calls another servlet. I believe I cannot test it from JDeveloper.But does OAS 4.0.8.1 support servlet chaining. Very Critical. if yes? Please let me know where I can find the necessary documentation.
    Thanks

    More info ...
    I enable logging and found the following error
    Unable to initiate threads: cannot find class java/lang/Thread.

  • Can I register servlet dynamically?

    Hi,
    As weblogic docs saying, I have to set an entry in weblogic.properties
    to register servlet. Can I register servlet dynamically in weblogic
    console? Or is there another way to do this?
    Thanks very much for your help.
    Kevin
    [email protected]

    Clarification, however you can only do this from the Console. There does not
    appear to be a public API for this. :(
    Will file an issue on this.
    Cheers
    Mark G
    Mark Griffith wrote:
    Yes, Coming in 4.5. Very very soon.
    Cheers
    Mark G.
    Kevin Luo wrote:
    Hi,
    As weblogic docs saying, I have to set an entry in weblogic.properties
    to register servlet. Can I register servlet dynamically in weblogic
    console? Or is there another way to do this?
    Thanks very much for your help.
    Kevin
    [email protected]
    =====================================================
    Reply to the newsgroup. Don't reply to this mail
    alias. This is used only for answering posts on
    WebLogic Newsgroups.
    =====================================================--
    =====================================================
    Reply to the newsgroup. Don't reply to this mail
    alias. This is used only for answering posts on
    WebLogic Newsgroups.
    =====================================================

  • How to Configure a Servlet Chain Using MIME Types with weblogic5.1?

    Hi ,
              I want to configure a servlet(cocoon) in weblogic 5.1 such that the
              servlet so configured is invoked each
              time a response with the mime-type "text/xml" is generated.
              1.) will weblogic support to configure a servlet with a particular
              mime-type so that it post-process any
              servlet's response with the corresponding mime-type?
              2.) if not what is the alternative?
              Thanks
              sumanth
              [sumo.vcf]
              

    We suggest that use the request dispatcher interface instead. Servlet
              chaining is not a standard's based possibility.
              Michael Girdley
              WLS Product Manager
              Sumanth Chinthagunta <[email protected]> wrote in message
              news:[email protected]..
              > Hi ,
              > I want to configure a servlet(cocoon) in weblogic 5.1 such that the
              > servlet so configured is invoked each
              > time a response with the mime-type "text/xml" is generated.
              > 1.) will weblogic support to configure a servlet with a particular
              > mime-type so that it post-process any
              > servlet's response with the corresponding mime-type?
              > 2.) if not what is the alternative?
              >
              > Thanks
              > sumanth
              >
              

  • Is servlet chaining (filtering) supported?

    For a given virtual name I would like to set up a chain of servlets
              (ProducerServlet, ConsumerServlet) so that the ServletInputStream of the
              ConsumerServlet contains the results of the ServletOutputStream of the
              ProducerServlet. The ConsumerServlet is in effect 'filtering' the results
              of ProducerServlet.
              eg. BrowserRequest --> ProducerServlet --> ConsumerServlet -->
              BrowserResponse
              Can this be done with WLS 5.1?
              The RequestDispatcher interface does not seem to satisfy these requirements?
              If I understand this interface correctly, it allows requests to be either
              'forwarded' (where the output of the forwarder is not used) or 'included'
              (where the included servlet inserts output in the stream). But it does not
              allow servlets to be connected in a producer-consumer chain.
              Am I missing something?
              Thank you.
              Marko.
              

    Is there any way to achieve the same effect within the current spec?
              Marko.
              Winston Koh <[email protected]> wrote in message
              news:[email protected]...
              > Hey Marko, servlet chaining is not supported in WLS since its a
              proprietary
              > mechanism not specified in the current servlet/jsp specs
              >
              > thanx
              >
              > Winston
              > Marko Milicevic <[email protected]> wrote in message
              > news:[email protected]...
              > > For a given virtual name I would like to set up a chain of servlets
              > > (ProducerServlet, ConsumerServlet) so that the ServletInputStream of the
              > > ConsumerServlet contains the results of the ServletOutputStream of the
              > > ProducerServlet. The ConsumerServlet is in effect 'filtering' the
              results
              > > of ProducerServlet.
              > >
              > > eg. BrowserRequest --> ProducerServlet --> ConsumerServlet -->
              > > BrowserResponse
              > >
              > > Can this be done with WLS 5.1?
              > >
              > > The RequestDispatcher interface does not seem to satisfy these
              > requirements?
              > > If I understand this interface correctly, it allows requests to be
              either
              > > 'forwarded' (where the output of the forwarder is not used) or
              'included'
              > > (where the included servlet inserts output in the stream). But it does
              > not
              > > allow servlets to be connected in a producer-consumer chain.
              > >
              > > Am I missing something?
              > >
              > > Thank you.
              > >
              > > Marko.
              > > .
              > >
              > >
              > >
              >
              >
              

  • How Can I Run Servlet in tomcat

    Hi My Friends
    Please can any one tell me how can I Run Servlet in tomcat using my own Virtual Directory � my ask about , what is the structure it must be make it in the hierarchy of the sub folder of Virtual Directory , and in watch folder it must be put the servlet files and there is any change it must be make it in any file of the tomcat files and so on
    Please give my full details about this thing
    And thanks

    What version of Tomcat are u using?

  • Can I compiler servlet with java compiler?

    Can I compiler servlet with java compiler?
    Here is an example of it:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class HelloWorldServlet extends HttpServlet
              protected void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException , IOException
                        response.setContentType("text/html");
                        PrintWriter out = response.getWriter();
                        StringBuffer sb = new StringBuffer();
                        sb.append("<html><body><h1>");
                        sb.append("Hello World");
                        sb.append("</h1></body></html>");
                        out.print(sb.toString());
                        out.close();
         }

    Can I compiler servlet with java compiler?
    yes.
    just include the correct jarfiles in your classpath.

  • Where i can put my servlet class in tomcat 4.1

    where i can put my servlet class in tomcat 4.1 ?

    hi,
    you have to put your serlet class file in
    Tomcat\webapps\
    Here create a directory as you wish
    then, Tomcat\webapps\your directory\WEB-INF\classes
    and you have to copy web.xml to WEB-INF directoy.
    Hope this will help.
    Regards
    Sekhar

  • Error can't load Servlet org.apache.struts.action.ActionServlet

    Hi,
    I have SAP J2EE 6.20 installed on linux machine. I am trying to deploy struts framework based application and while deploying it..... I am getting error message:
    Error can't load Servlet org.apache.struts.action.ActionServlet : java.lang.NoClassDefFoundError: org/xml/sax/SAXException
    07 19:27:48 -  ***********************************************************
    08/10/07 19:27:48 -  Applying user role management mappings.
    08/10/07 19:27:48 -  Start updating EAR-file...D:\SAPJ2EE Client\deploying\sambodh\sambodh.ear
    08/10/07 19:28:26 -  Temp files deleted...
    08/10/07 19:28:26 -  Ear-file updated successfully for 37860ms.
    08/10/07 19:28:27 -  Start deploying ...
    08/10/07 19:30:35 -  Ear-file uploaded to server for 128047ms.
    08/10/07 19:30:37 -  Successfuly deployed! Deployment took 1953ms.
    08/10/07 19:30:37 -  WARNING : Deploy service return folowing WARNINGs:
                         Error can't load Servlet org.apache.struts.action.ActionServlet : java.lang.NoClassDefFoundError: org/xml/sax/SAXException
                          Deployment took 1953ms.
    08/10/07 19:30:37 -  ***********************************************************
    First time when I got this error, I added struts.jar in my server's <inst_dir>/alone/additional_libs/...... but then also error still exists... Do I have to start  SAP J2EE instance once again and then deploy my application?
    Can anyone help me out in this as this is very very very imp.
    regards

    Hi,
    As per your actions above I believe you have already found SAP Note 435363.
    Basically for a struts application there are no special requirements other than
    1. Make a reference to the inqmyxmltoolkit from the application that is going to use struts before the deployment
    2. Put the struts library into WEB-INF/lib of the application (struts can't be shared among applications)
    3. Deploy the application
    For making the reference you can:
    1. Telnet to the Engine (if you run it as a service and do not have access to its shell directly)
    If telnet port on the Engine dispatcher is 2323
    telnet localhost 2323
    2. Jump to the server node
    for example if the application node's cluster id is 4001
    jump 4001
    3. Execute the commands
    add deploy
    changeref -m  MyApplication library:inqmyxml
    So if it does not work, then I see two reasons possible:
    1. You are using a really old version of the 6.20 Engine - check if you are on PL41.
    2. You have misspelled the name of your application in the reference. The names are case sensitive so you need to be careful. MyApplication is not the same as myApplication or myapplication.
    Regards,
    Iavor

  • How can we reduce Row Chaining?

    In a 10gR2 db, how can i reduce row chaining in tables?

    Hi,
    First, the prevention techniques for chained rows vs. migrated rows is a bit different. Note that both chained rows and migrated (relocated) rows manifest as "table fetch continued row" in v$sysstat and stats$sysstat for STATSPACK and dba_hist_sysstat for AWR.
    Preventing chained rows - Chained rows can occur when a row is to large for a data block. In these cases, moving large objects into a tablespace with a larger blocksize can often relieve chained rows.
    Preventing migrated rows - Migrated rows occur when a row expands (usually w2ith a varchar2 data type), and there is not enough reserve defined by PCTFREE for the row to expand. In this case, you adjust the PCTFREE to ensure that future rows will have room to expand and reorganize the table to remove the fragments.
    On some tables which are stored tiny and grow huge, you may need to set PCTFREE to a "large" value, so that only one row is stored per block. For example, if I have a row with a varchar2 that is stored at 2k and grows to 30k, I would need to use a 32k blocksize and set PCTFREE=95 so that only one rows is stored on each data block. That way, at update time, there will be room for the row to expand without fragmenting.
    Operationally, Oracle consultant Steve Adams offers this tip for finding the difference between chained and migrated rows:
    http://www.freelists.org/archives/oracle-l/10-2008/msg00750.html
    +"You can tell the difference between row migration and chaining by listing the chained rows with ANALYZE table LIST CHAINED ROWS and then fetching the first column from each "chained row" in a single query.+
    +The count of continued row fetches will be incremented for every migrated row, but not for most chained rows (unless the first cut point happens to fall with the first column, which should be rare)."+
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

  • Can jsp include Servlet?

    can a jsp include a servlet inside in the code using the jsp include?
    i am using tomcat 4.x

    That depends on the type of include and the servlets function.
    If you used the <% include file="relative URL" %> syntax, you can include a servlet that does a task (but does not output HTML) or a servlet that outputs HTML.
    Now you can use the <% include file="relative URL" %> to <jsp:include page="relative URL" flush="true" /> but only if the servlet you are including OUTPUTS html. If this servlet DOES something other than outputting HTML then you are S.O.L. and and you cannot include the Servlet=P
    Hope that helps

  • Can i deploy servlet to iis server..?

    Can i deploy servlet to iis server..?
    if yes.. how..?

    to deploy servlets into IIS you need to use some connector which connects IIS to tomcat. Still you have to use servlet contrainer from tomcat only (as IIS serves you only web server functionality but not servlet contrainer ). use JK Connector for this bride.

  • (266758030) Can WebLogic Workshop Web Services be deployed on a different Application Server?

    (266758030) Q(asked by Lalit Sudan): Can WebLogic Workshop Web Services be deployed
    on a different Application Server?
    A(by Adam Fitzgerald): .jws files are not yet an accepted standard so you can expect
    that the WebLogic Workshop Web Services cannot be ported to other Application Servers,
    however, it is a general goal to expand the functionality of the Workshop tool for
    other App Servers.

    Just so you'll know Oracle9iAS also includes apache as the HTTP server.
    As Suncan said, if you want to use Forms on the Web you need the Forms Server engine, and it comes bundled in Oracle9iAS. You'll save yourself a lot of headache if you just install Oracle9iAS and have everything pre-configured for you thus reducing maintanance costs.

Maybe you are looking for