[JBoss Seam] - How can I embed label value in validation error message?
by azalea
Hi,
With Hibernate Validator, I want to check input fields.
| <s:validateAll>
| ............
| <tr>
| <td>
| <h:outputLable for="firstName" value="#{messages['label.firstName']}" />
| </td>
| <td>
| <s:decorate>
| <h:inputText id="firstName" value="#{person.firstName}" />
| </s:decorate>
| </td>
| </tr>
| <tr>
| <td>
| <h:outputLable for="lastName" value="#{messages['label.lastName']}" />
| </td>
| <td>
| <s:decorate>
| <h:inputText id="lastName" value="#{person.lastName}" />
| </s:decorate>
| </td>
| ............
| </s:validateAll>
|
| @Entity
| @Name("person");
| public class Person implements Serializable {
| ......
| @Pattern(regex="^[a-zA-Z]+", message="{validator.name}")
| private String firstName;
|
| @Pattern(regex="^[a-zA-Z]+", message="{validator.name}")
| private String lastName;
| ......
| }
|
| # messages.properties(for i18n)
| validator.name=<I want to embed label value of the input field here>: Input alphabet string
|
| label.firstName=first name
| label.lastName=last name
|
When validation fails, I want to display validation error message with the label's value.
For "firstName" input field, "first name: Input alphabet string",
for "lastName", "last name: Input alphabet string".
How can I implement this?
[environment]
JBoss Seam CVS
JBoss AS 4.2.0.GA
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050717#4050717
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050717
18Â years, 10Â months
[JBoss Seam] - org.jboss.seam.core.Dispatcher startup error
by modoc
I just updated from cvs and ran ./seam update-project.
I now get the following exception during application startup:
16:50:39,109 INFO [Component] Component: org.jboss.seam.core.Dispatcher, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Dispatcher
| 16:50:39,110 ERROR [[/MinuteMail]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.RuntimeException: Could not create Component: org.jboss.seam.core.Dispatcher
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:887)
| at org.jboss.seam.init.Initialization.installComponents(Initialization.java:818)
| at org.jboss.seam.init.Initialization.init(Initialization.java:498)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:29)
....
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.Component.initMembers(Component.java:464)
| at org.jboss.seam.Component.<init>(Component.java:254)
| at org.jboss.seam.Component.<init>(Component.java:204)
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:873)
| ... 139 more
| 16:50:39,113 ERROR [StandardContext] Error listenerStart
My components.xml includes this line:
| <component name="org.jboss.seam.core.dispatcher" class="org.jboss.seam.core.Dispatcher" />
|
Any ideas?
Thanks!
Devon
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050716#4050716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050716
18Â years, 10Â months
[EJB/JBoss] - Re: No ClassLoaders found
by jijisv
Hi,
I'm also facing the same issue with JBoss 5.0.
I started getting this error wen i configured both remote and local interface in the diployment descrptor...
the error
| jboss.j2ee:jndiName=AdviserBean,service=EJB -> java.lang.ClassNotFoundException: No ClassLoaders found for: net.jjs.adviser.LocalAdviserHome
|
the descriptor:
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
| <ejb-jar>
| <enterprise-beans>
| <session>
| <display-name>Adviser Bean</display-name>
| <ejb-name>AdviserBean</ejb-name>
| <home>net.jjs.ejb.adviser.AdviserHome</home>
| <remote>net.jjs.ejb.adviser.Adviser</remote>
| <local-home>net.jjs.adviser.LocalAdviserHome</local-home>
| <local>net.jjs.adviser.LocalAdviser</local>
| <ejb-class>net.jjs.ejb.adviser.AdviserBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| </session>
| </enterprise-beans>
| <assembly-descriptor>
| <container-transaction>
| <method>
| <ejb-name>AdviserBean</ejb-name>
| <method-name>getAdvice</method-name>
| </method>
| <trans-attribute>Required</trans-attribute>
| </container-transaction>
| </assembly-descriptor>
| </ejb-jar>
|
|
any thoughts??
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050715#4050715
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050715
18Â years, 10Â months