You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rohit Peyyeti <ro...@translogicsys.com> on 2003/04/22 10:10:45 UTC

Packaging web apps

Hello:

Standard way of packaging web application is given in the
servlet specification 2.3 which defines ideal way to 
package web applications following this structure:

/                    -> Document root
/HTML                -> All HTMLs
/IMAGES              -> All Images 
/WEB-INF             -> Protected Directory
/WEB-INF/classes     -> All application classes
/WEB-INF/lib         -> All .jar files specific to app
/WEB-INF/conf        -> All apps configuration files

Question which I have is -- where does all customer
specific data go? Not within this directory structure
because we are mixing both app and customer stuff 
together which will become pain to handle at the time
of maintenance. 

Is there any standard way followed? Or do I write 
a separate service to manage customer data (which
resides outside the contexts doc path?). What is the
right way to go? How do people commonly handle such 
setups? I'm eager to know ;)

Thanks,
Rohit

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Packaging web apps

Posted by Tim Funk <fu...@joedog.org>.
With this syntax:
<Context path="more" docBase="/usr/local/data/cowbell" debug="0">

When I goto http://howmuchcowbell.com/more/index.html - this will correspond 
to /usr/local/data/cowbell/index.html.

This allows the following:
/usr/local/data/cowbell-1.0
/usr/local/data/cowbell-1.1
/usr/local/data/cowbell-1.2

So I can choose the right one and map it to /more.


-Tim

Rohit Peyyeti wrote:
> Thanks Tim. One question though: This context path which you have
> defined below if different from apps context path? 
> 
> Thanks!
> Rohit
> 
> ----- Original Message ----- 
> From: "Tim Funk" <fu...@joedog.org>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, April 22, 2003 4:35 PM
> Subject: Re: Packaging web apps
> 
> 
> 
>>Depends what you mean by customer specific data.
>>
>>I try to keep data isolated in its own subdirectory (or subdirectories).
>>
>>Ideally I keep that the data outside of the webapp in some "magic" directory 
>>(or better yet a database) that I configure in server.xml. Then when my 
>>webapp needs to access the external resource, I will do that via a jndi 
>>lookup to determine where to go.
>>
>>For example, in server.xml
>><Context path="more" docBase="/usr/local/data/cowbell" debug="0">
>>   <Environment name="customer/path"
>>                value="/usr/local/data/customerA"
>>                type="java.lang.String"
>>                override="false"/>
>></Context>
>>
>>Then your lookup code:
>>--
>>javax.naming.Context initCtx = null;
>>javax.naming.Context envCtx = null;
>>String myDir = null;
>>
>>initCtx = new javax.naming.InitialContext();
>>envCtx = (Context) initCtx.lookup("java:comp/env");
>>myDir = (String) envCtx.lookup("customer/path");
>>--
>>
>>
>>
>>-Tim
>>
>>Rohit Peyyeti wrote:
>>
>>>Hello:
>>>
>>>Standard way of packaging web application is given in the
>>>servlet specification 2.3 which defines ideal way to 
>>>package web applications following this structure:
>>>
>>>/                    -> Document root
>>>/HTML                -> All HTMLs
>>>/IMAGES              -> All Images 
>>>/WEB-INF             -> Protected Directory
>>>/WEB-INF/classes     -> All application classes
>>>/WEB-INF/lib         -> All .jar files specific to app
>>>/WEB-INF/conf        -> All apps configuration files
>>>
>>>Question which I have is -- where does all customer
>>>specific data go? Not within this directory structure
>>>because we are mixing both app and customer stuff 
>>>together which will become pain to handle at the time
>>>of maintenance. 
>>>
>>>Is there any standard way followed? Or do I write 
>>>a separate service to manage customer data (which
>>>resides outside the contexts doc path?). What is the
>>>right way to go? How do people commonly handle such 
>>>setups? I'm eager to know ;)
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Packaging web apps

Posted by Rohit Peyyeti <ro...@translogicsys.com>.
Thanks Tim. One question though: This context path which you have
defined below if different from apps context path? 

