[JBoss Seam] - Can a var be updated from @Resource and a regular JSF form
by cingram
I have a var that is in one of my SFSB. The value is set from 1 of 2 sources. Either it is passed in on the URL, or it is set from a JSF entry page. The problem I am coming across is once I set the @RequestParameter annotation on the var it is no longer updated from the JSF page. It is however updated from the URL. If I remove the annotation it is can be updated from the page but obviously it won't be updated from the URL. I assume this happens because it isn't on the URL and gets over written with a null from the injection. Is it possible to have a var that is updated from both a JSF page and a url annotation? Am I doing some thing wrong?
The code is very simple
| @RequestParameter(value="pid")
| private String myVar;
|
in the JSF page
| <h:inputText id="value" required="true" value="#{manager.myVar}"/>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028061#4028061
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028061
19Â years, 1Â month
[JBoss Seam] - How to deal with this outjection scenario.
by xigua
Class1 instantiates Class2 then calls a init() method on Class2.
Both Class1 and Class2 need access to an object. Ideally, Class1 will instantiate the object and outject to the coversation, the Class2 just inject it and use it. However, it doesn't seem to work and my understanding is that they are in the same request and the outjection happens at the end of invoke application phase. So my questions are:
1. When does outjection happen? (end of invoke app?)
2. If two classes outjects the same object, which order will the outjection happen so that one will overwrite the other?
3. Any suggestions on how to deal with this scenario? (Certainly I can initialize the object in class1 then pass to class2 as a parameter, however, the idea is that class1 doesn't know what class2 can do. Class1 actually might initialize multiple classes.)
Thanks in advance,
xigua
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028057#4028057
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028057
19Â years, 1Â month
[Clustering/JBoss] - Re: get partition(cluster)
by bstansberryï¼ jboss.com
I haven't looked at it carefully, but what you wrote seems valid. FYI, here's how org.jboss.ha.jmx.HAServiceMBeanSupport finds its partition. I know this query works and finds the partition. This could be modified to exclude matching on an expected partition name, etc.
| protected HAPartition findHAPartitionWithName(String name) throws Exception
| {
| log.debug("findHAPartitionWithName, name="+name);
| HAPartition result = null;
| QueryExp classEQ = Query.eq(Query.classattr(),
| Query.value(ClusterPartition.class.getName()));
| QueryExp matchPartitionName = Query.match(Query.attr("PartitionName"),
| Query.value(name));
| QueryExp exp = Query.and(classEQ, matchPartitionName);
| Set mbeans = this.getServer().queryMBeans(null, exp);
| if (mbeans != null && mbeans.size() > 0)
| {
| ObjectInstance inst = (ObjectInstance) (mbeans.iterator().next());
| ClusterPartitionMBean cp =
| (ClusterPartitionMBean) MBeanProxyExt.create(
| ClusterPartitionMBean.class,
| inst.getObjectName(),
| this.getServer());
| result = cp.getHAPartition();
| }
|
| if( result == null )
| {
| String msg = "Failed to find HAPartition with PartitionName="+name;
| throw new InstanceNotFoundException(msg);
| }
| return result;
| }
There's no general facility that lists all the deployed partitions; the JMX query approach is what you have to do.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028055#4028055
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028055
19Â years, 1Â month
[JBoss Seam] - Problem with length validator on inputtext
by idylle
Hi,
I'm using seam 1.2.0PATCH1 with a PostgreSQL Base.
I've got a problem with Validator Length.
Here is my entity code :
@Column(name = "colaff", nullable = false, length = 1)
| @NotNull
| @Length(max = 1)
| public char getColaff() {
| return this.colaff;
| }
Here is my page code :
<h:outputLabel for="colaff">
| colaff
| <span class="required">*</span>
| </h:outputLabel>
| <s:decorate id="colaffDecoration">
| <h:inputText id="colaff"
| required="true"
| value="#{collectivitesHome.instance.colaff}">
| <a:support event="onblur" reRender="colaffDecoration" />
| </h:inputText>
| </s:decorate>
The inputtext "colaff" has to be filled with one character.
I fill it with one character but I can't validate my form, I have a message "colaff length should be between 0 and 1". If I put a javascript alert to verify the value and length of the input, I have just one character, no hidden character seams to be added to what I typed.
I really don't understand what's wrong, do you any idea for me please?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028042#4028042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028042
19Â years, 1Â month