One request per session

2005-03-22 Thread Brij Naald
Hi,
i'm trying to test a locking system for servlets. I've made a chain of 
servlets which include each other:

Servlet1 -- Servlet2 -- Servlet3
When Thread1 is in Servlet2, it puts a lock on Servlet1. That way if there 
is a new Request, this request (on thread2) wants to start with servlet1. 
Since there is a lock on it, it has to wait.
When Thread1 gets into servlet3 it releases the lock, and Tread2 can start 
with Servlet1.
This is what i've made already. (if there are any questions about this 
already, please ask!)

Now I wanted to test it like this:
To test the lock, a thread in servlet2 sleeps for 20 seconds. So thread1 
first executes servlet1, then goes to servlet2, waits for 20 seconds and 
then goes on to servlet3. While thread1 is in servlet2 i have the time to 
start a new request.

Now what do I see: The first request starts with servlet1, then goes to 
servlet2 and starts waiting 20 seconds. Now I push on the 'previous'-button 
of my browser, and make a new request. This second thread must wait since 
servlet1 is locked. This works. But now the problem: when the first thread 
has waited 20 seconds, it doesn't go to servlet3 anymore.

-- Is there somekind of functionality that only one request per session is 
allowed or something like that?

Thanks!
_

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Filter/...

2004-12-04 Thread Brij Naald
Hi,
I need to run a class everytime before a servlet is started.
One option is to make a filter, the problem here is that a filter doesn't 
get called when a servlet is invoked via the requestDispatcher.

Is there another solution for this problem?
_
MSN Music: download je muziek legaal ! 
http://entertainment.msn.be/muziek/musicclub

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Filter/...

2004-12-04 Thread Brij Naald
Hi,
you indeed didn't the question :-) (but still, thanks for answering!)
The problem is as follows:
I'm making a plugin which puts a wrapper around the request of a servlet.
A servlet gets invoked by:
doGet(HttpServletRequest request, HttpServletResponse response)
What I want to do now is to put a filter in front of it. When a request 
comes in,
the filter does:
newrequest= new RequestWrapper(request);
chain.doFilter(newrequest, response);

That way the servlet is invoked with a wrapper around the request.
Until now, this approach works.
Now comes the problem:
the filter also does some other things than creating the wrapper. That way 
it always has to be called, before a servlet is called.

The filter I have now, always get called when there is an incoming request. 
But when a servlet uses a requestdispatcher to include another servlet, the 
filter doesn't get called.

In a little schema:
Without filter the call looks like:
Request -- Servlet1 -- Servlet2(so servlet1 uses a requestdispatcher 
to include servlet2)

If you add a filter to this you get:
Request -- Filter - Servlet1 - Servlet2
But what I need to get is:
Request -- Filter - Servlet1 - Filter - Servlet2
_
Heb je MSN WebMessenger al ontdekt? http://webmessenger.msn.com/?mkt=nl-be
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


classpath of a filter

2004-11-26 Thread Brij Naald
Hi,
i'm creating a filter which needs to know if the request is an instance of 
org.apache.catalina.connector.RequestFacade.

When executing the 'if (request instanceof RequestFacade)' the program gives 
an error for that line:

java.lang.NoClassDefFoundError: org/apache/catalina/connector/RequestFacade
I guess the RequestFacade is only in the classpath of the tomcat-server, and 
not in the one of the servlet itself.

Does anyone know how I can solve this problem?
Thanks!
_
Koop geen kat in een zak. Probeer alles 14 dagen bij jou thuis. 
http://linkstat.neckermann.de/go.mb1?benl_11294

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


web.xml / struts-config.xml

2004-11-25 Thread Brij Naald
Hi
is it possible for a filter,a servlet or just another class on the server to 
get to the web.xml file?

Thanks!
_
Kies nu de Site Van Het Jaar en win prachtige prijzen! 
http://www.sitevanhetjaar.be/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]