Thanks!
Rohit

----- Original Message ----- 
From: "Tim Funk" <fu...@joedog.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, April 22, 2003 4:35 PM
Subject: Re: Packaging web apps


> Depends what you mean by customer specific data.
> 
> I try to keep data isolated in its own subdirectory (or subdirectories).
> 
> Ideally I keep that the data outside of the webapp in some "magic" directory 
> (or better yet a database) that I configure in server.xml. Then when my 
> webapp needs to access the external resource, I will do that via a jndi 
> lookup to determine where to go.
> 
> For example, in server.xml
> <Context path="more" docBase="/usr/local/data/cowbell" debug="0">
>    <Environment name="customer/path"
>                 value="/usr/local/data/customerA"
>                 type="java.lang.String"
>                 override="false"/>
> </Context>
> 
> Then your lookup code:
> --
> javax.naming.Context initCtx = null;
> javax.naming.Context envCtx = null;
> String myDir = null;
> 
> initCtx = new javax.naming.InitialContext();
> envCtx = (Context) initCtx.lookup("java:comp/env");
> myDir = (String) envCtx.lookup("customer/path");
> --
> 
> 
> 
> -Tim
> 
> Rohit Peyyeti wrote:
> > Hello:
> > 
> > Standard way of packaging web application is given in the
> > servlet specification 2.3 which defines ideal way to 
> > package web applications following this structure:
> > 
> > /                    -> Document root
> > /HTML                -> All HTMLs
> > /IMAGES              -> All Images 
> > /WEB-INF             -> Protected Directory
> > /WEB-INF/classes     -> All application classes
> > /WEB-INF/lib         -> All .jar files specific to app
> > /WEB-INF/conf        -> All apps configuration files
> > 
> > Question which I have is -- where does all customer
> > specific data go? Not within this directory structure
> > because we are mixing both app and customer stuff 
> > together which will become pain to handle at the time
> > of maintenance. 
> > 
> > Is there any standard way followed? Or do I write 
> > a separate service to manage customer data (which
> > resides outside the contexts doc path?). What is the
> > right way to go? How do people commonly handle such 
> > setups? I'm eager to know ;)
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Packaging web apps

Posted by Tim Funk <fu...@joedog.org>.
Depends what you mean by customer specific data.

I try to keep data isolated in its own subdirectory (or subdirectories).

Ideally I keep that the data outside of the webapp in some "magic" directory 
(or better yet a database) that I configure in server.xml. Then when my 
webapp needs to access the external resource, I will do that via a jndi 
lookup to determine where to go.

For example, in server.xml
<Context path="more" docBase="/usr/local/data/cowbell" debug="0">
   <Environment name="customer/path"
                value="/usr/local/data/customerA"
                type="java.lang.String"
                override="false"/>
</Context>

Then your lookup code:
--
javax.naming.Context initCtx = null;
javax.naming.Context envCtx = null;
String myDir = null;

initCtx = new javax.naming.InitialContext();
envCtx = (Context) initCtx.lookup("java:comp/env");
myDir = (String) envCtx.lookup("customer/path");
--



-Tim

Rohit Peyyeti wrote:
> Hello:
> 
> Standard way of packaging web application is given in the
> servlet specification 2.3 which defines ideal way to 
> package web applications following this structure:
> 
> /                    -> Document root
> /HTML                -> All HTMLs
> /IMAGES              -> All Images 
> /WEB-INF             -> Protected Directory
> /WEB-INF/classes     -> All application classes
> /WEB-INF/lib         -> All .jar files specific to app
> /WEB-INF/conf        -> All apps configuration files
> 
> Question which I have is -- where does all customer
> specific data go? Not within this directory structure
> because we are mixing both app and customer stuff 
> together which will become pain to handle at the time
> of maintenance. 
> 
> Is there any standard way followed? Or do I write 
> a separate service to manage customer data (which
> resides outside the contexts doc path?). What is the
> right way to go? How do people commonly handle such 
> setups? I'm eager to know ;)
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org