[JBoss Seam] - Problem with forms
by koriel
I have two entity classes users and names with a onetomany relation...the problem is that when I have this names entity in my form when I hit submit nothing happens. If I have only the users in my form everything goes well. The submit action calls the registerUser.register method...anyone can explain me what am I doing wrong..?There is no error messages in jboss btw..
my register.xhtml page
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <body>
|
|
| this text won't be displayed
|
| <ui:composition template="extras/template.xhtml">
| <ui:define name="title">
| Registration Form
| </ui:define>
|
|
| <ui:define name="body">
| <h:form id="testForm">
|
| <table border="0">
| <s:validateAll>
|
|
|
|
| <tr>
| <td>Surname</td>
| <td><h:inputText value="#{names.lastname}" /></td>
| </tr>
| <tr>
| <td>FirstName</td>
| <td><h:inputText value="#{names.firstname}" /></td>
| </tr>
| <tr>
| <td>MiddleName</td>
| <td><h:inputText value="#{names.middlename}" /></td>
| </tr>
|
| <!--
| <tr>
| <td>Gender</td>
| <td><h:inputText value="#{author.gender}" /></td>
| </tr>
| <tr>
| <td>Title</td>
| <td><h:inputText value="#{author.title}" /></td>
| </tr>
| <tr>
| <td>Year Of Birth</td>
| <td><h:inputText value="#{author.yearOfBirth}" /></td>
| </tr>
| <tr>
| <td>url</td>
| <td><h:inputText value="#{author.url}" /></td>
| </tr>
| <tr>
| <td>email</td>
| <td><h:inputText value="#{author.email}" /></td>
| </tr>
| <tr>
| <td>keywords</td>
| <td><h:inputText value="#{author.keywords}" /></td>
| </tr>
| <tr>
| <td>Password</td>
| <td><h:inputText value="#{author.password}" /></td>
| </tr>
| <tr>
| <td>Retype Password</td>
| <td><h:inputText value="#{author.retypePassword}" /></td>
| </tr>
| <tr>
| <td>Secret Question</td>
| <td><h:inputText value="#{author.secretQuestion}" /></td>
| </tr>
| <tr>
| <td>Secret Answer</td>
| <td><h:inputText value="#{author.secretAnswer}" /></td>
| </tr> -->
|
| <tr>
| <td></td>
| <td><h:commandButton type="Submit" value="Submit" action="#{registerAuthor.register}" /></td>
| </tr>
| </s:validateAll>
| </table>
|
| </h:form>
|
|
|
| </ui:define>
|
| </ui:composition>
|
| </body>
| </html>
|
my ejb class
| package uai.entities;
|
| import java.io.Serializable;
|
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.JoinColumn;
| import javax.persistence.ManyToOne;
| import javax.persistence.Table;
|
| import org.hibernate.validator.NotNull;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Scope;
|
|
| @Entity
| @Table(name="names")
| @Scope(ScopeType.CONVERSATION)
| public class AuthorName implements Serializable {
|
| /**
| *
| */
| private static final long serialVersionUID = 7854278207664893998L;
| private String lastname;
| private String firstname;
| private String middlename;
| private Long id;
|
|
| @Id
| @GeneratedValue
| public Long getId() {
| return id;
| }
|
| public void setId(Long id) {
| this.id = id;
| }
|
|
| public String getMiddlename() {
| return middlename;
| }
| public void setMiddlename(String middlename) {
| this.middlename = middlename;
| }
|
| @NotNull
| public String getFirstname() {
| return firstname;
| }
| public void setFirstname(String name) {
| this.firstname = name;
| }
|
| @NotNull
| public String getLastname() {
| return lastname;
| }
| public void setLastname(String surname) {
| this.lastname = surname;
| }
|
|
|
|
|
|
| }
|
and my registerAuthor class
| package uai.blogic;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.interceptor.Interceptors;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.annotations.Create;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.core.FacesMessages;
| import org.jboss.seam.ejb.SeamInterceptor;
| import org.jboss.seam.log.Log;
|
| import uai.entities.AuthorName;
| import uai.entities.testObject;
| import static org.jboss.seam.ScopeType.EVENT;
|
| @Interceptors(SeamInterceptor.class)
| @Stateful
| @Name("registerAuthor")
| public class RegisterAuthor implements Register {
|
| @Logger
| private Log log;
|
|
|
| @In(create=true)
| private transient FacesMessages facesMessages;
|
|
|
| @In @Out
| private AuthorName authorName;
|
| //@In @Out
| //private uai.entities.AuthorUser author;
|
| @PersistenceContext
| private EntityManager em;
|
| public String register() {
|
|
| log.info("hi there");
|
| //log.info("authorname : "+this.author.getEmail());
|
| return "/registered.xhtml";
| }
|
| @Destroy
| @Remove
| public void destroy() {
| //log.info("destroyed (register)");
|
| }
|
|
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963839#3963839
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963839
19 years, 9 months
[JBossCache] - Performance Issue: DB Hit quicker then Cache
by huangjd
I am using JBoss Tree Cache as a Local read-only cache, with Hibernate.
When loading items from the cache, there seems to be no performance or a negative performance then when loading items from the DB. (Loading items from the DB are faster in most cases then loading items from the cache). And with larger cached items, the performance is .5 seconds or greater.
I can't seem to understand why this is the case. Maybe someone could point me in a direction so I can look as to why and how this is happening. maybe some tools to look at the JVM etc. . .
Thanks in advance.
Here is my Config File:
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
|
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=TreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="UseReplQueue">false</attribute>
| <attribute name="ReplQueueInterval">0</attribute>
| <attribute name="ReplQueueMaxElements">0</attribute>
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_"
| policyClass="org.jboss.cache.eviction.LRUPolicy">
| <attribute name="maxNodes">10000</attribute>
| <attribute name="timeToLiveSeconds">10000</attribute>
| </region>
| </config>
| </attribute>
| <attribute name="UseRegionBasedMarshalling">false</attribute>
|
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963833#3963833
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963833
19 years, 9 months