Servlet chaining or reponse filtering
Does WL6 currently support one of these features? If not, how can I do this under
WL6?
If not, how can I do this under >WL6?
I do this:
I create one controller servlet. then I create many command classes, they
have a constructor and one execute(req, res) method, which throws my
exception.
in servlet's init(), I load these commands, and put them in hashmap. then in
service() I call one of the command's execute(req, res) method.
I have many commands, some of them call each other, put variables in a
session, analyze requests etc.
Similar Messages
-
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.
> > .
> >
> >
> >
>
>
-
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 likeAnd 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.
ThanksMore info ...
I enable logging and found the following error
Unable to initiate threads: cannot find class java/lang/Thread. -
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
-
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
> > > > >
> > > > >
> > > > >
> > > >
-
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
>
-
Hi, A reply to one of the earlier messages, says "servlet chaining is currently not available". does it mean it would be available in future versions or do we have support for it in any of the currently available, recently released versions?
i just wondering, why you want to chain the servlets in what way, is that
the servlet application is in someway already chained in by itself.
it would be little use in my mind to have chained servlet.
just my opinon
Frank
Mahesha <[email protected]> wrote in message
news:40d8c8fc$1@mktnews1...
> Hi, A reply to one of the earlier messages, says "servlet chaining is
currently not available". does it mean it would be available in future
versions or do we have support for it in any of the currently available,
recently released versions?
-
Hi,
I am having three servlets. First servlet is receiving request
and after doing some processing it generates html and sends html
to user. Once user enters all details in requested page(html
page sent by servlet 1), he presses submit on that html.
At that time that html is calling another servlet(Servlet 2).
After receiving request from user, servlet 2 extract parameter
sent by user. Then it stores extracted parameter to database.
Depends upon one parameter (sent by user) servlet2 dispatch
request to servlet3.
Now I want to convert above servlets into portlet.
Can anybody tell me how to convert second servlet into portlet.
Because it is not shown in any page but still it receives
request. do some processing and send the response to third
servlet.
Do I need to change zone and jserv properties file for servlet2?
Do I need to enter servlet 2 in provider.xml where servlet 1 is
entered as portlet ?
Thanks in advance.
BirenHello,
What is the version of the weblogic server you are using ?
Regards
Anilkumar kari -
IPlanet 6.0 And servlet filters with filter-test.war not working
Hi, I am trying to get servlet filters running on iPlanet6.0. I deployed the 'filter-test.war' file, and then modified web-apps.xml to contain the filter configuration. I even modified the example classes to log to a file on disk. The only thing that happens is intialization. Further it never get's to call the 'doFilter' method at all.
Is there anything I'm missing?
All I did was deploy the war file, and then modify the web-apps.xml file, and then restart the server. Is there anything else?
Here is my web-apps.xml file as been modified.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vs PUBLIC "-//Sun Microsystems, Inc.; iPlanet//DTD Virtual Server Web Applications 6.0//EN"
"http://developer.iplanet.com/webserver/dtds/iws-webapps_6_0.dtd">
<vs>
<web-app uri="/" enable="true"/>
<web-app uri="/filter-test" dir="C:/temp/iplanet/deployed" enable="true">
<!-- Define servlet-mapped and path-mapped example filters -->
<filter>
<filter-name>Servlet Mapped Filter</filter-name>
<filter-class>filters.ExampleFilter</filter-class>
<init-param>
<param-name>attribute</param-name>
<param-value>filters.ExampleFilter.SERVLET_MAPPED</param-value>
</init-param>
</filter>
<filter>
<filter-name>Path Mapped Filter</filter-name>
<filter-class>filters.ExampleFilter</filter-class>
<init-param>
<param-name>attribute</param-name>
<param-value>filters.ExampleFilter.PATH_MAPPED</param-value>
</init-param>
</filter>
<filter>
<filter-name>Request Dumper Filter</filter-name>
<filter-class>filters.RequestDumperFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Servlet Mapped Filter</filter-name>
<servlet-name>invoker</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Path Mapped Filter</filter-name>
<url-pattern>/servlet/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Request Dumper Filter</filter-name>
<url-pattern>/servlet/*</url-pattern>
</filter-mapping>
</web-app>
</vs>
Thank youWhy not try WS 6.1 -- which has the full support for Servlet 2.3 including filters.
As for 6.0, what URI do you use? Is it:
/filter-test/servlet/<servlet-name> -
Verifier error on filters during Glassfish deployment
Trying to deploy a couple of simple filter classes like this:
public class MyFilter implements FilterI get this error for every single filter when deploying the WAR in Glassfish with the verifier option checked:
Error: Servlet Class [com.myPackage.MyFilter] does not directly or indirectly implement javax.servlet.Servlet
If I do not pass through the verifier the deployment is OK and the filters seem to run as expected.
thanks for any suggestion,
giovanniwhen your class does implement a Filter interface the container
must recognize it as a servletReally? I never heard nor read this before.
Here is an excerpt of: http://www.servlets.com/soapbox/servlet23.html
Filters are not servlets; they do not actually create a response. They are preprocessors of the request before it reaches a servlet, and/or postprocessors of the response leaving a servlet. In a sense, filters are a mature version of the old "servlet chaining" concept.
Maybe you are used to the pre-servlet 2.3 specs? -
I'm developing web application with OAS
4.0.8.1 and JDeveloper 3.0 and I want to call
JSP from servlet using "RequestDispatcher".
I downloaded JSP for OAS from www.olab.com.
In the Release note, there is a description
about RequestDispatcher, but I cannot
understand about details.
In what configuration can I use servlet and
JSP together with RequestDispatcher. Anyone
scceeded about that?
nullwan (guest) wrote:
: Hi everyone,
: I am using OAS 4.0.8 on Solaris 2.6. After viewing servlet
: and JSP samples, I am kind of confuse whether OAS supports the
: following options
: 1. JSP
: 2. servlet chaining
: 3. running JDeveloper DB Servlet wizard
: (oracle.jdeveloper.servlet.*) and Java Business Objects
: (oracle.jbo.rt.cs)
: Thank you for your time.
I found a white paper 408newfead.pdf, that says under "Future
Directions" that it will add jsp support. I read somewhere (I
can't remember where exactly :( ) that said 4.0.8.1 would
support
JSPs. I don't know if this release is out yet.
I wish Oracle would get with the times and put out a product that
is consistent with the technology they are touting as the
future.
Having us download Suns server to run servlets and JSP is
ridiculous for the worlds second largest software company!
null -
RequestDispatcher.forward on OAS 4.0.8.1 for Servlet Communication
We are unable to pass request information from a servlet to another servlet or a JSP on OAS 4.0.8.1 whereas we have been able to achieve this
successfully in JDK using the same code.
Since Servlet Chaining is not supported in the JServlet of OAS, use the forward
method in the RequestDispatcher object instead.
RequestDispatcher rd;
rd =getServletConfig().getServletContext().getRequestDispatcher(/testme1/USe
rvl
et);
rd.forward(request,response);
It didn't do anything with the forward method and nothing was logged in the log file. Anyone out there, please send help ASAP. Thanks.
nullAfter I fixed some of the things I broke while searching for the wrksf failure, the PL/SQL Cartridge now works for me too. And, after failing to get the DB Browser to work by loading it into the SCOTT schema, I got it to work by loading it into SYS. (SCOTT can't see the DBA_* views so loading the DB Browser into the database failed.) I haven't tried any Java Servlets yet, but that's next on my list.
If you want to try my wrksf workaround, rather than using Christoph's, here's how you can do it.
1. Backup liborb.so in the $ORACLE_HOME/orb/4.0/lib directory, just in case something goes wrong.
2. Using a hex editor, such as emacs hexl-find-file or ghex, to edit liborb.so, find the string "/proc/stat".
3. Change the directory, "/proc" to something like "/pfoo" and write the shared library file back to liborb.so. You now have the required modified liborb.so.
4. Make the /pfoo directory and cp /proc/stat /pfoo.
5. Edit /pfoo/stat and duplicate the first line, which should be the cpu line. This will let the metrics parser handle it. Make sure that /pfoo/stat has read access.
Of course, the values that the metrics code gets are now bogus, but that does not seem to be a fatal problem.
Hopefully somebody from Oracle is reading this and the real fix will be in the mail soon. -
Servlet/jsp & custom sessions
Our app is using custom sessions with most of the data stored in
ejbeans. We can't really use http sessions
as multiple 'http' sessions may end up using the same set of beans which
make up our own 'application defined'
session. As the set of beans making up one session are typically located
on the same host, we'd like to make sure
that all requests using them are processed on the respecting host.
I understand now that performing some kind of 'servlet-chaining' in
order to forward a request to the correct host
is a bad idea. Our current solution is to wrap the processing of the
request into a ejbean which is made available
throughout the cluster by adding a reference into the jndi tree (using
the beans allows us to ensure that sessions time
out when necessary.) What i don't like about this approach is that there
is no way to write a simple servlet or jsp
pages as direct access to the servlet interface is lost (a copy of the
servlet-related data could be sent to the bean
on remote host, but that's expensive and ends up in something similar to
servlet-chaining.)
Does any know of possibilities to solve this problem a little bit more
elegantly? Essentially i'd like to run servlet and
jsp pages on top of our 'application defined' sessions, efficiently
working in a cluster.
Thanks a lot for any suggestions,
roman
thank's for your reply!
the whole thing is not really related to ejb, i'm just using it as a
workaround.
it's actually a gross misuse of ejb...
the main issue is that i'd like to be able to write jsp pages and store
per-session
information in a object other than the HttpSession. i cannot use the
HttpSession
because one session in our application does not necessarily correspond
to one http
session.
so far the solution is trivial; i just keep keep a reference to the
session data
in the jndi tree. for each request, i can find the data with one jndi
lookup. it
even works on a cluster by using remote objects and a replicated jndi
tree (thank
you, weblogic!)
but, for efficiency, i'd also like to process each request on the same
host where
the session data is stored... how can i do that without servlet
chaining?
roman
Prasad Peddada wrote:
>
> It is not quite clear to me what you are trying to do here.
>
> What type of ejbs are you talking about?
>
> Roman Puttkammer wrote:
>
> > Our app is using custom sessions with most of the data stored in
> > ejbeans. We can't really use http sessions
> > as multiple 'http' sessions may end up using the same set of beans which
> > make up our own 'application defined'
> > session. As the set of beans making up one session are typically located
> > on the same host, we'd like to make sure
> > that all requests using them are processed on the respecting host.
> >
> > I understand now that performing some kind of 'servlet-chaining' in
> > order to forward a request to the correct host
> > is a bad idea. Our current solution is to wrap the processing of the
> > request into a ejbean which is made available
> > throughout the cluster by adding a reference into the jndi tree (using
> > the beans allows us to ensure that sessions time
> > out when necessary.) What i don't like about this approach is that there
> > is no way to write a simple servlet or jsp
> > pages as direct access to the servlet interface is lost (a copy of the
> > servlet-related data could be sent to the bean
> > on remote host, but that's expensive and ends up in something similar to
> > servlet-chaining.)
> >
> > Does any know of possibilities to solve this problem a little bit more
> > elegantly? Essentially i'd like to run servlet and
> > jsp pages on top of our 'application defined' sessions, efficiently
> > working in a cluster.
> >
> > Thanks a lot for any suggestions,
> > roman
-
Can a HTML form send data to two servlets?
I would like to know if an HTML Form can send data to two servlets, I guess I am askin is that can the parameters be passed to two ACTION attributes??
Hmmmm, well I'm not sure if that is possible, but you could do something of the sort on the server side by chaining them.... the technieque is called Servlet Chaining
Hope this helps
Omer
Maybe you are looking for
-
what the hell going on withnokia lumias model htc had already brought the phone cover which covers on phone cover app in windowsphone 8.1 why the heell the leading wp devices manufacturer is laggy behind bring out the phone cover app on nokia lumia
-
DATA LOAD ISSUE /NO ROLL UP MEMORY
Hello Team, I have this master data load failure for FIS_BELNR. The problem which I think that everytime it tries to load it runs out of internal table space in the backend. I really don't know what it means. This data is been failing everyday becaus
-
Need help for my project(how to call function in ancestor object)
dear all, i need your help for my project.My problem is stated as follow: say i have a class call frameA and frameB, both of them are extend from JFrame, frameA structure can be described briefly as follow: //frameA.java public class frameA extends J
-
hey here, I've had my touch for a week now but since updating to 1.1.3 I've noticed that any songs played on the iPod aren't added to the play count in iTunes. Anyone else have or had this problem, or any ideas for how I can cure his? I don't really
-
Hi I did not find this information inside the Encore manual or FAQs here... So it's just a question ir order to know if I can work safety this way.... Suppose I have a 20 minutes of video and need to burn it in a DVD. When exporting to the MPEG-2 (fo