Enumeration convertion in jsf

Hi all
I am about dealing with enumerations in my academic JSF project
so, I have an entity Employee:
package com.entities;
import com.enumeration.Gender;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
@Entity
@NamedQuery(name="Employee.findAll", query="SELECT e FROM Employee e")
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    @Column(name="nom", length=30)
    private String nom;
    @Enumerated(EnumType.STRING)
    @Column(length=1)
    private Gender gender;
    public Integer getId() {
        return id;
    public void setId(Integer id) {
        this.id = id;
    public String getNom() {
        return nom;
    public void setNom(String nom) {
        this.nom = nom;
    public Gender getGender() {
        return gender;
    public void setGender(Gender gender) {
        this.gender = gender;
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employee)) {
            return false;
        Employee other = (Employee) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        return true;
    @Override
    public String toString() {
        return "com.entities.Employee[ id=" + id + " ]";
}the enumeration:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package com.enumeration;
import java.io.Serializable;
public enum Gender implements Serializable{
    M("Male"), F("Female");
    private String description;
    private Gender(String description) {
        this.description = description;
    public String getDescription() {
        return description;
}and the index page that shows the list of employees:
<?xml version='1.0' encoding='UTF-8' ?>
<!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:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <f:view>
            <h:form>
                <h1><h:outputText value="List"/></h1>
                <h:dataTable value="#{employee.employees}" var="item" id="liste">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Id"/>
                        </f:facet>
                        <h:outputText value="#{item.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Nom"/>
                        </f:facet>
                        <h:outputText value="#{item.nom}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Gender"/>
                        </f:facet>
                        <h:outputText value="#{item.gender}"/>
                    </h:column>
                </h:dataTable>
                        <h1><h:outputText value="Create/Edit"/></h1>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Nom:" for="nom" />
                            <h:inputText id="nom" value="#{employee.newEmployee.nom}" title="Nom" />
                            <h:outputLabel value="Gender:" for="gender" />
                            <h:selectOneMenu value="#{employeeBean.newEmployee.gender}" id="gender">
                                <f:selectItem itemLabel="Male" itemValue="Male"/>
                                <f:selectItem itemLabel="Female" itemValue="Female"/>
                            </h:selectOneMenu>
                        </h:panelGrid>
                        <h:commandButton value="ajouter" action="index.xhtml" actionListener="#{employeeBean.ajouter}" />
                    </h:form>
        </f:view>
    </h:body>
</html>with the ejb associated( not included here)
the problem I am facing is to convert the field selected in the selectOneMenu to an enumeration
I did some search and I found that I have to add a converter class the faces-config.xml file, but still facing the same problem
I am sure that I missed understood something with this but cannot detect what it is wrong with
thanks for any help

here is the log content after submitting the values:
WARNING: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'PRIMARY'
Error Code: 1062
Call: INSERT INTO EMPLOYEE (ID, GENDER, nom) VALUES (?, ?, ?)
     bind => [3 parameters bound]
Query: InsertObjectQuery(com.entities.Employee[ id=1 ])
     at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
     at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:798)
     at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:864)
     at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:583)
     at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:526)
     at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1729)
     at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:234)
     at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
     at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
     at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:342)
     at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
     at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
     at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:469)
     at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
     at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
     at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:291)
     at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
     at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:808)
     at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:711)
     at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
     at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2842)
     at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1521)
     at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1503)
     at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1463)
     at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224)
     at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:123)
     at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3766)
     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1404)
     at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:616)
     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1511)
     at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3115)
     at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:331)
     at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
     at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
     at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(JavaEETransactionImpl.java:437)
     at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:867)
     at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5115)
     at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4880)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2039)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1990)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
     at $Proxy241.persist(Unknown Source)
     at com.sessionBeans.__EJB31_Generated__EmployeeFacade__Intf____Bean__.persist(Unknown Source)
     at com.beans.EmployeeBean.ajouter(EmployeeBean.java:37)

