Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 71132 invoked by uid 500); 3 Sep 2001 20:10:39 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 71105 invoked from network); 3 Sep 2001 20:10:39 -0000 Received: from icarus.apache.org (64.125.133.21) by daedalus.apache.org with SMTP; 3 Sep 2001 20:10:39 -0000 Received: (qmail 89693 invoked by uid 1059); 3 Sep 2001 20:08:31 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Sep 2001 20:08:31 -0000 Date: Mon, 3 Sep 2001 13:08:31 -0700 (PDT) From: "Craig R. McClanahan" Sender: To: Subject: Re: Limits on the size of the web.xml file? In-Reply-To: <009c01c134af$d733c560$0a00a8c0@default> Message-ID: <20010903130235.P85690-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Mon, 3 Sep 2001, Roland wrote: > Date: Mon, 3 Sep 2001 16:37:17 -0300 > From: Roland > Reply-To: tomcat-user@jakarta.apache.org > To: tomcat-user@jakarta.apache.org > Subject: Re: Limits on the size of the web.xml file? > > > The details *vastly* depend on how your app is put together, but it isn't > > all that complicated to figure out. > > > > Consider that you might have the mailboxes for a particular user defined > > in a database table called "mailboxes", with columns "username" and > > "mailboxname". It would be easy to construct an SQL statement like this: > > > > select mailboxname from mailboxes > > where username = xxx > > Ok, having Data in the database is fine. But what if we also have image > data? We will store Charts and things like that. I think it would be easier > to create a directory for each user(maybe I'm wrong). It is possible to > store images in a mysql database but I think its not as easy as text data. > And then we will have to create a HTML page from that image data and send it > to the user. Storing binary data in the database isn't all that hard. Then, all you'd need to do is create a servlet mapped to "*.gif", "*.jpg", and so on that did the user identity check before serving the contents (in binary). The same basic principle would work for data stored in per-user directories. In essence, you're replacing the default file-serving servlet that comes with Tomcat. If you run under Tomcat 4 (which supports Servlet 2.3), you also have another choice -- you can implement your custom authentication checker as a Filter instead of a Servlet. That way, you can apply your own custom check onto any path, without having to modify or replace the file-serving servlet that comes with Tomcat. Craig