This content has been marked as final.
Show 6 replies
-
1. Re: Can I define some
matt.drees Aug 29, 2007 10:40 AM (in response to anescu)You probably want
<factory name="providerUrl" value="localhost:1099" scope="stateless" auto-create="true"/>
The auto-create means you can use @In instead of @In(create=true).
You can specify a different scope if you want. -
2. Re: Can I define some
anescu Aug 29, 2007 10:48 AM (in response to anescu)I want something like "application scope". Just a damn constant, the same value for everyone.
I read the reference for Seam, I saw the factory examples, but I did not find yet any example on how to actually read the values in code. Probably there are, somewhere :).
I'll see if I can get my code to work... -
3. Re: Can I define some
fernando_jmt Aug 29, 2007 11:10 AM (in response to anescu)I have somethig like this:
<component name="sysConfig" auto-create="true" class="com.myapp.SystemConfig" scope="APPLICATION"> <property name="rowsPerPage">5</property> <property name="fileUrl">whateverpath</property> </component>
@In SystemConfig sysConfig;
-
4. Re: Can I define some
matt.drees Aug 29, 2007 11:27 AM (in response to anescu)"anescu" wrote:
I want something like "application scope". Just a damn constant, the same value for everyone.
Stateless will do that, too. Stateless means that it doesn't get stored in a scope, so any time something asks for that variable (injection, el, whatever), it will re-evaluate the value expression in the < factory >. Which in your case is a constant.
And yeah, just use @In. It's all the same kind of stuff. You can inject any kind of contextual variable. -
5. Re: Can I define some
stu2 Aug 29, 2007 6:55 PM (in response to anescu)Btw take a look at the wiki example. There's a pretty nice example of doing exactly this.
-
6. Re: Can I define some
anescu Aug 30, 2007 2:58 AM (in response to anescu)Thanks guys,
I made it work. For now just some String values, but I will probably transform them into a "config" class.