[JBoss Seam] - Facelets: Parameters to custom tags
by MSchmidke
Hello,
I am using MyFaces / Facelets / Seam.
Can I inject the attributes of a custom tag into my bean?
I've written a custom tag with tag file:
| <tag>
| <tag-name>kontoname</tag-name>
| <source>kontoname.xhtml</source>
| </tag>
|
kontoname.xhtml:
| <ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:t="http://myfaces.apache.org/tomahawk"
| >
|
| <ui:repeat value="#{liste.angezeigteSpalten}" var="spalte">
| <td class="auftragszelle">
| <h:outputText value="#{kontoname.wert}" />
| </td>
| </ui:repeat>
| <td class="auftragszelle">
| ?
| </td>
| </ui:component>
|
I'm calling this tag with arguments:
| <le:kontoname konto="#{kontozeile_iter}" liste="#{leistungsschein.kontozeilen}" />
|
The Tag is using a Java bean:
| @SuppressWarnings("serial")
| @Scope(ScopeType.APPLICATION)
| @Name("kontoname")
| public class Kontoname implements Serializable{
|
| private @In(required=false) Kontowrapper konto;
| private @In(required=false) Anzeigespalte spalte;
|
| public String getWert() {
| if (spalte==null) return "Keine Spalte angegeben";
| if (konto==null) return "Kein Konto angegeben";
| return spalte.getWertInObjekt(konto);
| }
|
| }
|
Unfortunately, this does not work. Accessing the "liste" argument from within the tag file is no problem, but accessing the "konto" argument from within the JavaBean isn't possible.
Can I do anything to get the parameter injected?
Thank you!!
Regards,
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959055#3959055
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959055
19 years, 9 months
[Installation, Configuration & Deployment] - Re: Converting from jboss 4.0.3 to 4.0.4... Deploy
by jactor
I found the reason for the non-deployment, and I know hope to get some tips on how to fix it.
According to the trailblazer:
anonymous wrote : All the EJB 3.0 libraries and server-wide configuration files are located in the [server_installation]/server/default/deploy directory...
| * The ejb3.deployer/META-INF/persistence.properties file configures the default database for all entity beans and EntityManager in this server. The default is the server's embedded HSQLDB database.
| * The ejb3-clustered-sfsbcache-service.xml file contains the MBean configuration for the JBoss Cache service that replicates stateful session beans in a cluster.
| * The ejb3-entity-cache-service.xml file contains the MBean configuration for the JBoss Cache service that caches and replicates entity bean objects in a cluster.
|
When you run the 'all' configuration on the installer, this is not a part of the deployment. I get the ejb3.deployer if I run the ejb configuration on top of the all configuration, but then there is error logging of components allready beeing deployed... I do not need the cluster service and the caching is not necessary, but could be an asset. How do get the all configuration working with ejb3 but with the all configuration?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959052#3959052
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959052
19 years, 9 months
[EJB 3.0] - env-entry injection in a @Service EJB
by rene@xinit.org
Hi,
I would ask how I can do an env-entry injection into an jboss @Service EJB? There are many examples how this can be done with session beans and also message driven bean. But I could not find anything how to inject a primary type resource into a @Service EJB.
I have the following test service:
| @Service
| public class MyTestServiceBean implements MyTestService {
|
| @Resource(name = "maxValue") public int maxValue = 10;
|
| public MyTestServiceBean() {
| System.out.println("MAX_VALUE: " + maxValue);
| }
|
| public void test() {
| // ...
| }
|
| }
|
In ejb-jar.xml I tried something like this (which I didn't really expected to work)
| <ejb-jar>
| <enterprise-beans>
| <env-entry>
| <env-entry-name>maxValue</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| <env-entry-value>1000</env-entry-value>
| </env-entry>
| </enterprise-beans>
| </ejb-jar>
|
I also tried many variations with <injection-target> and setting this stuff in jboss.xml. But nothing worked so far.
Thanks in advance,
René
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959049#3959049
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959049
19 years, 9 months