You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2006/05/17 17:47:16 UTC

Re: What's about unloading policy of jsp-servlets ?

Oliver Dewdney wrote:
> So, what are the requirement to getting a patch accepted in tomcat 5.5?

As I said before, it is very unlikely I would accept such a patch (since 
it would give JSP the worst of both worlds: the hassle of compilation 
combined with the crap raw performance of templates), and for sure I 
will veto it in the 5.5 branch.

You are using JSPs, which is a compiled technology, expecting it to 
behave like a template based technology. Your design is broken, and 
you'll have to live with that if you don't want to switch to using one 
of the many template based offerings (and indeed, you are indeed not 
completely alone, for whatever reason).

Rémy

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


Re: Creating a context and deploying a new application on the fly. I tried but haven`t succeed please help :-)

Posted by David Gagnon <dg...@siunik.com>.
Hi! :-)

    My problem it that I don`t know at boot time how much applications I 
will need.  I want a sample web app and deploy it on X different context 
(/as1, /as2).
So I would like to have a simple application (exploded war directory) 
and deploy it X time usinng each time a different Resource (to connect 
to a different database).

So I cannot write (or think I cannot) a context.xml file neither I can 
specify a context in server.xml.  ...

I will look again into JMX, HTML or ant interface to see if I cannot 
find any Idea.

Best Regards
/David



 Shapira wrote:

> Hola,
> Why not just set autoDeploy="false" on your Host in server.xml, put
> your webapp in the appBase directory like you normally would, and use
> the manager interface (JMX, HTML, ant, your choice) to send the deploy
> command?  That way you don't have to write any code...
>
> Yoav
>
> On 5/18/06, David Gagnon <dg...@siunik.com> wrote:
>
>> Hi,
>>
>>   I want my tomcat have war unpacked on the disk.  The application will
>> only be deployed when it receives a message...
>>
>> I tried with the following code without success.  My biggest problem for
>> now is how to specify info for the jdbc connection.
>>
>> StandardContext context = new StandardContext();
>>
>> context.setDocBase("F:\\projects\\applicationServer\\var\\deploy\\base"); 
>>
>>             context.setPath("/as2");
>>             context.setCrossContext(true);
>>             context.setReloadable(false);
>>
>>             ContextResource resource = new ContextResource();
>>             resource.setName("jdbc/reference");
>>             resource.setAuth("Container");
>>             resource.setType("javax.sql.DataSource");
>>             resource.setProperty("driverClassName",
>> "org.postgresql.Driver");
>>             resource.setProperty("url",
>> "jdbc:postgresql://127.0.0.1:5432/unikommerce");
>>             resource.setProperty("username", "admin");
>>             resource.setProperty("password", "admin");
>>             resource.setProperty("maxActive", "25");
>>             resource.setProperty("maxIdle", "10");
>>             resource.setProperty("maxWait", "-1");
>>
>>             //context.getApplicationLifecycleListeners().get
>>
>> //            resource.set;
>>
>> /*
>>                     <Resource name="jdbc/unikommerce" auth="Container"
>>                               type="javax.sql.DataSource"
>> driverClassName="org.postgresql.Driver"
>>
>> url="jdbc:postgresql://127.0.0.1:5432/unikommerce"
>>                               username="admin" password="admin"
>> maxActive="25" maxIdle="10" maxWait="-1"/>
>>
>> */
>>
>>
>>             ContextConfig contextConfig = new ContextConfig();
>>             context.addLifecycleListener(contextConfig);
>>
>> //            NamingContextListener l = new NamingContextListener();
>> //            l.addResource(resource);
>> //            contextConfig.setDefaultContextXml();
>>
>> //            container.setManager();
>>             container.addChild(context);
>>
>>
>> So far the application get deployed but fail because the JDBC resource
>> is not available.
>>
>> Any help on how to do this will be greatly appreciated !
>>
>> Thanks
>> best regards
>> /David
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>
>
>



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


