-
1. Re: seam equivalent of spring util:constant ?
diegocoronel Oct 8, 2008 10:06 PM (in response to gjeudy)Something like this?
add to your components.xml
<factory name="senhaDigitos" scope="application" auto-create="true" value="8" />
-
2. Re: seam equivalent of spring util:constant ?
gjeudy Oct 8, 2008 10:30 PM (in response to gjeudy)Yeah but that constant would come from a java class field not a literal like you posted in your example.
value=8
-
3. Re: seam equivalent of spring util:constant ?
ashokcm May 7, 2009 9:45 AM (in response to gjeudy)Did you find a way to do this?
-
4. Re: seam equivalent of spring util:constant ?
bsgcic Oct 1, 2009 9:52 AM (in response to gjeudy)It seams like I got it to work ok. The following was the only way (so far) that it has worked for me.
Constants.java
package com.mysite.util; import java.io.Serializable; import org.jboss.seam.annotations.Name; @Name("constants") public class Constants implements Serializable { public String getHELLO_WORLD() { return "hello world"; } }
components.xml
(In this file is a snippit of using the constant in a framework:restrictions setting within a framework:entity-query declaration.)
<framework:restrictions> <value>r.someAttribute = #{constants.HELLO_WORLD}</value> </framework:restrictions>
If anyone has any better ideas, I'm all ears. If not, I hope the above way is of help to folks.
-
5. Re: seam equivalent of spring util:constant ?
bsgcic Oct 1, 2009 9:56 AM (in response to gjeudy)I should mention that I am not familiar with spring and have never used it. Thus, I do not know if the code that I posted is equivalent to spring util:constant or not. The way I posted appears to work for using constants within components.xml.