dev@jsftemplating.java.net

Re: JSFTemplating: button problem

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Tue, 16 Jan 2007 17:58:44 -0800

Karam Singh Badesha wrote:
> Hi,
> I have the following code and its causing some problems:
>
> <sun:button id="generateButton"
> text="#{msgs.button_generateText}"
> *primary="true" *
>
> disabled="#{ButtonBean.generateDisabled}"
>
> actionListenerExpression="#{ButtonBean.generateActionListener}"
>
> actionExpression="#{ButtonBean.actionHandler}"
>
> toolTip="#{msgs.button_generateText}" />
You need to specify primary as a boolean. Try

primary="$boolean{true}"

Anissa.

>
> Seems like there is something that I am missing or there is a real
> problem. Browser gives the following message:
>
> *exception*
>
> javax.servlet.ServletException: argument type mismatch
>
> *root cause*
>
> java.lang.IllegalArgumentException: argument type mismatch
>
> Please let me know whats wrong. If I take out the above code, it works
> fine. I have already defined the ButtonBean in faces-config.xml.
>
> From the server log:
>
> [#|2007-01-16T17:11:28.218-0800|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;_RequestID=80a6599d-64d0-4a80-8fe2-27a8e1131832;|StandardWrapperValve[FacesServlet]:
> Servlet.service() for servlet FacesServlet threw exception
> java.lang.IllegalArgumentException: argument type mismatch
> 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:585)
> at
> javax.faces.component.UIComponentBase$AttributesMap.put(UIComponentBase.java:1593)
>
> at
> com.sun.jsftemplating.component.factory.ComponentFactoryBase.setOption(ComponentFactoryBase.java:147)
>
> at
> com.sun.jsftemplating.component.factory.ComponentFactoryBase.setOptions(ComponentFactoryBase.java:92)
>
> at
> com.sun.jsftemplating.component.factory.sun.ButtonFactory.create(ButtonFactory.java:74)
>
> at
> com.sun.jsftemplating.component.ComponentUtil.createChildComponent(ComponentUtil.java:399)
>
> at
> com.sun.jsftemplating.layout.descriptors.LayoutComponent.getChild(LayoutComponent.java:273)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:345)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:360)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:360)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:360)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:360)
>
> at
> com.sun.jsftemplating.layout.LayoutViewHandler.createView(LayoutViewHandler.java:177)
>
> at
> com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:218)
>
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
> at
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
>
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
>
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
>
> at
> com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
>
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
> at
> com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
>
> at
> com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
>
> at
> com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
>
> at
> com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
>
> at
> com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
>
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
> at
> com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
>
>
> -Karam