You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pu...@ps.ge.com on 2001/04/04 14:37:46 UTC

servlet

I am developing a web page, which will have the link to copyright protected
reference materials. I will be using some web-builder tool such as
front-page or dream-weaver.
The problem faced is the implementation of access control over the refrence
material, which is nothing but pdf files. the control should be such that
when a user is aacessing, viewing or using a file no other user user should
be able to view or access that file i.e. one user, one file at a time.
I am in a fix, what to do?
should i use the singlethreadmodel interface of servlet or jsp to develop
this control, but i am afraid that i will end up in writing 300 servlet
classes each crresponding to one pdf file.
Any suggestions addressing this problem?
Thanking you.

Pushpendra Singh.


RE: servlet

Posted by Emmanuel Lécharny <el...@iktek.com>.
A suggestion :

First, you really need to manage a session for each user, because when a
user get the file, he must release it when he has read it. That means that
either he send another request to release the file or the session has
"timeouted", which drives to the file release.

Second, what you can do is to keep a kind of association between a file and
a user. When another user request for an already used page, you should parse
this association to see if the file is used by somebody or not.

Third, this association must be persistent. Just use a static class that
will be loaded once and used many times, and will never been discarded until
the server die.

Fourth, be careful with concurent access to this association. When you are
searching in the association, you must be alone doing it. If not, you wont
be able to avoid a multiple access to a file.


Emmanuel Lécharny, IKTEK
06 08 33 32 61, www.iktek.com <http://www.iktek.com>


-----Message d'origine-----
De : pushpendra.singh@ps.ge.com [mailto:pushpendra.singh@ps.ge.com]
Envoyé : mercredi 4 avril 2001 14:38
À : tomcat-dev@jakarta.apache.org
Objet : servlet


I am developing a web page, which will have the link to copyright protected
reference materials. I will be using some web-builder tool such as
front-page or dream-weaver.
The problem faced is the implementation of access control over the refrence
material, which is nothing but pdf files. the control should be such that
when a user is aacessing, viewing or using a file no other user user should
be able to view or access that file i.e. one user, one file at a time.
I am in a fix, what to do?
should i use the singlethreadmodel interface of servlet or jsp to develop
this control, but i am afraid that i will end up in writing 300 servlet
classes each crresponding to one pdf file.
Any suggestions addressing this problem?
Thanking you.

Pushpendra Singh.