You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan Checkoway <dc...@gmail.com> on 2011/07/04 21:46:06 UTC

EL system properties...possible to override per context?

I have two webapps that need to run under the same instance of tomcat.  One
needs COERCE_TO_ZERO=true, and the other needs COERCE_TO_ZERO=false.  By the
looks of it...

http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Expression_Language

...I can only pick one behavior per tomcat instance.  Is there any way this
behavior could be controlled or overridden at the Context level instead of
system-wide?

Dan

Re: EL system properties...possible to override per context?

Posted by Mark Thomas <ma...@apache.org>.
On 05/07/2011 13:54, Dan Checkoway wrote:
> Thanks for the reply, Mark.  I realize tomcat is just conforming to the spec
> (rightly so), but I happen to disagree with the spec (jsp/el, not tomcat) in
> this one area.  Empty form fields being treated as "set to 0" is what I
> consider buggy...since we're throwing the term "buggy" around.  :-)
> 
> "Run two Tomcat instances" is something I could do, but you have to admit
> it's a brute force solution to a simple problem.
> 
> I see the same sort of suggestion got shot down about a year ago:
> 
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48813
> 
> I understand wanting (insisting, for that matter) to isolate the EL parser
> from the servlet API.  Seems to me it would be nice if there was a choice
> between:
> - one EL parser is instantiated per engine (default behavior, parser shared
> among all contexts)
> - one EL parser is instantiated per context (and can be configured
> separately)
> 
> The EL parser itself wouldn't have to know anything about the servlet
> engine.  I believe the change would simply involve, for the most part,
> eliminating static variables (such as the one in question,
> AstValue.COERCE_TO_ZERO).  Moving those statics to an ELParserConfiguration
> type object might be the ticket?
> 
> Is that a reasonable request?

The request is reasonable. Bug 48813 didn't get closed because it was
unreasonable, the OP closed it as they found an alternative solution.

> What if I'm willing to help code it?  :-)

Since Tomcat is specification compliant, this would be an enhancement
and enhancement requests with patches always stand a better chance than
those without.

Keep in mind the following constraints:
- You can't change the javax.el API
- javax.el can't have any external dependencies
- Jasper can't depend directly on org.apache.el
- org.apache.el must not have any external dependencies

That list isn't exhaustive, but it gives you the general idea.

Mark



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


Re: EL system properties...possible to override per context?

Posted by Dan Checkoway <dc...@gmail.com>.
Thanks for the reply, Mark.  I realize tomcat is just conforming to the spec
(rightly so), but I happen to disagree with the spec (jsp/el, not tomcat) in
this one area.  Empty form fields being treated as "set to 0" is what I
consider buggy...since we're throwing the term "buggy" around.  :-)

"Run two Tomcat instances" is something I could do, but you have to admit
it's a brute force solution to a simple problem.

I see the same sort of suggestion got shot down about a year ago:

https://issues.apache.org/bugzilla/show_bug.cgi?id=48813

I understand wanting (insisting, for that matter) to isolate the EL parser
from the servlet API.  Seems to me it would be nice if there was a choice
between:
- one EL parser is instantiated per engine (default behavior, parser shared
among all contexts)
- one EL parser is instantiated per context (and can be configured
separately)

The EL parser itself wouldn't have to know anything about the servlet
engine.  I believe the change would simply involve, for the most part,
eliminating static variables (such as the one in question,
AstValue.COERCE_TO_ZERO).  Moving those statics to an ELParserConfiguration
type object might be the ticket?

Is that a reasonable request?  What if I'm willing to help code it?  :-)

Thanks,
Dan

On Mon, Jul 4, 2011 at 4:04 PM, Mark Thomas <ma...@apache.org> wrote:

> On 04/07/2011 20:46, Dan Checkoway wrote:
> > I have two webapps that need to run under the same instance of tomcat.
>  One
> > needs COERCE_TO_ZERO=true, and the other needs COERCE_TO_ZERO=false.  By
> the
> > looks of it...
> >
> >
> http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Expression_Language
> >
> > ...I can only pick one behavior per tomcat instance.  Is there any way
> this
> > behavior could be controlled or overridden at the Context level instead
> of
> > system-wide?
>
> Short answer: no.
>
> Changing the source code to support this might be possible but given
> where the configuration value would be used and where it would be set
> there isn't an API available to pass the setting. That is going to make
> things very tricky if not impossible. If the code to do this is as ugly
> as I think it will be then the patch is likely to be vetoed anyway.
>
> Given that the app that requires COERCE_TO_ZERO=false is not
> specification compliant, does that give you any leverage to get the
> developers to fix their buggy code?
>
> I suspect the immediate answer is to run two Tomcat instances.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: EL system properties...possible to override per context?

Posted by Mark Thomas <ma...@apache.org>.
On 04/07/2011 20:46, Dan Checkoway wrote:
> I have two webapps that need to run under the same instance of tomcat.  One
> needs COERCE_TO_ZERO=true, and the other needs COERCE_TO_ZERO=false.  By the
> looks of it...
> 
> http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Expression_Language
> 
> ...I can only pick one behavior per tomcat instance.  Is there any way this
> behavior could be controlled or overridden at the Context level instead of
> system-wide?

Short answer: no.

Changing the source code to support this might be possible but given
where the configuration value would be used and where it would be set
there isn't an API available to pass the setting. That is going to make
things very tricky if not impossible. If the code to do this is as ugly
as I think it will be then the patch is likely to be vetoed anyway.

Given that the app that requires COERCE_TO_ZERO=false is not
specification compliant, does that give you any leverage to get the
developers to fix their buggy code?

I suspect the immediate answer is to run two Tomcat instances.

Mark



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