Re: Creating a context and deploying a new application on the fly. I tried but haven`t succeed please help :-)

Posted by Yoav Shapira <yo...@apache.org>.
Hola,
Why not just set autoDeploy="false" on your Host in server.xml, put
your webapp in the appBase directory like you normally would, and use
the manager interface (JMX, HTML, ant, your choice) to send the deploy
command?  That way you don't have to write any code...

Yoav

On 5/18/06, David Gagnon <dg...@siunik.com> wrote:
> Hi,
>
>   I want my tomcat have war unpacked on the disk.  The application will
> only be deployed when it receives a message...
>
> I tried with the following code without success.  My biggest problem for
> now is how to specify info for the jdbc connection.
>
> StandardContext context = new StandardContext();
>
> context.setDocBase("F:\\projects\\applicationServer\\var\\deploy\\base");
>             context.setPath("/as2");
>             context.setCrossContext(true);
>             context.setReloadable(false);
>
>             ContextResource resource = new ContextResource();
>             resource.setName("jdbc/reference");
>             resource.setAuth("Container");
>             resource.setType("javax.sql.DataSource");
>             resource.setProperty("driverClassName",
> "org.postgresql.Driver");
>             resource.setProperty("url",
> "jdbc:postgresql://127.0.0.1:5432/unikommerce");
>             resource.setProperty("username", "admin");
>             resource.setProperty("password", "admin");
>             resource.setProperty("maxActive", "25");
>             resource.setProperty("maxIdle", "10");
>             resource.setProperty("maxWait", "-1");
>
>             //context.getApplicationLifecycleListeners().get
>
> //            resource.set;
>
> /*
>                     <Resource name="jdbc/unikommerce" auth="Container"
>                               type="javax.sql.DataSource"
> driverClassName="org.postgresql.Driver"
>
> url="jdbc:postgresql://127.0.0.1:5432/unikommerce"
>                               username="admin" password="admin"
> maxActive="25" maxIdle="10" maxWait="-1"/>
>
> */
>
>
>             ContextConfig contextConfig = new ContextConfig();
>             context.addLifecycleListener(contextConfig);
>
> //            NamingContextListener l = new NamingContextListener();
> //            l.addResource(resource);
> //            contextConfig.setDefaultContextXml();
>
> //            container.setManager();
>             container.addChild(context);
>
>
> So far the application get deployed but fail because the JDBC resource
> is not available.
>
> Any help on how to do this will be greatly appreciated !
>
> Thanks
> best regards
> /David
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


-- 
Yoav Shapira
Nimalex LLC
1 Mifflin Place, Suite 310
Cambridge, MA, USA
yoavs@computer.org / www.yoavshapira.com

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


Creating a context and deploying a new application on the fly. I tried but haven`t succeed please help :-)

Posted by David Gagnon <dg...@siunik.com>.
Hi,

  I want my tomcat have war unpacked on the disk.  The application will 
only be deployed when it receives a message...

I tried with the following code without success.  My biggest problem for 
now is how to specify info for the jdbc connection. 

StandardContext context = new StandardContext();
            
context.setDocBase("F:\\projects\\applicationServer\\var\\deploy\\base");
            context.setPath("/as2");
            context.setCrossContext(true);
            context.setReloadable(false);

            ContextResource resource = new ContextResource();
            resource.setName("jdbc/reference");
            resource.setAuth("Container");
            resource.setType("javax.sql.DataSource");
            resource.setProperty("driverClassName", 
"org.postgresql.Driver");
            resource.setProperty("url", 
"jdbc:postgresql://127.0.0.1:5432/unikommerce");
            resource.setProperty("username", "admin");
            resource.setProperty("password", "admin");
            resource.setProperty("maxActive", "25");
            resource.setProperty("maxIdle", "10");
            resource.setProperty("maxWait", "-1");

            //context.getApplicationLifecycleListeners().get

//            resource.set;

/*
                    <Resource name="jdbc/unikommerce" auth="Container"
                              type="javax.sql.DataSource" 
driverClassName="org.postgresql.Driver"
                              
url="jdbc:postgresql://127.0.0.1:5432/unikommerce"
                              username="admin" password="admin" 
maxActive="25" maxIdle="10" maxWait="-1"/>

*/


            ContextConfig contextConfig = new ContextConfig();
            context.addLifecycleListener(contextConfig);

//            NamingContextListener l = new NamingContextListener();
//            l.addResource(resource);
//            contextConfig.setDefaultContextXml();

//            container.setManager();
            container.addChild(context);


So far the application get deployed but fail because the JDBC resource 
is not available. 

Any help on how to do this will be greatly appreciated !

Thanks
best regards
/David



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


Re: What's about unloading policy of jsp-servlets ?

Posted by Tino Schwarze <ti...@tisc.de>.
On Wed, May 17, 2006 at 05:47:16PM +0200, Remy Maucherat wrote:

> >So, what are the requirement to getting a patch accepted in tomcat 5.5?
> 
> As I said before, it is very unlikely I would accept such a patch (since 
> it would give JSP the worst of both worlds: the hassle of compilation 
> combined with the crap raw performance of templates), and for sure I 
> will veto it in the 5.5 branch.

I see no problem as far as it is switch-on and doesn't interfere with
the performance critical code paths. LRU cache for JSP servlets (with
configurable size) would be a good thing IMO.

Bye,

Tino.


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