On 20 ún, 16:03, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> aw <anth...@whitford.com> writes:
> > On Feb 18, 9:14 am, Petr Pudlak <petr....@gmail.com> wrote:
> >> Second, it's impossible to run different lift applications with
> >> different run modes in a single
> >> servlet container.
>
> > I have sympathy for your first point, but am suspicious about the
> > second point.  I generally don't recommend running applications in
> > different "modes"/environments on a single servlet container because
> > you run the risk that a destabilizing factor in Dev or QA could impact
> > a Production system, for example.  A dev servlet container instance
> > that hosted just dev instances, for example, would make sense, but
> > these would share the same run.mode.

Well, I must admit you're right. But still it would be nice to have
the freedom to decide.

>
> >> Generally, I believe that a *Java web application shouldn't be
> >> configured by JVM system properties*. I suggest that the run mode
> >> should be configured by a servlet context initialization parameter,
> >> called for example "lift.run.mode". Or, for maximum flexibility, both
> >> alternatives should be provided.
>
> > Servlet context initialization parameters break down because the
> > servlet configuration is baked into the artifact, yet the goal is to
> > run the same artifact across several environments.  (Sure, there are
> > things like the global web.xml, but if you can't access system
> > properties, I don't see how you will change the global web.xml.)
>
> > Any other ideas?
>
> Some servlet containers (eg Jetty, Tomcat) allow a context to override
> servlet context initialization parameters externally from the war...

Yes, this is what I meant. Tomcat, for example, allows to alter
servlet context initialization parameters in a deployment descriptor
[1]. This is how I imagine it should work. The deployer of an
application can choose the run mode independently of the developer
(packager), but the settings affects just the single application, not
the whole JVM.

[1] http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Context
Parameters

> I'm not sure if this is too late in the boot cycle, but one simple
> solution would be to have a LiftRules.calculateRunMode

If I understand it correctly, you suggest to have a function-type
field that could be set in the Boot class and which would be called to
calculate the run mode. That would be nice, a developer would be able
to choose whatever means (s)he would prefer.

Another possibility would be to add another method to the Boot class,
which would calculate the run mode. It would be less nice than the
previous solution, but it could be called before the 'boot' method, if
that would be required.

Petr

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to