users@glassfish.java.net

Re: Multi-level context paths in glassfish

From: <glassfish_at_javadesktop.org>
Date: Wed, 08 Oct 2008 08:19:18 PDT

Sorry for the delay in response. I was hoping to receive an email when any responses made to the question.

Here is a snippet of my server.xml

   <Context path ="/[b]region1[/b]" docBase ="/[b]rep[/b]"
                        reloadable ="true" debug ="0" crossContext ="false">
                                <Valve className="org.apache.catalina.valves.AccessLogValve"
                                                 prefix="rep_log." suffix=".txt"
                                                 pattern="common"/>
                                <Resource name ="jdbc/REP" description ="REP DB Connection"
                                                auth ="Container" type ="javax.sql.DataSource"
                                                removeAbandoned ="false" validationQuery ="select 1;"
                                                autoreconnect="true" session_timeout="0"
                                                driverClassName ="com.mysql.jdbc.Driver"
                                                url ="jdbc:mysql://localhost:3306/[b]reg1[/b]"
                                                username ="root" password ="test"
                                                maxActive ="26" maxIdle ="8" maxWait ="10000"/>
                                <Resource name ="mail/Session" auth ="Container"
                                           type ="javax.mail.Session"
                                           mail.smtp.host ="mx.icfconsulting.com"/>
   </Context>

   <Context path ="/[b]region2[/b]" docBase ="/[b]rep[/b]"
                        reloadable ="true" debug ="0" crossContext ="false">
                                <Valve className="org.apache.catalina.valves.AccessLogValve"
                                                 prefix="rep_log." suffix=".txt"
                                                 pattern="common"/>
                                <Resource name ="jdbc/REP" description ="REP DB Connection"
                                                auth ="Container" type ="javax.sql.DataSource"
                                                removeAbandoned ="false" validationQuery ="select 1;"
                                                autoreconnect="true" session_timeout="0"
                                                driverClassName ="com.mysql.jdbc.Driver"
                                                url ="jdbc:mysql://localhost:3306/[b]reg2[/b]"
                                                username ="root" password ="test"
                                                maxActive ="26" maxIdle ="8" maxWait ="10000"/>
                                <Resource name ="mail/Session" auth ="Container"
                                           type ="javax.mail.Session"
                                           mail.smtp.host ="mx.icfconsulting.com"/>
   </Context>


I have copied couple of my context paths, but i have 9 of these context paths in server.xml.

region1/region2 are the context path I get in the URL, like http://localhost:8080/region1

reg1/reg2 are the database schema that connects to region1/region2.

rep is the docBase (single code base for all these context paths)

Thanks.
[Message sent by forum member 'sguntu' (sguntu)]

http://forums.java.net/jive/thread.jspa?messageID=303980