Thanks Tim for your reply.  Problem not solved yet, but perhaps you have some more
ideas....

Tim Stephenson wrote:

> At whatever point in time this is established place it in the session object.
> Then at the top of every page extract and test this flag. If true continue page
> execution, else redirect to logon page.

This is the very point where I run into trouble  Not every page I wish to protect
*is* a servlet which can perform such a test.   Some resources will be just dumb
files.  I was trying to avoid my CatchEverythingAndForwardItIfOkServlet having to
evaluate whether it was a servlet resource requested, or just a plain file.  I
want to delegate this responsibility to the servlet container, as the
RequestDispatcher interface allows for.

My problem is, if I use RequestDispatcher, then my Servlet at '/' might forward to
a file at '/login.html' (or anywhere else) but the servlet itself will again get
invoked ... again and again and again.

Indeed, it would seem that any Servlet using RequestDispatcher could not be mapped
to any URL without causing this self-referential/recursion issue.  But I don't
think the Servlet API designers (both 'official' and 'community') would let a
'gotcha' like that slip through, being the intelligent people they are.

So I'm presuming there's some aspect of the API that I haven't understood properly
(and I *have* read the Servlet 2.2 spec).


> Complication: You mention that it is a perl script that determines the logged
> on state. Whilst I know nothing about perl, could you wrap the script execution
> with a java class?

We are trying to 'live with' the Perl script, since we don't wish to re-implement
that portion of our web-application.  That side of the equation is OK - we can
read the file from Java that the Perl-script writes.  It's the mapping problem
that really has me stuck.

Thanks once again for your interest in this problem,

David.



--
David Bullock
Project Manager - Strategic Applications
[EMAIL PROTECTED]

"It's no use saying 'We are doing our best.'  You
have got to succeed in doing what's necessary."
    ...Winston Churchill


LISAcorp
http://www.lisa.com.au/

Adelaide                  Sydney
--------------------      ------------------------
38 Greenhill Rd           Level 3, 228 Pitt Street
Wayville S.A. 5034        Sydney NSW 2000

PH  +61 8 8272 1555       PH  +61 2 9283 0877
FAX +61 8 8271 1199       FAX +61 2 9283 0866
--------------------      ------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to