[JBoss Seam] - Re: selectOneMenu and commandButton conflict
by grdzeli_kaci
"petemuir" wrote : You've probably got errors occuring on the coversion, validation or update model phase. Put an h:messages component on the page to see.
hi petemuir,
u're right i put h:messages into login page and i got an error like this :
| . value could not be converted to the expected type
|
i wrote my own converter as you told me
| @Transactional
| public Converter getApplicationConverter() {
| return new Converter() {
|
| @Transactional
| public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException {
| if (arg2 == null) {
| return null;
| }
| try {
| return ((EntityManager) Component.getInstance("entityManager")).find(Application.class, Integer.valueOf(arg2));
| } catch (NumberFormatException e) {
| throw new ConverterException("Cannot Find Selected Language", e);
| }
| }
|
| @Transactional
| public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) throws ConverterException {
| if (arg2 instanceof Language) {
| Application application = (Application) arg2;
| return application.getName().toString();
| } else {
| return null;
| }
| }
|
| };
| }
|
here is my entity bean :
| @Entity
| @Table(name = "APPLICATION",schema="BillAdmin")
| @Name("application")
| @Scope(ScopeType.SESSION)
| public class Application implements Serializable {
|
| @Id
| @Column(name = "APPLICATION_ID", nullable = false)
| private BigDecimal applicationId;
|
| @Column(name = "NAME")
| private String name;
|
| @Column(name = "CODE")
| private BigInteger code;
|
| @Column(name = "DESCRIPTION")
| private String description;
|
| @Column(name = "REMARK")
| private String remark;
|
| @Column(name = "REC_STATUS")
| private BigInteger recStatus;
|
| @Column(name = "USER_ID")
| private BigInteger userId;
|
| @Column(name = "REG_DATE")
| @Temporal(TemporalType.DATE)
| private Date regDate;
|
| @Column(name = "UPD_DATE")
| @Temporal(TemporalType.DATE)
| private Date updDate;
|
| @OneToMany(cascade = CascadeType.ALL, mappedBy = "applicationId")
| private Collection<ApplicationsConfig> applicationsConfigCollection;
|
| public Application() {
| }
|
| public Application(BigDecimal applicationId) {
| this.applicationId = applicationId;
| }
|
| public BigDecimal getApplicationId() {
| return this.applicationId;
| }
| public void setApplicationId(BigDecimal applicationId) {
| this.applicationId = applicationId;
| }
|
| public String getName() {
| return this.name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| public BigInteger getCode() {
| return this.code;
| }
| public void setCode(BigInteger code) {
| this.code = code;
| }
|
| public String getDescription() {
| return this.description;
| }
|
| public void setDescription(String description) {
| this.description = description;
| }
|
| public String getRemark() {
| return this.remark;
| }
|
| public void setRemark(String remark) {
| this.remark = remark;
| }
|
| public BigInteger getRecStatus() {
| return this.recStatus;
| }
|
| public void setRecStatus(BigInteger recStatus) {
| this.recStatus = recStatus;
| }
|
| public BigInteger getUserId() {
| return this.userId;
| }
| public void setUserId(BigInteger userId) {
| this.userId = userId;
| }
| public Date getRegDate() {
| return this.regDate;
| }
| public void setRegDate(Date regDate) {
| this.regDate = regDate;
| }
| public Date getUpdDate() {
| return this.updDate;
| }
| public void setUpdDate(Date updDate) {
| this.updDate = updDate;
| }
| public Collection<ApplicationsConfig> getApplicationsConfigCollection() {
| return this.applicationsConfigCollection;
| }
| public void setApplicationsConfigCollection(Collection<ApplicationsConfig> applicationsConfigCollection) {
| this.applicationsConfigCollection = applicationsConfigCollection;
| }
| @Override
| public int hashCode() {
| int hash = 0;
| hash += (this.applicationId != null ? this.applicationId.hashCode() : 0);
| return hash;
| }
| @Override
| public boolean equals(Object object) {
| if (!(object instanceof Application)) {
| return false;
| }
| Application other = (Application)object;
| if (this.applicationId != other.applicationId && (this.applicationId == null || !this.applicationId.equals(other.applicationId))) return false;
| return true;
| }
|
| @Override
| public String toString() {
| return "com.magti.seam.beans.billAdmin.Application[applicationId=" + applicationId + "]";
| }
| }
|
can u tell me why i got this error ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019308#4019308
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019308
19Â years, 2Â months
[Performance Tuning] - Re: JBoss Performance Tuning
by obobogo
Hi all,
I am facing big problems with jboss 3.2.7.
we have :
2 big Ip
3 Hp DL 320 with (1 Go Ram 3.2 Ghz, 1 Cpu) apache web server
4 Hp DL 580 with (14 Go Ram 3.2 Ghz, 2 Cpu) Jboss App server
4 Hp DL 740 with (18 Go Ram 3.2 Ghz, 4 Cpu) Oracle
OS : Linux Redhat
JDK 1.4.2_13
We have a J2EE application with struts, torque, Ejb, jsp, servlet, ....oracle database. This application is used to cash customer, we are not able to manage approximatively 48000 transaction/hours.
After one hour of cashing, we have to reboot the server to free the memory, if you make a top on your linux console you will see that only 2 Go of memory are used. Please can u give me advised to fine tune my server such to improve the quality of service to customer.
We have sales point in a 500 000 Km2 and this is creating big commercial issues, i have a support contrat with jboss and we are planing other actions.
Before this does some body can advise me one fine tuning or advise me to upgrade AS, WS version if needed.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019301#4019301
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019301
19Â years, 2Â months
[JBoss Seam] - selectOneMenu and commandButton conflict
by grdzeli_kaci
seam version : 1.1.6 GA
i have login page and i want use identity class for jaas. also into login page i have selectOneMenu component for languages which is filled from database,
when i cklick on login button nothing happend(did not call autenticator.autenticate method),
if i remove filling of the selectOneMenu component all works fine :(
can anybody help me ?
1. components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components
| xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:framework="http://jboss.com/products/seam/framework"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd"
| >
| <framework:entity-query name="languages" ejbql="select l from Language l" />
| <framework:entity-query name="applications" ejbql="select a from Application a" />
|
| <core:init debug="true" jndi-pattern="@jndiPattern@"/>
|
| <core:manager concurrent-request-timeout="500"
| conversation-timeout="120000"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr"/>
|
| <core:pages no-conversation-view-id="/home.xhtml"/>
|
| <core:managed-persistence-context name="entityManager"
| persistence-unit-jndi-name="java:/MagtiBillingEntityManagerFactory"/>
|
| <core:ejb installed="@embeddedEjb@"/>
|
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>/security.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <security:identity authenticate-method="#{authenticator.authenticate}"/>
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
| <!-- For use with jBPM pageflow or process management -->
| <!--
| <core:jbpm>
| <core:process-definitions></core:process-definitions>
| <core:pageflow-definitions></core:pageflow-definitions>
| </core:jbpm>
| -->
|
| </components>
|
2.login page
| <h:form>
| <table width="400" cellpadding="5" cellspacing="0" style="border: 1px solid #9e2629">
| <tr>
| <td class="LogonText" colspan="2" align="center">Login to System</td>
| </tr>
| <tr>
| <td class="td_new">
| <table width="100%" cellpadding="5" cellspacing="0" border="0">
| <tr>
| <td class="td_new" rowspan="5"><h:graphicImage value="/images/login_pic.gif"/></td>
| <td class="td_new">UserName</td>
| <td class="td_new">
| <h:inputText styleClass="font_style" value="#{identity.username}"/>
| </td>
|
| </tr>
|
| <tr>
| <td class="td_new">Password</td>
| <td class="td_new">
| <h:inputSecret styleClass="font_style" value="#{identity.password}"/>
| </td>
|
| </tr>
|
| <tr>
| <td class="td_new">Application</td>
| <td class="td_new">
| <!--
| <h:selectOneMenu styleClass="font_style" value=""/>
| -->
| <h:selectOneMenu styleClass="font_style" value="#{application.name}" converter="#{converters.applicationConverter}">
| <s:selectItems value="#{applications.resultList}" var="application" label="#{application.name}"/>
| </h:selectOneMenu>
|
| </td>
|
| </tr>
|
| <tr>
| <td class="td_new">Language</td>
| <td class="td_new">
| <h:selectOneMenu styleClass="font_style" value=""/>
| <!--
| <h:selectOneMenu styleClass="font_style" value="#{language.name}" converter="#{converters.languageConverter}">
| <s:selectItems value="#{languages.resultList}" var="language" label="#{language.name}" />
| </h:selectOneMenu>
| -->
| </td>
|
| </tr>
| <tr>
| <td class="td_right" colspan="2">
| <h:commandButton id="LoginBtn"
| name="LoginBtn"
| class="Btn2"
| value="Login"
| onblur="return this.myonblur();"
| onfocus="return this.myonfocus();"
| onmouseout="return this.myonmouseout();"
| onmouseover="return this.myonmouseover();"
| action="#{identity.login}"
| />
| <script type="text/javascript"><!--
| sjwuic_assign_button('loginForm:LoginBtn', defaultButtonStrings, true, false, false);
| //--></script>
| </td>
| <!--actionListener="" -->
| </tr>
| </table>
| </td>
| </tr>
| <tr>
| <td class="td_new" colspan="2"></td>
| </tr>
| <tr>
| <td class="td_new" colspan="2"></td>
| </tr>
| </table>
| </h:form>
|
when i commented both of the h:selectOneMenu component after login click the page redirected to another, and if i uncomment one of them button does not work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019300#4019300
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4019300
19Â years, 2Â months