Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Store Initial Parameters from web.xml
Store Initial Parameters from web.xml [message #117589] Tue, 06 January 2009 10:55 Go to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

Hi,


when starting my application i want to read some values from the web.xml an store them with application scope.
my question is, what would be suitable to use? i need a store which doesn't need a ui-session because i want to
call it when starting the app, would using the PluginPreferenceStore be a proper way to do that?
moreover i'd like to ask, whether the Activator start() method is a common way to 'initialize' the plugin with
values from the web.xml? the values don't have to be stored persistent, restarting the app will cause a reload,
that's a wanted behaviour.

thx in common.

greetings,
ben
Re: Store Initial Parameters from web.xml [message #118299 is a reply to message #117589] Mon, 12 January 2009 13:29 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Ben W. wrote:
> Hi,
>
>
> when starting my application i want to read some values from the web.xml
> an store them with application scope.
Just out of curiosity, how do you *read* values from the web.xml?
From what I know, the web.xml is not intended to be read.

> my question is, what would be suitable to use? i need a store which
> doesn't need a ui-session because i want to
> call it when starting the app, would using the PluginPreferenceStore be
> a proper way to do that?
Use a pref store only if the values should be persisted.

> moreover i'd like to ask, whether the Activator start() method is a
> common way to 'initialize' the plugin with
> values from the web.xml? the values don't have to be stored persistent,
> restarting the app will cause a reload,
> that's a wanted behaviour.
Activator#start() is a good place to do application-wide initialization.

>
> thx in common.
>
> greetings,
> ben
Re: Store Initial Parameters from web.xml [message #118317 is a reply to message #118299] Mon, 12 January 2009 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

Hi Rüdiger,


with reading the web.xml i mean extracting some parameters. i contribute some environment variables, e.g. to make the connection to the database.
i couldn't manage to use a JNDI DataSource so far with RAP so i still connect manually with the DriverManager#getConnection().

now i'm using the Activator#getPluginPreferences() to store non-ui relevant application wide values and for the workbench (session) scope i use
Activator#getPreferenceStore(). actually i'm using utility classes which provide static getter and setter for the values, but the underlying containers
are those mentioned above. works quit well for now.


by the way, if there are any tutorials or howtos about using a JNDI DataSource with RAP (to be more specific: using the servletbridge) i'd be grateful for
some pointers. i'd like to define the DataSource completely in the web.xml, without touching the context.xml oder server.xml of the underlying servlet container.
i couldn't figure out how to do this until now, nevertheless i'm already using the BridgeServlet classloader "hack" to access the web.xml.


greetings,
ben





Rüdiger Herrmann schrieb:
> Ben W. wrote:
>> Hi,
>>
>>
>> when starting my application i want to read some values from the
>> web.xml an store them with application scope.
> Just out of curiosity, how do you *read* values from the web.xml? From
> what I know, the web.xml is not intended to be read.
>
>> my question is, what would be suitable to use? i need a store which
>> doesn't need a ui-session because i want to
>> call it when starting the app, would using the PluginPreferenceStore
>> be a proper way to do that?
> Use a pref store only if the values should be persisted.
>
>> moreover i'd like to ask, whether the Activator start() method is a
>> common way to 'initialize' the plugin with
>> values from the web.xml? the values don't have to be stored
>> persistent, restarting the app will cause a reload,
>> that's a wanted behaviour.
> Activator#start() is a good place to do application-wide initialization.
>
>>
>> thx in common.
>>
>> greetings,
>> ben
Re: Store Initial Parameters from web.xml [message #118335 is a reply to message #118317] Mon, 12 January 2009 15:36 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Ben W. wrote:
> Hi Rüdiger,
>
>
> with reading the web.xml i mean extracting some parameters. i contribute
> some environment variables, e.g. to make the connection to the database.
> i couldn't manage to use a JNDI DataSource so far with RAP so i still
> connect manually with the DriverManager#getConnection().
>
> now i'm using the Activator#getPluginPreferences() to store non-ui
> relevant application wide values and for the workbench (session) scope i
> use
> Activator#getPreferenceStore(). actually i'm using utility classes which
> provide static getter and setter for the values, but the underlying
> containers
> are those mentioned above. works quit well for now.
>
>
> by the way, if there are any tutorials or howtos about using a JNDI
> DataSource with RAP (to be more specific: using the servletbridge) i'd
> be grateful for
> some pointers. i'd like to define the DataSource completely in the
> web.xml, without touching the context.xml oder server.xml of the
> underlying servlet container.
> i couldn't figure out how to do this until now, nevertheless i'm already
> using the BridgeServlet classloader "hack" to access the web.xml.
I am not aware of such a tutorial...

>
>
> greetings,
> ben
>
>
>
>
>
> Rüdiger Herrmann schrieb:
>> Ben W. wrote:
>>> Hi,
>>>
>>>
>>> when starting my application i want to read some values from the
>>> web.xml an store them with application scope.
>> Just out of curiosity, how do you *read* values from the web.xml? From
>> what I know, the web.xml is not intended to be read.
>>
>>> my question is, what would be suitable to use? i need a store which
>>> doesn't need a ui-session because i want to
>>> call it when starting the app, would using the PluginPreferenceStore
>>> be a proper way to do that?
>> Use a pref store only if the values should be persisted.
>>
>>> moreover i'd like to ask, whether the Activator start() method is a
>>> common way to 'initialize' the plugin with
>>> values from the web.xml? the values don't have to be stored
>>> persistent, restarting the app will cause a reload,
>>> that's a wanted behaviour.
>> Activator#start() is a good place to do application-wide initialization.
>>
>>>
>>> thx in common.
>>>
>>> greetings,
>>> ben
Re: Store Initial Parameters from web.xml [message #118362 is a reply to message #118317] Tue, 13 January 2009 08:39 Go to previous message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
>> with reading the web.xml i mean extracting some parameters. i
contribute some environment variables, e.g. to make the connection to the
database.
>> i couldn't manage to use a JNDI DataSource so far with RAP so i still
connect manually with the DriverManager#getConnection().

We just but a simple 'db.properties' right beside the 'web.xml'.

As we don't use OSGI our classloader-setup might be simpler of course, but
can't you have a bundle, which only contains property-files ?
Doesn't equinox support unpacked bundles, so that you'd have easy access
to those files ?

Regards,
Stefan
Previous Topic:Problem with toolbar
Next Topic:Equinox - Jetty - Rap - Default Page - Index.html
Goto Forum:
  


Current Time: Thu Apr 25 01:06:19 GMT 2024

Powered by FUDForum. Page generated in 0.02930 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top