[JBoss Seam] - Re: always got data model update error when enum happens in
by ellenzhao
Voila! Thanks for the hint and now it is working perfectly.
My solution is based on hotchai's solution here:
http://jroller.com/page/hotchai?entry=jsf_converter_for_jdk_1
(I am using Seam 1.1 beta 2 and all the example source code are from Seam 1.1 beta 2 as well)
The EnumConverter class can be used as it is, no need to modify and it simply works.
Here is my Enum classes:
| public class User implements Serializable {
| // same as the booking sample
| public static enum Gender{
| FEMALE("female"), MALE("male");
| private String label;
|
| Gender(String label){
| this.label = label;
| }
|
| public String getLabel(){
| return this.label;
| }
| }
|
| public static enum Title {
| DR("Dr."), MS("Ms."), MR("Mr."), MRS("Mrs.");
| private String label;
|
| Title(String label) {
| this.label = label;
| }
|
| public String getLabel() {
| return this.label;
| }
| }
| }
|
| here is the code from backing bean:
|
| @Stateful
| @Scope(EVENT)
| @Name("register")
| public class RegisterBacking implements Register {
| //...
| private SelectItem[] titleItems;
| private SelectItem[] genderItems;
|
| //... same as the booking example
| public SelectItem[] getTitleItems() {
| this.titleItems = new SelectItem[Title.values().length];
| int i = 0;
| for (Title t : Title.values()) {
| this.titleItems[i++] = new SelectItem(t, t.getLabel());
| }
| return this.titleItems;
| }
|
| public SelectItem[] getGenderItems() {
| this.genderItems = new SelectItem[Gender.values().length];
| int i = 0;
| for (Gender g : Gender.values()) {
| this.genderItems[i++] = new SelectItem(g, g.getLabel());
| }
| return this.genderItems;
| }
| }
|
| The code in register.xhtml:
|
| <div class="entry">
| <div class="label"><h:outputLabel for="title">Title:</h:outputLabel></div>
| <div class="input"><s:decorate>
| <h:selectOneMenu id="title" value="#{guest.title}" required="true">
| <f:selectItems value="#{register.titleItems}" />
| </h:selectOneMenu>
| <br />
| </s:decorate></div>
| </div>
|
| <div class="entry">
| <div class="label"><h:outputLabel for="gender">Gender:</h:outputLabel></div>
| <div class="input"><s:decorate>
| <h:selectOneMenu id="gender" value="#{guest.gender}"
| required="true">
| <f:selectItems value="#{register.genderItems}" />
| </h:selectOneMenu>
| <br />
| </s:decorate></div>
| </div>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987942#3987942
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987942
19Â years, 5Â months
[JBoss Portal] - Re: JBoss portal Passwords are encrypted. -- How do i decry
by bmcgovern
By the way, this is my login-config.xml and hashAlgorithm doesnt work. But Programmatically converting string to MD5 does. Any ideas?
| <application-policy name="portal">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
| <module-option name="dsJndiName">java:/PortalDS</module-option>
| <module-option name="principalsQuery">SELECT jbp_password FROM jbp_users WHERE jbp_uname=?</module-option>
| <module-option name="rolesQuery">SELECT jbp_roles.jbp_name, 'Roles' FROM jbp_role_membership INNER JOIN jbp_roles ON jbp_role_membership.jbp_rid = jbp_roles.jbp_rid INNER JOIN jbp_users ON jbp_role_membership.jbp_uid = jbp_users.jbp_uid WHERE jbp_users.jbp_uname=?</module-option>
| <module-option name="hashAlgorithm">MD5</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987941#3987941
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987941
19Â years, 5Â months
[JCA/JBoss] - Re: Oracle 10g Fast Connection Failover
by bocio
"weston.price(a)jboss.com" wrote : This, as well as TAF are Oracle specific features that are only applicable to using an Oracle specific connection pool and the OCI driver.
| **This feature cannot be enabled using JBoss/JCA**
|
I agree,
We have many Oracle RAC installations. When we use a J2EE AS in front the database, TAF or FCF are disabled because you get some of these functionalities directly form the AS.
On a POJO application we always use thin driver, FCF and connection cache.
Anyway TAF is available only with OCI driver while FCF is available only on thin driver.
Regardin JCA and Vendor specific features. Well... :-) we are speaking of Oracle, not BingoBongoDB. Sometimes you are forced by thousand reasons to use it. JBoss JCA implementation gives you a handle:
getUnderlyingConnection()
What I find strange is that whenever someone ask about this method, an
excommunication is launched!
Terrible things could happen using it! You go blind...
So if you wrote this method, why you did not give us a way to notify the WrappedConnection that I want to close or destroy the underlying connection?
If you give an handle, give a complete one...
Bye
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987937#3987937
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987937
19Â years, 5Â months
[JBoss Seam] - pojo.identifierProperty undefined error in CR1 release
by maniappan
Hi,
I am trying the seam-gen with the latest release CR1 and getting the error trace pasted below.
Any help in fixing this issue will be appreciated.
Mani.
| [hibernate] 2. task: generic exportertemplate: view/list.xhtml.ftl
| [hibernate] Nov 22, 2006 10:05:37 PM freemarker.log.JDK14LoggerFactory$JDK14Logger error
| [hibernate] SEVERE:
|
| [hibernate] Expression pojo.identifierProperty is undefined on line 47, column 85 in view/list.xhtml.ftl.
| [hibernate] The problematic instruction:
| [hibernate] ----------
| [hibernate] ==> ${pojo.identifierProperty.name} [on line 47, column 83 in view/list.xhtml.ftl]
| [hibernate] ----------
|
| [hibernate] Java backtrace for programmers:
| [hibernate] ----------
| [hibernate] freemarker.core.InvalidReferenceException: Expression pojo.identifierProperty is undefined on line 47, column 85 in view/list.xhtml.ftl.
| [hibernate] at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987936#3987936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987936
19Â years, 5Â months