I've closed Jeppe's ticket.  Why?

WebKit depends on util.  Props (where the runmode is defined) is in util, so
there would be a circular reference if LiftRules was used to calculate the
runmode.

Further, util can be used outside of the context of WebKit/Boot.  We want to
encourage that.

So, creating a "mode calculation function" that's consulted during the
evaluation of the run mode in props makes sense.  But this function has to
be set super duper uper mooper early in the app initialization cycle because
the run mode is calculated in order to figure out which property file to
load and this is done the first time a property is accessed.

Put another way, if we do a "calculation function", it's going to be the
first thing that needs to be set in Boot.  Then there's going to be
confusion.

It might be just as easy for the OP to write a mock filter that's
initialized before the Lift filter which does System.setProperty("run.mode",
....)


On Mon, Feb 22, 2010 at 7:03 AM, Indrajit Raychaudhuri
<[email protected]>wrote:

>
> On 22/02/10 3:22 PM, Indrajit Raychaudhuri wrote:
>
>> Given that setting initParams is the usual webapp idiom, should we not
>> consider that at all? That would have served the purpose for Petr.
>>
>> So the calcRunMode could roughly have something like:
>>
>> customRunMode or context.initParam("run.mode") or
>> Box.!!(System.getProperty("run.mode"))
>>
>> with provision for having customRunMode customized heartily.
>>
>
> On second thought, the order probably should be other way round.
>
> Box.!!(System.getProperty("run.mode")) or context.initParam("run.mode") or
> customRunMode
>
> -Drun.mode=... is more transient (and suitable for fast mode switching
> during development) than static definition in the code and thus to be tried
> first.
>
>
>
>> Cheers, Indrajit
>>
>>
>> On 22/02/10 1:50 PM, Jeppe Nejsum Madsen wrote:
>>
>>> On Mon, Feb 22, 2010 at 8:48 AM, Heiko Seeberger
>>> <[email protected]> wrote:
>>>
>>>> Folks,
>>>> I really do not understand the value of setting the run mode
>>>> statically via
>>>> code in LiftRules. The run mode should be set externally, right? In
>>>> order to
>>>> use the same artifact (WAR) on a dev or a prod server.
>>>> Heiko
>>>>
>>>
>>> Agreed. This was more so that people could change how "externally" is
>>> defined, ie in a hosted env you can't change system properties.
>>>
>>> The default would still be the current lookup in system properties,
>>> but you could change this to look at servlet params, hostname, day of
>>> month etc :-)
>>>
>>> /Jeppe
>>>
>>>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

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

Reply via email to