Similar Messages

  • A perfectly working servlet captcha that I want to convert to Jsf 2.0 Help

    I have a perfectly working captcha that I love to convert in to jsf 2.0. I try for 2 days with no result. I am hoping some one will
    do it and we can post it in a forum since I could not find any captcha for jsf 2.0. if you talk about the google recaptch
    I am not interested the "do not be evil company slowly growing horn and tail :)
    anyway lets go back to my progress. I'll post the full code.
    in here:
    http://pastebin.com/tnx8iJ0R
    thank you for the help..

    Hi
    Jalil Cracker,
    >>when user pres n then it must go to a form but error arises and not working good and threading is not respondin
    Could you post the error information? And which line caused this error?
    If you want to show Form1, you can use form.show() method
    Form1 frm = new Form1();
    frm.Show();
    In addition, Cosmos is an acronym for C# Open Source Managed Operating System. This is not Microsoft product.If the issue is related to Cosmos, it would be out of our support. Thanks for your understanding. And you need raise an issue at Cosmos site.
    Best regards,
    kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with default converter in JSF facelet

    Hello,
    I stuck with strange JSF java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer, when I try to use abstract class with generic. My code:
    ObjectClass.java
    public abstract class ObjectClass<T> {
        public abstract T getFieldValue();
        public abstract void setFieldValue(T fieldValue);
    }IntClass.java
    public class IntClass extends ObjectClass<Integer> {
        private Integer fieldValue;
        public Integer getFieldValue() {
            return fieldValue;
        public void setFieldValue(Integer fieldValue) {
            this.fieldValue = fieldValue;
    }TestBean.java
    @ManagedBean(name = "TestBean")
    public class TestBean {
        private IntClass intClass = new IntClass();
        public IntClass getIntClass() {
            return intClass;
    }test.xhtml
            <h:form>
                <h:outputLabel value="Integer value:" />
                <h:inputText value="#{TestBean.intClass.fieldValue}" />
                <h:commandButton type="submit"  value="Set" />
            </h:form>When I try to enter numeric value into a field and submit, I get java.lang.ClassCastException error:
    javax.faces.component.UpdateModelException: javax.el.ELException: /test.xhtml @16,68 value="#{TestBean.intClass.fieldValue}": java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
         at javax.faces.component.UIInput.updateModel(UIInput.java:839)
         at javax.faces.component.UIInput.processUpdates(UIInput.java:722)
         at javax.faces.component.UIForm.processUpdates(UIForm.java:270)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1108)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1108)
         at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1239)
         at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
         at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
         at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
         at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.el.ELException: /test.xhtml @16,68 value="#{TestBean.intClass.fieldValue}": java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
         at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:132)
         at javax.faces.component.UIInput.updateModel(UIInput.java:805)
         ... 33 more
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
         at test.IntClass.setFieldValue(IntClass.java:3)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at javax.el.BeanELResolver.setValue(BeanELResolver.java:381)
         at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:386)
         at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:100)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:197)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:286)
         at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:124)
         ... 34 moreWhen I remove [extends ObjectClass<Integer>] from class IntClass, or when I explicitly add IntegerConverter to inputText component, everything works fine. Can someone tell me, what's the problem here? Thanks.
    vide

    That looks like a doozy. My first thought is that it has something to do with reflection but that doesn't tell me what to do about it. I would consider taking it to the Mojarra development mailing list or even filing a bug report.

  • Issue in converting Struts view to JSF view using struts-faces integration

    Hi All,
    I am facing a issue in my Sruts to JSF conversion application using struts-faces.jar integration library.
    Need expert's help desperately as I am not able to use <s:form> tag in my new jsf page to call a struts action.
    I want to call a struts action from my web page designed using JSF,
    but it seems impossible without using <s:form> tag from struts-faces integration library.
    Please suggest how to resolve this...
    I am using WSAD 5.1 IDE with inbuilt Test environment WebSphere server
    JSF Version: Sun's RI 1.1
    Struts framework: 1.2.6
    Struts-Faces Integration Library version: 1.0
    I have configured a controller element in struts-config.xml file as has been suggested by different online
    documents I studied:
    <controller>
    <set-property property="processorClass"
    value="org.apache.struts.faces.application.FacesRequestProcessor"/>
    </controller>
    But configuring a controller does not allow my test server to start up properly and due to errors the ActionServlet also becomes unavailable.
    If I comment the controller and start the test server it starts fine but then I cannot access the converted jsf page which contains the <s:form action="/xxxxx.do"> tag.
    If now I get back to <h:form> tag instead of <s:form> tag with a <h:commandButton action="xxxx.do"/> for form submission in my jsf page, I see the html page generated with all components but now checking the html source generated I see
    <form action="/contextName/jspFolder/sameDisplayedPage.jsf"> which is not valid and never gets called successfully.
    I think someways I need to use the <s:form> tag with the controller configured properly to use the struts-faces integration library's request processor, to get things working. But HOW???
    Following is the error I get if I use the <controller> tag element in struts-config.xml file and start the server.
    This error appears on starting the server without accessing any application's jsp web page
    [6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
    [6/12/06 15:31:14:109 IST] 3e311815 ActionServlet E org.apache.struts.action.ActionServlet TRAS0014I: The following exception was logged java.lang.IllegalAccessError: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
    at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:198)
    at org.apache.commons.digester.Rule.begin(Rule.java:200)
    at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digester.java:1548)
    at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:736)
    at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:685)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:331)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
    at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
    at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
    at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
    at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
    at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
    at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
    at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
    at java.lang.reflect.Method.invoke(Method.java:386)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
    at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
    [6/12/06 15:31:14:188 IST] 3e311815 WebGroup E SRVE0020E: [Servlet Error]-[ActionServlet]: Failed to load servlet: javax.servlet.UnavailableException: org.apache.commons.digester.SetPropertyRule tried to access method org/apache/commons/beanutils/BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:366)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
    at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
    at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:542)
    at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1277)
    at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:283)
    at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:387)
    at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:209)
    at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:987)
    at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:136)
    at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:356)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:787)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:249)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
    at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
    at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
    at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
    at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
    at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
    at java.lang.reflect.Method.invoke(Method.java:386)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
    at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)
    (same error message re-iterates/repeats itself... and finally -
    Error 503: Failed to load target servlet [ActionServlet] comes in web-browser
    Following is the error which I get if I comment the <controller> element in the struts-config.xml file
    and use a <s:form action="xxxxx.do"> in the struts converted jsf page. The web-server starts fine, but
    accessing the jsf page givers error as:
    [6/12/06 15:38:00:781 IST] 696f19de WebGroup I SRVE0180I: [Sample Struts-JSF integration application] [training2] [Servlet.LOG]: /jsp/welcomeF.jsp: init
    [6/12/06 15:38:01:219 IST] 696f19de WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
    at org.apache.struts.faces.renderer.FormRenderer.encodeBegin(FormRenderer.java:114)
    at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
    at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:478)
    at org.apache.jsp._welcomeF._jspService(_welcomeF.java:207)
    at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:662)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at org.apache.struts.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1054)
    at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:992)
    at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:551)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:412)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
    Finally if I change my <s:form action="xxxxx.do"> tag to
    <h:form>
    <h:commandButton id="submit" action="xxxx.do" value="Submit" />
    I see the webpage coming up in the browser (no controller element used in struts-config.xml file this time)
    But in the html source of this html created from jsf I see
    <form id="_id2" method="post" action="/training2/jsp/welcomeF.faces" enctype="application/x-www-form-urlencoded">
    here form's action attribute is pointing to the same displayed page with the context name prefixed. I
    assume it is because jsf could not resolve the "xxxx.do" action to anything so set it to the same displayed page.
    May be I am wrong as usual...
    Below is the simple struts jsp page which I need to convert to jsf page as I am converting only the View part of application.
    I want to use the same struts beans and application logic at the back-end. At front-end I need UIComponents from JSF to be used.
    Following is the struts jsp page
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ taglib prefix="html" uri="/WEB-INF/lib/struts-html.tld" %>
    <%@ taglib prefix="bean" uri="/WEB-INF/lib/struts-bean.tld" %>
    <html:html>
    <html:base/>
    <html:messages id="messages" />
    <font style="color:red; font=weight:italic; font-family: century gothic">
    <html:errors/>
    </font>
    <BODY>
    <P>Sample Struts and JSF integration example</P>
    <P>This one is being displayed via Struts specific tags</P>
    <html:form action="validateUser.do">
    <bean:message key="label.name" /> : <html:text property="name" />
    <bean:message key="label.password" /> : <html:password property="password" />
    <bean:message key="label.age" /> : <html:text property="age" />
    <bean:message key="label.city" /> : <html:text property="city" />
    <bean:message key="label.address" /> : <html:text property="address" />
    <html:submit property="submit" value="Show info via Struts" />
    </html:form>
    </BODY>
    </html:html>
    I have converted it into the following jsf page
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://struts.apache.org/tags-faces" prefix="s" %>
    <f:view>
    <HTML><BODY>
    <f:verbatim><P>Sample Struts and JSF integration example</P></f:verbatim>
    <f:verbatim><P>This one is being displayed via JSF tags</P></f:verbatim>
    <h:form> <!-- Want to use s:form tag instead of this h:form tag -->
    <h:inputText id="name" value="#{userForm.name}" /><f:verbatim>
    </f:verbatim>
    <h:inputSecret id="password" value="#{userForm.password}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="age" value="#{userForm.age}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="city" value="#{userForm.city}" /><f:verbatim>
    </f:verbatim>
    <h:inputText id="address" value="#{userForm.address}" /><f:verbatim>
    </f:verbatim>
    <h:commandButton id="submit" action="#{user.facesAction}" value="Show info via Struts" />
    </h:form>
    </BODY></HTML>
    </f:view>
    I am very hopeful of some answer from respected group experts, please help me.
    I am in urgency of course but would not push for immed. response like other, just want some help for sure that is going to
    be extremely valuable to me. Anticipating a helping hand...
    Thanks and Regards
    Vishal Sharm
    Time's fun when you're having flies � Kermit, the Frog
    -------------------------------------------------------------------------

    I've managed to get this working Ok from JDeveloper:
    See:
    http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=573FDB6F8D918B9704907899635CABB1.txt
    http://www.groundside.com/blog/content/DuncanMills/J2EE+Development/?permalink=2B04ACE99A6437EDED775F15553D1DED.txt
    Basically you just have to fiddle around with Library settings to get this working OK.
    As to how useful this is, well that's up to you - I'd not regard Faces + Struts as a must use combination, rather it's a can mix if you really need to. Look at Faces and Faces navigation first and see if that actually gives you enough before you start to look at mixing.

  • Convert JSF Page to PDF

    i need to convert a JSF Page into a PDF Document .
    any ideas how to do that?

    SACHINLINUX wrote:
    BalusC wrote:
    Why are you hijacking other's topic and acting like you're the topic starter? You're rude.Mr Balu. kindly tell the solution if you have instead of dictating rules. As far as rudeness concern i never seen a person rude like you.
    Sachin KokchaMr Sachin Mr. BalusC is tellign right thing it is not your topic as well as you are telling that you have only one login name. So no need to act like the topic starter.
    Every forum has it's own rules so please kindly obey these rules.
    Gantu

  • Convert to enumeration

    I want to convert an integer number to an enumeration (linked to a typdef) and then wire to the selector of a case structure.
    It is easier to read the code when the case displays the labels in text instead of numbers.
    When I use the  "type cast" this is terrible slow on the realtime target. Why? To my opinion that should be just a reinterpretation of the data, nothing to do during runtime.
    On the FPGA targets the "type cast" is not available somehow. Why?
    in 8.2 I found somehow a special integer to enumeration converter under the add-ons menue (probably from the supervisory and control). In 8.5 I can not find it anymore and I can not copy it from one VI to another.
    Hello, hello!! Did I miss something or am I the only one that has nice typedefs of enumerations (for example for statemachines) and have to convert a integer to an enumerator?

    Hi Fritz,
    I am either not following you or you are onto simething I want to know more about.
    What kind of target are you uisng and are you saying you are taking anoticable performance hit from code like this?
    Could you post some example code that demonstrates your concern so we can take a closer look, please?
    Regarding the ";DNI_IntToEnum.vi" VI that dwisti mentioned.
    Yes that comes with the SDE and is used to type cast the iteration count to the target states. Rumour has it that it and any other VI that is named such that it starts with ";D" is Jeff K winking at you.
    Ben
    Message Edited by Ben on 10-14-2007 11:13 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    typecast.PNG ‏21 KB

  • ConverterTag / ConverterELTag in JSF 1.2

    I am trying to understand how to properly write a converter in JSF 1.2. ConverterTag has been deprecated and "partially" replaced by ConverterELTag. Creating the converter is now "an implementation detail".
    What does that mean for the hapless JSF programmer who needs to implement a converter tag?
    Am I expected to duplicate the code in com.sun.faces.taglib.jsf_core.ConverterTag? Or should I just ignore bindings and converter IDs and make a new instance of my converter class?
    Thanks,
    Cay

    Unfortunately and as you already stated it is not in JSF 1.2 so if you really need this your only real option is to override the FacesContextFactory to create your own version of it with the functionality you require.

  • Using a Converter on a date field

    Hi all. I’m having a problem using a converter in JSF. I’m pulling a lot of information from a database and throwing it all on a page. I’ve set up a custom converter for all my values that are of a String type. This converter basically says “if there is something in this variable, put it on the page, otherwise, put ‘N/A’ on the page”. The code for this converter is below:
         public String getAsString(FacesContext context, UIComponent component,
                   Object value)
              String stringValue = value.toString().trim();
              return StringUtils.isNotBlank(stringValue) ? stringValue : "N/A";
    ...This code works. I’m having trouble doing the exact same thing for date fields. If I run it through the same converter, then it will show me the date if there is one, but if there isn’t anything in the variable, it just gives me nothing. No date, no “N/A”, nothing. I’ve seen that there is a separate converter called DateTimeConverter, but it looks like this is basically just used to format the date.
    Anybody know how I can get this working?

    I'm still having this problem if anyone has any ideas. When I run it in debug, the value that's getting sent is "". There is a separate DateTimeConverter, but all it seems to do is format a date. I can't see a way to spit out a "N/A" if there isn't one.

  • Where is JSF Native Bridge located?

    I created JSF web application that used JSF 1.2 and facelets 1.1.1. Now I am trying to convert the JSF web application to a JSF portlet. [ I extended WebLogic server 11g to support WSRP]
    According to WebLogic 10g Release 3 (10.3.2) [Chapter 8: Working with JSF Port portlets] JSF Native Bridge would be used by WebLogic. However, only WSRP 2.0 bridge is available in my weblogic installation and that is what I used [./wlportal_10.3/light-portal/lib/j2ee-modules/maintenance/1032/default/wlp-jsf-portlet-bridge-2.0-web-lib.war]. This version is clearly not compatible according to weblogic documentation [because I am using facelets 1.1.1].
    I deployed the portlet that I created in a Weblogic Server [extended to support WSRP] but when a consumer portal tried to use the portlet as remote portlet, URLs to javaScripts and images are causing 404 [not found] errors in access.log of the consumer portal. There is no such problem when the portlet is accessed in the producer portlet.
    Is it possible that bridge incompatibilities is causing the problem? Where can I get the correct bridge?
    Any ideas?

    Hello,
    Are you running WebLogic Portal 10.3.2, or just WebLogic Server with WSRP support? The wlp-jsf-portlet-bridge-2.0-web-lib.war contains the JSR329 (JSF 1.2 to Java Portlet 2.0) bridge, but this will not work on WebLogic Server without a full installation of WebLogic Portal.
    The "native" JSF portlet bridge (which supports JSF 1.1) ships with the "simple" WSRP producer as part of the normal libraries (inside wlp-wsrp-producer-web-lib.war). You would need to include a library for the version of JSF you wanted.
    So because you need JSF 1.2 and facelets 1.1.1 (which isn't supported by JSR329), I am not sure there is a fix to your problem, without adjusting one of the technology versions you are using. The problem is that some of the JSF toolkits, especially older versions, don't always use the URL rewriting facilities required to render links properly so that they will go through the consumer proxy portlet. This is why you are seeing the 404 errors for javascript and images when bringing the portlet up in a browser-- the URLs on the page are written as though they are local links to the producer directly, when in fact they need to go through a proxy servlet on the consumer to get access to the proper JavaScript or images on the producer.
    Kevin

  • JSF 2 composite comp. backing class: what can I use for the decode method?

    Hello, everybody!
    I want to convert a JSF 1.2 custom component to a JSF 2.0 composite component. This JSF 1.2 custom component uses a renderer where I take some actions in the decode method. So, I would like to know what I could use to replace the well known decode method when writing a backing class for a JSF 2.0 composite component.
    Thank you.
    Marcos
    Edited by: Marcos_AntonioPS on May 21, 2010 11:59 AM

    Let's try with org.havi.ui.HStaticText

  • Suggestion for the JSF framework team.

    We Neeeeeeeeeeeeed tiles/template system in JSF :(
    btw i Hate .net and C# and etc ( and microsoft ) but today i was on the lounch of the new microsoft products CLR 2.0 C# 2.0 bla bla Visual Studio 2005 , Sql 2005 .. etc..
    i see that in ASP.net now there is tiles system it`s called "MASTERs" or somethink like it .. its nice easy to use not like struts tiles in JSF ( i was going crazy until i make them work ).
    So please people SUN rox , Java ROX , JSF RooooooX but we(or I) need template system

    Thanks Jacob,
    Unfortunately I still can't find how to get rid of
    all these <ui:insert name="title"> and
    <ui:define name="body">
    <h:form id="helloForm">
    Could somebody point me on??
    Denis Krukovsky
    http://write-software.blogspot.com/
    Facelets allows the use of jsfc, so in the above example:
    <span jsfc="ui:insert" name="title">Example Title</span>
    <span jsfc="ui:insert" name="body">Example Body</span>
    <form jsfc="h:form" id="helloForm">...You can even experiment with custom decorators which will automatically convert HTML->JSF tags at compilation time.

  • How to obtain the row data in the component datatable?

    if I want to edit a row data, and then know which row is edited in the component datatable, and how to do?
    How to obtain the row data in the component datatable, and update it to database, not simplely edit a simple table
    Any ideas? Thanks

    Thank you very much for your help Alexander !
    It's quite confusing when you leave Struts and try to adapt your projects for JSF for the first time...
    I wanted to click on a row with a "onMouseClick" on the TR tag like I used to do in Struts/JSTL. But it seems to be impossible in a dataTable.
    Ok then. I've added a column at the end of the row with an icon.
    But eventually I didn't need to declare link parameters.
    In my BackingBean I did like this :
    public String selectEventForUpdate() throws IllegalAccessException, InvocationTargetException {
            PortletAgenda event = (PortletAgenda) JSFUtils.getInRequestMap("event");
            BeanUtils.copyProperties(this, event);
            return null;
       }JSFUtils.getInRequestMap(...) is a method I wrote in a util object :
    public static Object getInRequestMap(String name) {
            Object res = null;
            Map requestMap=FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
            if (requestMap!=null) {
                res=requestMap.get(name);
            return res;
    }  " event " is the name of the item in my dataTable list.
    My backingBean has the same attributes as "event".
    So when the page is reloaded I have a backingBean full with the selected properties to edit/update.
    Thanks to your reply I realized that putting this form in the middle of the dataTable seems to be impossible.
    So I put this form in a floating DIV in front of the table with a shadow.
    It works :o) !
    But I'm a little bit disapointed to be honest...
    I used to build my web applications with Struts and JSTL and doing this kind of interface was really easy.
    I've decided 3 days ago to convert into JSF because the "GUI Layer" seemed to be improved.
    But now I realize that I cannot put a onMouseOver and onMouseClick on a row and I cannot display a different row in the middle of a table....
    I think it's a shame because there is a facet for header and footer.
    And it would be great if we could create our own personal facet that appears only if a condition is true.
    For exemple " if the current item id is the same as the request parameter id then display the following facet content ....... (with a panel group and a form inside to update the row) "
    It's easy to do that with JSTL thanks to c:forEach and c:if but it seems to be impossible to use JSTL tags like this during the dataTable iteration.
    And JSF tags seems to have no logical tags like " if " or loops that can be nested in dataTable.
    I really need to realize this interface (you click on a row then an edit form appears where you clicked).
    Do I have to write a component myself that extends dataTable?
    Do you know if writing such a component is hard to do for a beginner like me?
    (I've juste discovered JSF 3 days ago and I've used Struts/JSTL for 2 years til now)
    I'd be glad to have much advices from you about that.
    Regards

  • Deployment is failing on creating web service proxy in portlet.

    Hi All,
    I am using a JDeveloper 11.1.1.2.0.
    1) I have created a application (portlet producer application), which contains few jsf pages (not jspx).
    2) I have added a web service proxy ( using New>Business tier>Web services>web service proxy, provided a wsdl) for accesing a service which is exposed on different server.
    The above combination works perfectly fine.
    But When I convert the JSF pages to portlet (right click on JSF page and select create portlet entry option), and tried to run it throws following error.
    Note: soainvgpkg is the package which is generated when I create a web service proxy.
    It is generated under application resources.
    ++[11:04:31 AM] Redeploying Application...++
    ++<Aug 5, 2011 11:04:34 AM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1312522471750' for task '0'. Error is: 'java.lang.NoClassDefFoundError: WEB-INF/classes/soainvgpkg/Execute_ptt (wrong name: soainvgpkg/Execute_ptt)'++
    ++java.lang.NoClassDefFoundError: WEB-INF/classes/soainvgpkg/Execute_ptt (wrong name: soainvgpkg/Execute_ptt)++
    ++     at java.lang.ClassLoader.defineClass1(Native Method)++
    ++     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)++
    ++     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)++
    ++     Truncated. see log file for complete stacktrace++
    ++Caused By: java.lang.NoClassDefFoundError: WEB-INF/classes/soainvgpkg/Execute_ptt (wrong name: soainvgpkg/Execute_ptt)++
    ++     at java.lang.ClassLoader.defineClass1(Native Method)++
    ++     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)++
    ++     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)++
    ++     Truncated. see log file for complete stacktrace++
    ++>++
    ++<Aug 5, 2011 11:04:34 AM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'PortletProducer_Application'.>++
    ++<Aug 5, 2011 11:04:34 AM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004++
    ++java.lang.NoClassDefFoundError: WEB-INF/classes/soainvgpkg/Execute_ptt (wrong name: soainvgpkg/Execute_ptt)++
    ++     at java.lang.ClassLoader.defineClass1(Native Method)++
    ++     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)++
    ++     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)++
    ++     Truncated. see log file for complete stacktrace++
    ++Caused By: java.lang.NoClassDefFoundError: WEB-INF/classes/soainvgpkg/Execute_ptt (wrong name: soainvgpkg/Execute_ptt)++
    ++     at java.lang.ClassLoader.defineClass1(Native Method)++
    ++     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)++
    ++     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:344)++
    ++     at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:301)++
    ++     Truncated. see log file for complete stacktrace++
    ++>++
    ++[11:04:34 AM] #### Deployment incomplete. ####++
    ++[11:04:34 AM] Remote deployment failed++
    It works fine if I again remove the portlet entry and delete the portlet.xml and oracle-portlet.xml which were generated during portlet conversion time which is nothing but a normal JSf application.
    Please help,
    Thanks and regards,
    Kemp.
    Edited by: 877449 on Aug 4, 2011 11:33 PM

    Hi All,
    Facing same issue...
    Any solution
    Thanks & Regards,
    renuka

  • JDeveloper 11.1.1.3: Best Practice for Checkboxes in Table

    Hi there,
    I'm having problems with checkboxes inside the table component.
    Can someone please fill me in as to what the best practice is to use checkboxes inside a table ?
    In the database, we are storing values Y and N.
    Thanks,
    Mark

    Hi Mark,
    I suppose you are talking about ADF Faces applications. If so, then I have two prefered approaches tested and used in real practice:
    *1) First approach: Create a simple converter, define it in the faces-config.xml and set it in the <af:selectBooleanCheckbox> tags' "converter" attribute, for example:*
    package mypackage;
    import javax.faces.application.FacesMessage;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    public class BooleanYNConverter implements Converter {
      public BooleanYNConverter() {
      public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String string) {
        if (string==null) return null;
        String s = string.trim();
        if (s.length()==0) return null;
        if (s.equalsIgnoreCase("true")) return "Y";
        if (s.equalsIgnoreCase("false")) return "N";
        FacesMessage errorMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,
            "Cannot convert " + string + " to Y/N. It must be either true or false",
            "Cannot convert " + string + " to Y/N. It must be either true or false" );
        throw new ConverterException(errorMessage);
      public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object object) {
        if (object == null) return "";
        if (object.equals("Y")) return "true";
        if (object.equals("N")) return "false";
        FacesMessage errorMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,
            "Cannot convert " + object + " to true/false. It must be either Y or N",
            "Cannot convert " + object + " to true/false. It must be either Y or N" );
        throw new ConverterException(errorMessage);
    }In faces-config.xml:
      <converter>
        <converter-id>BooleanYNConverter</converter-id>
        <converter-class>mypackage.BooleanYNConverter</converter-class>
      </converter>In JSF page:
    <af:selectBooleanCheckbox ... converter="BooleanYNConverter"/>
    N.B. If you use this approach, the ViewObject attribute's Control Type should be set to "Default" instead of "Checkbox" (see the attribute's Control Hints section in the dialog box)!
    *2) Second approach: In the PageDef define a button binding for Y/N values and map the corresponding item in the table binding to this button binding. In this way you will remap VO attribute's Y/N value to true/false as how the checkbox component expects it. Neither converters nor additional configuration is necessary, but you have to do this on each checkbox field again:*
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.1.56.60" id="TestPagePageDef" Package="view.pageDefs">
      <parameters/>
      <executables>
        <variableIterator id="variables"/>
        <iterator Binds="DeptViewRO" RangeSize="25" DataControl="AppModuleDataControl" id="DeptViewROIterator"/>
      </executables>
      <bindings>
        <tree IterBinding="DeptViewROIterator" id="DeptViewRO">
          <nodeDefinition DefName="model.DeptViewRO" Name="DeptViewRO0">
            <AttrNames>
              <Item Value="DeptID"/>
              <Item Value="DeptName"/>
              <Item Value="Flag" Binds="MyFlag"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
        <button IterBinding="DeptViewROIterator" StaticList="true" id="MyFlag">
          <AttrNames>
            <Item Value="Flag"/>
          </AttrNames>
          <ValueList>
            <Item Value="Y"/>
            <Item Value="N"/>
          </ValueList>
        </button>
      </bindings>
    </pageDefinition>In the sample above the target VO attribute is called Flag. Have a look at the line <tt><Item Value="Flag" Binds="MyFlag"/></tt>. This line does the magic.
    Hope I've been a bit helpful.
    Dimitar
    Edited by: Dimitar Dimitrov on Nov 13, 2010 1:53 PM
    There was a little mistake: Instead of BooleanYNConverter I had written BooleanYNCheckbox in the <af:selectBooleanCheckbox> tag.

  • H:selectOneMenu value binding to managed bean property

    Please help. Cannot figure out why selectOneMenu value binding is not working...
    The main contents of my jsp:
         <h:form id="form1" rendered="true">
              <P>
                   <h:selectOneMenu value="#{MBListBoxExample.selectedProject}" rendered="true"
                        required="false">
                        <f:selectItems value="#{MBListBoxExample.items}" />
                   </h:selectOneMenu>
              </P>
              <h:commandButton value="ShowSelected" rendered="true" action="#{MBListBoxExample.showSelected}" />
         </h:form>I have a managed bean with a property that is basically a custom object:
    private Project selectedProject;The selectOneMenu gets populated with the following code in my managed bean:
         public List getItems() {
              try {
                   ArrayList projectList = new ArrayList ();
                   projectList.add(new Project(1, "Project 1"));
                   projectList.add(new Project(2, "Project 2"));
                   projectList.add(new Project(3, "Project 3"));
                   projectList.add(new Project(4, "Project 4"));
                   ArrayList itemList = new ArrayList();
                   for (int x=0; x<projectList.size(); x++) {
                        SelectItem tempItem = new SelectItem();
                        Project tempProj = (Project) projectList.get(x);
                        tempItem.setLabel(tempProj.getName());
                        tempItem.setValue(tempProj);
                        itemList.add(tempItem);
                   return itemList;
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return null;
         }The following code is tied to my command button to display some simple output when the button is clicked:
         public void showSelected() {
              System.out.println("The selected item is: " + selectedProject.getName());
         }If I set the value of the SelectItem (tempItem) above to a String and make the selectedProject variable of type String, the code works.
    My goal is to have the items in the list reference 'Project' objects and be able to get to the selected object when the user clicks the command button.
    Any help is greatly appreciated.

    The problem is that you're missing a converter. JSF needs to convert your values from Strings into Projects and vica verca.
    When you do the form submission the values are passed as strings along with the labels. JSF isn't smart enough to convert them automatically.

Maybe you are looking for