You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Da...@Anitefinance.com on 2003/09/04 18:17:10 UTC
Web application init parameters
How can I get hold of a web app init parameter when a page is instantiated?
The RequestCycle and the Engine are both returned as null from the page's
initialize() method. Is there another route?
David
> David Good
> Consultant
> Anite finance
> A Member of the Anite Group plc
>
> www.anitefinance.com
> DDI +44 (0)1296 710752
> Switchboard +44 (0)1296 710710
>
>
> IMPORTANT: This message may be confidential and is intended for the above
> named only. If you are not the intended recipient please notify the sender
> immediately. You must not disclose or copy the contents to a third party.
> Please note that Internet e-mail is not a fully secure communication
> medium. Any attachments to this e-mail are believed to be virus free,
> however it is the responsibility of the recipient to make the necessary
> virus checks. The views expressed in this communication are not
> necessarily those held by Anite Finance. Anite Finance reserves the right
> to monitor e-mail communications through its networks.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Web application init parameters
Posted by pa...@credit.com.
initialize() is called by the AbstractPage object's contructor which is called
when the Page pool is created upon startup.
You can access servlet config parameters only after the page is associated
with a request.
Try having your page implement PageRenderListener:
public void pageBeginRender(PageEvent pageEvent)
{
RequestCycle requestCycle = pageEvent.getRequestCycle();
RequestContext requestContext = requestCycle.getRequestContext();
Servlet servlet = requestContext.getServlet();
String parameter = servlet.getInitParameter(...);
}
Hope this helps,
Paul
On Thursday 04 September 2003 09:17, David.Good@Anitefinance.com wrote:
> How can I get hold of a web app init parameter when a page is instantiated?
> The RequestCycle and the Engine are both returned as null from the page's
> initialize() method. Is there another route?
>
> David
>
> > David Good
> > Consultant
> > Anite finance
> > A Member of the Anite Group plc
> >
> > www.anitefinance.com
> > DDI +44 (0)1296 710752
> > Switchboard +44 (0)1296 710710
> >
> >
> > IMPORTANT: This message may be confidential and is intended for the above
> > named only. If you are not the intended recipient please notify the
> > sender immediately. You must not disclose or copy the contents to a third
> > party. Please note that Internet e-mail is not a fully secure
> > communication medium. Any attachments to this e-mail are believed to be
> > virus free, however it is the responsibility of the recipient to make the
> > necessary virus checks. The views expressed in this communication are not
> > necessarily those held by Anite Finance. Anite Finance reserves the right
> > to monitor e-mail communications through its networks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Web application init parameters
Posted by Harish Krishnaswamy <hk...@comcast.net>.
I think you are not guaranteed to get Global until you reach the
Engine.service. Isn't the Engine a better place for this? Override and
super createGlobal() may be?
-Harish
Jim Frederic wrote:
> One possibility:
> Override ApplicationServlet. In the init() method, call super.init(),
> read your web.xml init-params and cache them on your tapestry Global.
> I'm assuming getGlobal() never returns null.
>
> -Jim
>
> David.Good@Anitefinance.com wrote:
>
>> How can I get hold of a web app init parameter when a page is
>> instantiated?
>> The RequestCycle and the Engine are both returned as null from the
>> page's
>> initialize() method. Is there another route?
>>
>> David
>>
>>
>>
>>> David Good
>>> Consultant
>>> Anite finance
>>> A Member of the Anite Group plc
>>>
>>> www.anitefinance.com
>>> DDI +44 (0)1296 710752
>>> Switchboard +44 (0)1296 710710
>>>
>>>
>>> IMPORTANT: This message may be confidential and is intended for the
>>> above
>>> named only. If you are not the intended recipient please notify the
>>> sender
>>> immediately. You must not disclose or copy the contents to a third
>>> party.
>>> Please note that Internet e-mail is not a fully secure communication
>>> medium. Any attachments to this e-mail are believed to be virus free,
>>> however it is the responsibility of the recipient to make the necessary
>>> virus checks. The views expressed in this communication are not
>>> necessarily those held by Anite Finance. Anite Finance reserves the
>>> right
>>> to monitor e-mail communications through its networks.
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Web application init parameters
Posted by Jim Frederic <ji...@isogen.com>.
One possibility:
Override ApplicationServlet. In the init() method, call super.init(),
read your web.xml init-params and cache them on your tapestry Global.
I'm assuming getGlobal() never returns null.
-Jim
David.Good@Anitefinance.com wrote:
>How can I get hold of a web app init parameter when a page is instantiated?
>The RequestCycle and the Engine are both returned as null from the page's
>initialize() method. Is there another route?
>
>David
>
>
>
>>David Good
>>Consultant
>>Anite finance
>>A Member of the Anite Group plc
>>
>>www.anitefinance.com
>>DDI +44 (0)1296 710752
>>Switchboard +44 (0)1296 710710
>>
>>
>>IMPORTANT: This message may be confidential and is intended for the above
>>named only. If you are not the intended recipient please notify the sender
>>immediately. You must not disclose or copy the contents to a third party.
>>Please note that Internet e-mail is not a fully secure communication
>>medium. Any attachments to this e-mail are believed to be virus free,
>>however it is the responsibility of the recipient to make the necessary
>>virus checks. The views expressed in this communication are not
>>necessarily those held by Anite Finance. Anite Finance reserves the right
>>to monitor e-mail communications through its networks.
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org