[Resin-interest] AppScope variable in Resin.XML

2010-10-20 Thread Aaron Freeman
  Is there a simple way to set an applicationScope variable from within 
the resin.xml?

I see how to set system properties, but I'd like something I can 
reference from a JSP like:

${applicationScope.var}

Or can I reference the system properties similarly?

Thanks,

Aaron





___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Aaron Freeman
  Bah I stumbled on this, but it doesn't appear to do what I was hoping:

context-param
param-namebaz/param-name
param-valuevalue/param-value
/context-param

When I tried to reference that in a test.jsp like this, it is empty:

%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
html
p-${applicationScope.baz}-/p
/html

Any other way to do this?

Thanks,

Aaron



On 10/20/2010 12:09 PM, Aaron Freeman wrote:
Is there a simple way to set an applicationScope variable from within
 the resin.xml?

 I see how to set system properties, but I'd like something I can
 reference from a JSP like:

 ${applicationScope.var}

 Or can I reference the system properties similarly?

 Thanks,

 Aaron





 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest





___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Scott Ferguson
Aaron Freeman wrote:
   Bah I stumbled on this, but it doesn't appear to do what I was hoping:

 context-param
 param-namebaz/param-name
 param-valuevalue/param-value
 /context-param

 When I tried to reference that in a test.jsp like this, it is empty:

 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
 html
 p-${applicationScope.baz}-/p
 /html

 Any other way to do this?
   
Hmm. I'd forgotten that context-param is application.getInitParam.

You can use ${initParam.baz} to get the context-param value.

I can't remember any way to set the application attributes directly from 
the config file, although we could enhance resin:set to allow for 
var=#{application.bar}.

-- Scott
 Thanks,

 Aaron



 On 10/20/2010 12:09 PM, Aaron Freeman wrote:
   
Is there a simple way to set an applicationScope variable from within
 the resin.xml?

 I see how to set system properties, but I'd like something I can
 reference from a JSP like:

 ${applicationScope.var}

 Or can I reference the system properties similarly?

 Thanks,

 Aaron





 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest


 



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Aaron Freeman
  On 10/20/2010 12:39 PM, Scott Ferguson wrote:
 Aaron Freeman wrote:
Bah I stumbled on this, but it doesn't appear to do what I was hoping:

 context-param
 param-namebaz/param-name
 param-valuevalue/param-value
 /context-param

 When I tried to reference that in a test.jsp like this, it is empty:

 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
 html
 p-${applicationScope.baz}-/p
 /html

 Any other way to do this?

 Hmm. I'd forgotten that context-param is application.getInitParam.

 You can use ${initParam.baz} to get the context-param value.

 I can't remember any way to set the application attributes directly from
 the config file, although we could enhance resin:set to allow for
 var=#{application.bar}.

 -- Scott

A coworker stumbled upon ${initParam.baz} -- the only unfortunate thing 
about that is, we are trying to do this:

context-param baz=${varWePassedIn}/

And when we dump ${initParam.baz} it renders literally as 
${varWePassedIn} instead of the value of ${varWePassedIn}.

The resin:set solution sounds great.  Would this be more intuitive:

resin:set var=bar value=${passedInValue} scope=application/

Where you reference a scope instead of have the #{application.bar} syntax?

Thanks,

Aaron



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] AppScope variable in resin.xml

2010-10-20 Thread Scott Ferguson
Aaron Freeman wrote:
   On 10/20/2010 12:39 PM, Scott Ferguson wrote:
   
 Aaron Freeman wrote:
 
Bah I stumbled on this, but it doesn't appear to do what I was hoping:

 context-param
 param-namebaz/param-name
 param-valuevalue/param-value
 /context-param

 When I tried to reference that in a test.jsp like this, it is empty:

 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
 html
 p-${applicationScope.baz}-/p
 /html

 Any other way to do this?

   
 Hmm. I'd forgotten that context-param is application.getInitParam.

 You can use ${initParam.baz} to get the context-param value.

 I can't remember any way to set the application attributes directly from
 the config file, although we could enhance resin:set to allow for
 var=#{application.bar}.

 -- Scott
 

 A coworker stumbled upon ${initParam.baz} -- the only unfortunate thing 
 about that is, we are trying to do this:

 context-param baz=${varWePassedIn}/
   

Can you try servlet-allow-el/ before that context-param? That should 
enable the EL evaluation.
 And when we dump ${initParam.baz} it renders literally as 
 ${varWePassedIn} instead of the value of ${varWePassedIn}.

 The resin:set solution sounds great.  Would this be more intuitive:

 resin:set var=bar value=${passedInValue} scope=application/

 Where you reference a scope instead of have the #{application.bar} syntax?
   
The problem is that resin:set doesn't actually know about web-apps 
because it's a generic high-level configuration tag.  The EL expression 
would work because resin:set can evaluate things in context, and the 
web-app context would know about the application scope.

-- Scott
 Thanks,

 Aaron



 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest