Custom tags or Custom Beans

In a web application project using model 2 to encapsulate layers of application which one is batter
jsp tags or javabeans ?
What do u thing about their advantages and disadvantages. Because i think that both are reuseable and platform independent. Thanks for all comments.

hmm .. maybe I should describe my problem a little more in detail.
Let's say I have a servlet CheckServlet, a Custom Tag CheckTag, a java bean CheckBean
If I place the classes in WEB-INF/classes folder, tomcat cannot find the CheckTag class. Same thing with the javabean.
The moment I make the CustomTag class a part of Check package and place the class file in the folder WEB-INF/classes/Check, it will work. I have noticed the same behaviour with javabeans.
I had a look at the _jsp file that is generated. The line CheckBean check = null; is where the exception is thrown. (check, I am assuming, is the bean name in the jsp).
Thanks again.
Nimod.

Similar Messages

  • Populating a table with two columns using a custom bean

    hello,
    Can someone provide me or give me a link to an example of populating a table (with two columns) with a custom bean?
    thank you
    fwu

    1)create a java class
    2)have a list as a class variable
    3) populate the list in the constructor..
    4) map the values in the af:table
    //Employee pojo
    public class Employee {
        public Employee() {
            super();
        private String empName;
        private String empManager;
        private String job;
        public void setEmpName(String empName) {
            this.empName = empName;
        public String getEmpName() {
            return empName;
        public void setEmpManager(String empManager) {
            this.empManager = empManager;
        public String getEmpManager() {
            return empManager;
        public void setJob(String job) {
            this.job = job;
        public String getJob() {
            return job;
    //maanged bean
    public class Bean {
    private List<Employee> employee;
        public Bean() {
            super();
            employee = new ArrayList<Employee>();
          Employee e1 = new Employee();
          e1.setEmpName("xxxxx");
          e1.setEmpManager("xxxxxxxx");
          e1.setJob("xxxxxxx");
          Employee e2 = new Employee();
          e2.setEmpName("yyyyyyy");
          e2.setEmpManager("yyyyyyy");
          e2.setJob("yyyyyyt");
          Employee e3 = new Employee();
          e3.setEmpName("zzzzzz");
          e3.setEmpManager("zzzzzzz");
          e3.setJob("zzzzzzzz");
          employee.add(e1);
          employee.add(e2);
          employee.add(e3);
          employee.add(e4);
        public void setEmployee(List<Employee> employee) {
            this.employee = employee;
        public List<Employee> getEmployee() {
            return employee;
        }in the table map like
    <af:table value="#{Bean.employee}" var="row" rowBandingInterval="0"
                        id="t1">
    <af:column headerText="Employee Name" id="c1">
                  <af:inputText value="#{row.empName}" id="it5"/>
                </af:column>
                <af:column headerText="Employee Manager" id="c2">
                  <af:inputText value="#{row.empManager}" id="it2"/>
                </af:column>
    </af:table>

  • Custom bean in EL

    hi
    i want to acces custom bean in jsp using expression language:
    <c:forEach var="emp" items="empList">
            <tr>
              <td>${emp.getName}</td>
            //etc.        
            </tr>
          </c:forEach>where empList is LinkedList<Employee> (stored this way: session.setAttribute("empList", list);)
    i always get this error:
    javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'getName'.
    thanks for help

    BalusC wrote:
    Two mistakes:
    1) The 'empList' is a String. You apparently need ${empList}.thanks - i am just beginner
    2) The ${emp.getName} expects a getGetName() method in the object type behind 'emp'. Unless you actually coded it that way (why then?), you should be using ${emp.name}.thanks for a tip

  • Unable to show JSF dropdown with a list containing custom beans

    Hi,
    Please help me with my problem guys.
    In the JSF Portlet application that Iam currently working, I need to show some dropdowns,so I am passing arraylist in my JSP like this:
    <code]
    <f:view>
    <hx:scriptCollector id="scriptCollector1">
    <h:form styleClass="form" id="form1"><P>Place content here.
    <h:selectOneMenu styleClass="selectOneMenu" id="menu1" >
    <f:selectItems value="#{gfogBean.northAmericaList.toArray}"/>
    </h:selectOneMenu>
    </h:form>
    </hx:scriptCollector>
    </f:view>
    gfgoBean is my FacesManagedBean, northAmericaList has objects of type TestBean....
    public class GfogBean {
         private String exchangeEurope;
         private String exchangeAsiaPacific;
         private String exchangeNorthAmerica;
         private List northAmericaList = new ArrayList();
          * @return Returns the northAmericaList.
         public List getNorthAmericaList() {
              northAmericaList.add(new TestBean("north","north"));
              return northAmericaList;
          * @param northAmericaList The northAmericaList to set.
         public void setNorthAmericaList(List northAmericaList) {
              this.northAmericaList = northAmericaList;
          * @return Returns the exchangeAsiaPacific.
         public String getExchangeAsiaPacific() {
              return exchangeAsiaPacific;
          * @param exchangeAsiaPacific The exchangeAsiaPacific to set.
         public void setExchangeAsiaPacific(String exchangeAsiaPacific) {
              this.exchangeAsiaPacific = exchangeAsiaPacific;
          * @return Returns the exchangeEurope.
         public String getExchangeEurope() {
              return exchangeEurope;
          * @param exchangeEurope The exchangeEurope to set.
         public void setExchangeEurope(String exchangeEurope) {
              this.exchangeEurope = exchangeEurope;
          * @return Returns the exchangeNorthAmerica.
         public String getExchangeNorthAmerica() {
              return exchangeNorthAmerica;
          * @param exchangeNorthAmerica The exchangeNorthAmerica to set.
         public void setExchangeNorthAmerica(String exchangeNorthAmerica) {
              this.exchangeNorthAmerica = exchangeNorthAmerica;
    }But I am getting this exception.
    Nested Exception is javax.servlet.jsp.JspException: javax.faces.el.ReferenceSyntaxException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
         at com.sun.faces.taglib.html_basic.SelectOneMenuTag.doEndTag(SelectOneMenuTag.java:483)
         at org.apache.jsp._GfogWeb._jspService(_GfogWeb.java:220)
         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:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         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:1049)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at org.apache.pluto.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:112)
         at com.ibm.faces.context.PortletExternalContextImpl.dispatch(PortletExternalContextImpl.java:439)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:295)
         at com.ibm.faces.application.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:74)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:217)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at com.ibm.faces.webapp.FacesGenericPortlet.doRender(FacesGenericPortlet.java:358)
         at com.ibm.faces.webapp.FacesGenericPortlet.doView(FacesGenericPortlet.java:389)
         at com.jpmorgan.gfogwebportlet.portlet.GfogInitPortlet.doView(GfogInitPortlet.java:51)
         at com.ibm.faces.webapp.FacesGenericPortlet.doDispatch(FacesGenericPortlet.java:290)
         at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
         at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.render(PortletFilterChainImpl.java:144)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.dispatch(PortletServlet.java:131)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.doGet(PortletServlet.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at com.ibm.wps.pe.pc.std.cache.CacheablePortlet.service(CacheablePortlet.java:256)
         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:1049)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:204)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:168)
         at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:97)
         at com.ibm.wps.pe.pc.std.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:110)
         at com.ibm.wps.pe.pc.PortletContainerImpl.doRenderPortlet(PortletContainerImpl.java:545)
         at com.ibm.wps.pe.ext.render.AbstractRenderManager.performService(AbstractRenderManager.java:251)
         at com.ibm.wps.pe.pc.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:100)
         at com.ibm.wps.engine.tags.PortletRenderTag.doStartTag(PortletRenderTag.java:155)
         at org.apache.jsp._Control._jspService(Control.jsp  :176)
         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:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         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.ServicingServletState.service(StrictLifecycleServlet.java:333)
         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:1044)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.handleRequest(DispatcherServiceImpl.java:89)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.include(DispatcherServiceImpl.java:50)
         at com.ibm.wps.services.dispatcher.Dispatcher.include(Dispatcher.java:44)
         at com.ibm.wps.engine.templates.skins.Default.render(Default.java:74)
         at com.ibm.wps.engine.templates.SkinTemplate.render(SkinTemplate.java:71)
         at com.ibm.wps.composition.elements.Component.render(Component.java:785)
         at com.ibm.wps.composition.elements.Control.render(Control.java:182)
         at com.ibm.wps.composition.Composition.render(Composition.java:2880)
         at com.ibm.wps.model.wrappers.LayoutModelWrapperFactoryImpl$LayoutModelWrapperImpl.render(LayoutModelWrapperFactoryImpl.java:204)
         at com.ibm.wps.model.ModelUtil$WrappedCompositionModel.render(ModelUtil.java:832)
         at org.apache.jsp._UnlayeredContainer_2D_V._jspService(UnlayeredContainer-V.jsp     :11)
         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:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         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.ServicingServletState.service(StrictLifecycleServlet.java:333)
         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:1044)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.handleRequest(DispatcherServiceImpl.java:89)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.include(DispatcherServiceImpl.java:50)
         at com.ibm.wps.services.dispatcher.Dispatcher.include(Dispatcher.java:44)
         at com.ibm.wps.engine.templates.skins.Default.render(Default.java:74)
         at com.ibm.wps.engine.templates.SkinTemplate.render(SkinTemplate.java:71)
         at com.ibm.wps.composition.elements.Component.render(Component.java:785)
         at com.ibm.wps.composition.Composition.render(Composition.java:2880)
         at com.ibm.wps.model.wrappers.LayoutModelWrapperFactoryImpl$LayoutModelWrapperImpl.render(LayoutModelWrapperFactoryImpl.java:204)
         at com.ibm.wps.engine.tags2.PageRenderTag.doStartTag(PageRenderTag.java:397)
         at org.apache.jsp._Home._jspService(Home.jsp  :15)
         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:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         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.ServicingServletState.service(StrictLifecycleServlet.java:333)
         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:1044)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.handleRequest(DispatcherServiceImpl.java:89)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.include(DispatcherServiceImpl.java:50)
         at com.ibm.wps.services.dispatcher.Dispatcher.include(Dispatcher.java:44)
         at com.ibm.wps.engine.templates.screens.Default.render(Default.java:91)
         at com.ibm.wps.engine.templates.ScreenTemplate.render(ScreenTemplate.java:61)
         at com.ibm.wps.engine.tags2.ScreenRenderTag.doStartTag(ScreenRenderTag.java:89)
         at org.apache.jsp._Default._jspService(Default.jsp  :768)
         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:683)
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
         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:1044)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:254)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.handleRequest(DispatcherServiceImpl.java:89)
         at com.ibm.wps.services.dispatcher.DispatcherServiceImpl.include(DispatcherServiceImpl.java:50)
         at com.ibm.wps.services.dispatcher.Dispatcher.include(Dispatcher.java:44)
         at com.ibm.wps.engine.templates.themes.Default.render(Default.java:103)
         at com.ibm.wps.engine.templates.ThemeTemplate.render(ThemeTemplate.java:67)
         at com.ibm.wps.engine.phases.WPRenderPhase.processRendering(WPRenderPhase.java:312)
         at com.ibm.wps.engine.phases.WPRenderPhase.execute(WPRenderPhase.java:135)
         at com.ibm.wps.state.phases.AbstractRenderPhase.next(AbstractRenderPhase.java:106)
         at com.ibm.wps.engine.phases.WPAbstractRenderPhase.next(WPAbstractRenderPhase.java:93)
         at com.ibm.wps.engine.Servlet.callPortal(Servlet.java:713)
         at com.ibm.wps.engine.Servlet.doGet(Servlet.java:562)
         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.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
         at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:86)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.wps.mappingurl.impl.URLAnalyzer.doFilter(URLAnalyzer.java:216)
         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1040)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:600)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:201)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
         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:624)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)Then I changed the <f:selectItems/> little bit like
    <f:selectItems value="#selectItems.gfogBean.northAmericaList.toArray}"/>Then there was no error ,but the dropdown was null.
    Again I modifed the <f:selectItems/> tag in this way:
    <f:selectItems value="#{selectitems.gfogBean.northAmericaList.testBeanValue.testBeanValue.toArray}"/>then the dropdown appeared but the values were showing up twice.
    Can anybody give me solution to this problem.Even a custom converter or a custom component could solve this problem.. \n
    Because in my application, we are not populating the arraylists with SelectItem type.

    The perInfoAll list should be declared locally in getPerInfoAll(), otherwise it grows every time you call it.
    #{e.id};Remove the semicolon, unless you want to see it on the page, which doesn't seem right. Try <h:outputText value="#{e.id}"/> instead. Only certain types of children are supported inside h:column.

  • Sample Custom Bean with Override Submit button

    Does some one have a sample code with an override logic for button.
    Please do not share the code of the Dev Guide and the OIM assets published.

    I have created a Custom Managed Bean, which is associated with My Information Page.My Bean reads a UDF field which has a comma seprated value of EMails and populates a drop down list on the My Information Page.
    This works fine. Now the next step is to implement the value change listener which catches the change/selection done on the drop down list and overriding of Apply Button to save the selected field on User's profile.
    I am not able to do it,even after spending quite bit of time on this. Has any one done something similar and can share code.I need code for Value change Listener and Override Submit button.
    The code which is published in assests page and Dev Guide is not working.
    My Submit button code is
    public void submitActionValidator(ActionEvent actionEvent) {
    String methodName="submitActionValidator";
    System.out.println("Inside"+methodName+"**********");
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    System.out.println("Inside" methodName"2**********");
    // Get the sepecific list binding
    JUCtrlListBinding listBinding = (JUCtrlListBinding)bindings.get("Custom Dropdown");
    System.out.println(methodName+"MNSCUInside SubmitAction3 **********");
    // Get the value which is currently selected
    Object emailSelected = listBinding.getSelectedValue();
    System.out.println(methodName+"MNSCUInside SubmitAction Avlidator***********************************");
    // emailSelected =
    // (RichSelectOneChoice)actionEvent.getSource();
    System.out.println(methodName+"MNSCUemailSelected***********************************:"+emailSelected);
    if (emailSelected != null) {
    preffemail = emailSelected.toString();
    System.out.println(methodName+"preffemail***********************************"+preffemail);
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesUtils.setAttributeBindingValue(EMAIL_ATTRIBUTE,
    preffemail);
    // execute original submit button action listener
    MethodExpression originalActionListener =
    FacesUtils.getMethodExpressionFromEL("#{backingBeanScope.MyInformationUIBean.applyButton}",
    null,
    new Class[] { ActionEvent.class });
    originalActionListener.invoke(FacesUtils.getELContext(),new Object[] {actionEvent});
    System.out.println("Exit methodName **********");
    }

  • Custom bean on Approve in Human Task Form

    Hi,
    I have a complex requirement, The Approver has to validate the employee number manually.Approver will look in some system.
    There is a check box in  Human Task Form  " Validated Employee Number".
    The approver has to check mark this check box before approve. If this check box is not checked, we have to stop them with a pop up " Please verify employee number"
    Please advise.
    Thanks in advance.

    for the approve button, add action listener method and check your reqired fileds if any required filed is not entered you can throw an error as below.
    FacesContext.getCurrentInstance().addMessage(null,
                                                                           new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                                           "Your Error Message",
                                                                            null));

  • ADF Graph Java custom bean

    Hi -
    I am trying to display a Report table and a graph on a page. The table data is from ReportTableVO with parameters which the user specifies while generating the reports. The graph should reflect the month-wise average of the data table. How do I do this? Do I need a seperate VO for generating the graph? Or is there anyway I can use my Table's VO for the graph data? Any help or pointer is highly appreciated.
    My report looks like this:
    Period.......Project.........Score1............Score2...........Score3.........Average
    Oct-06......project-1.......1.....................2...................3..................2..............
    Oct-06......project-2.......3.....................3...................3..................3..............
    Nov-06......project-3.......5.....................5...................5..................5..............
    Nov-06......project-4.......2.....................4...................3..................3..............
    My Graph should show only two bars with average score for Oct-06 (which in this case is 2.5) and or Nov-06 (which is 4.0)
    Thanks in advance.
    Saran

    I think you will need to use a different VO for your graph, returning just the month and the average. Using SQL to calculate the averages (assuming that's how your existing VO gets its data) is probably the easiest way.
    Doubleclicking the BIGraphDef1.xml file which should have turned up in your application source in JDev should open the visual/property editor. Use the colorMode: COLOR_BY_SERIES attribute to make your averages part of the same series. Otherwise just play around with the attributes, clicking on different parts of the graph to get to their attributes. I spent ages googling trying to work out that colorMode thing without success as I agree documentation is hard to find. It turned out to be much quicker just going through the attributes in the BIGraphDef editor myself.

  • Error using selectmany tags with backing beans - Beta 1

    Hi All,
    I'm not having any luck getting any of the selectmany tags working with back-end beans. I've concluded it just doesn't work. My example is derived from the selectmany sample in the tutorial, which also just doesn't work (there are 4 or 5 problems with the sample in the tutorial, including the fact that there's no tag called 'selectmany_checkbox' in Beta 1, it's renames to selectmany_checkboxlist. But I digress).
    Anyway, the following is the relevant JSP snippet:
    <html:selectmany_menu value="#{facesTest.items}">
    <faces:selectitem itemValue="foo" itemLabel="foo" />
    <faces:selectitem itemValue="bar" itemLabel="bar" />
    </html:selectmany_menu>
    Here's the relevant backing bean snippet:
    protected ArrayList items = null;
    public Object[] getItems() {
    System.out.println("getItems():ENTRY");
    if (items != null)
    return items.toArray();
    else
    return null;
    public void setItems(Object[] items)
    System.out.println("setItems():ENTRY");
    int len = 0;
    if (null == items ||(len = items.length) == 0) {
    return;
    if (this.items != null)
    this.items.clear();
    this.items = new ArrayList(len);
    for (int i = 0; i < len; i++) {
    this.items.add(items);
    I've declared the bean as follows in the face-config.xml:
    <managed-bean>
    <managed-bean-name>facesTest</managed-bean-name>
    <managed-bean-class>ipt.faces.FacesTest</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    The errors vary, but basically when I don't select anything from the multi-select menu, all is fine. When I do select something I get one of two messages returned thru the messages tag, either "Conversion Error setting value 'null' for 'expression'" when I select one item or " Conversion Error setting value '[Ljava.lang.String;@397d4e' for 'expression'." when I select two items.
    Turning on 'FINEST', I get the output below:  Any ideas?  I've noticed several posting regarding the selectmany tags, any response on getting these to work?
    thanks!
    Steve
    FINE: Exiting RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINE: Begin executing lifecycle phases
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Entering RestoreViewPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getMappingForR
    equest
    FINEST: servletPath /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getMappingForR
    equest
    FINEST: pathInfo null
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl convertViewId
    FINE: viewId after appending the context suffix /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl restoreView
    FINE: Begin restoring view from response /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl restoreView
    FINE: End restoring view from response /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl restoreView
    FINEST: set character encoding on request to ISO-8859-1
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Postback: Restored view for /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Exiting RestoreViewPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl hasPostDataOrQuery
    Params
    FINEST: Request Method: POST/PUT
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
    FINE: Entering ApplyRequestValuesPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue(ref=facesTest.items)
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    getItems():ENTRY
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue Result:[Ljava.lang.Object;@11fb68f
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINEST: -->Returning [Ljava.lang.Object;@11fb68f
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getType
    FINE: isReadonly result:class [Ljava.lang.Object;
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue(ref=facesTest.items)
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    getItems():ENTRY
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue Result:[Ljava.lang.Object;@1262667
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINEST: -->Returning [Ljava.lang.Object;@1262667
    Jan 9, 2004 10:11:52 AM com.sun.faces.context.FacesContextImpl addMessage
    FINE: Adding Message[sourceId=_id0:_id7,summary=Conversion Error setting value '
    [Ljava.lang.Object;@1262667' for 'expression'.)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
    FINE: Exiting ApplyRequestValuesPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ProcessValidationsPhase execute
    FINE: Entering ProcessValidationsPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ProcessValidationsPhase execute
    FINE: Exiting ProcessValidationsPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINE: Skipping to RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: Entering RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: About to render view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINE: About to render view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINE: Found URL pattern mapping to FacesServlet .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINEST: Before dispacthMessage to newViewId /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getViewIdPath
    FINEST: viewId after modifications /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ApplicationImpl createConverte
    r
    FINEST: Created converter of type javax.faces.convert.BooleanConverter
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl writeState
    FINEST: Begin writing state to response for viewId/hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl writeState
    FINEST: End writing state to response for viewId/hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl saveSerialize
    dView
    FINE: Begin creating serialized view for /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl saveSerialize
    dView
    FINE: End creating serialized view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINEST: After dispacthMessage to newViewId /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: Exiting RenderResponsePhase

    Could you post your code example? I am having the same problem. And I am wondering how you can set the value, label and description using the String[] return type. I thought the object[] would basically be a SelectItem Array...
    thanx!

  • JSP tags with java beans !! Design Help needed ..

    Hi,
    I have three tables State,District,College.
    My requirement is to get the fields from three tables one time from the DB and populate them with the JSP(so that the DB connections will not be much).
    For that :::
    I have designed to have three Beans StateBean,DistrictBean and CollegeBean.
    Every row in State table will be a StateBean and will be added to an ArrayList called StateBeanList
    similarly I got two other lists DistrictBeanList and CollegeBeanList.
    And I am using application.setAttribute() to send all the information to the JSP by using RequestDespatcher..
    When I run the servlet on tomcat it is getting OutOfMemory Exception in java Heap..Can I increase the heap size on tomcat ?
    Apart from increasing the heap size I want to know good design...
    My actual requirement is::: in the forwared JSP I need to populate state text field and after selecting state field I need to get the district fileds populated in other text filed, by the value of district field I need to populate college field... we can see it many websites...
    Please suggest me the good design..
    Thanks in Advance,
    Vidhya...

    vidhya517 wrote:
    I have three tables State,District,College.
    My requirement is to get the fields from three tables one time from the DB and populate them with the JSP(so that the DB connections will not be much).
    For that :::
    I have designed to have three Beans StateBean,DistrictBean and CollegeBean.
    Every row in State table will be a StateBean and will be added to an ArrayList called StateBeanList
    similarly I got two other lists DistrictBeanList and CollegeBeanList.I would rather let StateBean have a Set<DistrictBean> property and let DistrictBean have a Set<CollegeBean> property. List instead of Set is also okay.
    And I am using application.setAttribute() to send all the information to the JSP by using RequestDespatcher..
    When I run the servlet on tomcat it is getting OutOfMemory Exception in java Heap..Can I increase the heap size on tomcat ?
    Apart from increasing the heap size I want to know good design...How many states, districts and colleges do you have in total? What is your initial heap size? You can just alter it as startup parameters/arguments.
    My actual requirement is::: in the forwared JSP I need to populate state text field and after selecting state field I need to get the district fileds populated in other text filed, by the value of district field I need to populate college field... we can see it many websites...
    Please suggest me the good design..

  • Data tags with Web beans

    Hello,
    I have a problem : I submit a form which create a new record (made with data tags).
    After the commit, the RowsetBrowser isn't refreshed. So you can't see the new record!
    The release mode is Stateful on each page with data tags.
    On the RowsetBrowser page, I set
    setReleaseApplicationResources(false)
    Could you help me?
    thanks
    Christophe

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Juan Oropeza ([email protected]):
    Can you post your pages? <HR></BLOCKQUOTE>
    I finaly found my mistake. I didn't set the same ID to the WB and the data tags.
    thanks
    Christophe
    null

  • Custom tags v/s java beans

    Hi all,
    Is there any thumb rule when to use Custom Tag and when to use Java Beans.
    I feel we can get the solution using either of them.
    Am I right?
    Cheers

    Hi all,
    Is there any thumb rule when to use Custom Tag and
    when to use Java Beans.
    I feel we can get the solution using either of them.
    Am I right?
    Usually you can indeed use either. Custom tags will create cleaner JSPs with less (if any) Java code, which makes it a lot easier for non-Java people to maintain them.
    Custom beans are often quicker to create, and therefore better suited as interim solutions or for pages that won't be around for long (maybe that one-time action?).
    Of course custom tags will often also make use of beans :)

  • Jsp 2.0 and jdev 10g production (custom tags)

    there are some examples at
    http://otn.oracle.com/sample_code/tech/java/jsps/index.html
    I have certian questions it would be great if some one would clear these for me..
    In JSP 1.2 if we wanted to write the custom tag's we had tag classes that extend TagSupport or TagBodySupport and the doStart() and doEnd() tag with the evaluate body. I could spit out the complete html text on an encounter of a tag! but in the JSP 2.0 a doTag() seems to take care of the intracies! how??
    Now with jsp 2.0 I want to do the same... say some thing like this ....
    <tg:myTag list="${somelist}"></tg:myTag> and say in my tag handler class I know what to do with this list. May be I will create complete html code and will use jspWriter to write out the html inbetween these tags!!
    I have downloaded the eStore example but this class
    javax.servlet.jsp.tagext.SimpleTagSupport; is not imported. So I am not able to look at the SimpleTagSupport class.
    If I am trying to run the example in jdev 10g production should I have to specify that I am using jsp 2.0 so that jdev knows not to use jsp 1.2? if so how can I do this.
    Does all the examples provided use the OC4J standalone? Can I use the embedded oc4J instead?
    regards.

    After reading a bit more now I know how the tags work.
    However from the example I see (eStore) an array called by name "products" is created and set on the jspContext. If I already have the list and want to pass on the list which is in a bean or a session or a request can I provide it this way.
    <tag:myTag var=${bean.list}>
    or
    <tag:myTag var=${session.list}>
    or
    <tag:myTag var=${request.list}>in the .tld file I should specify the attribute var and whether it should be runtime evaluable.
    and in the TagClass
    private Collection var;
    private String listName;
    public void setVar(Colloection aList) {
      this.var = aList;
    public Collection getVar() {
      return var;
    public void doTag( ) throws JspException{
      // do i always need to this next line ------
      getJspContext( ).setAttribute(listName, getVar());
    }so that in my .tag file I can use some thing like this
    <c:forEach var="list" items="${item}">
      <td>${item.subObject.name}</td>
      <td>${item.subObject.value}</td>
    </c:forEach>And finally... as and when a tag is encountered the .tag file contents corresponding to that tag is called to get the html text and all that text is printed out in the jsp page right (without the jspWriter "out"). How does the browser know when to stop? like doEndTag() function? are these functions implicitly called?
    regards.

  • Custom "usebean" tag.

    I've a problem trying to register a variable into my jsp.
    Normal method to auto-fill a bean looks like :
    <jsp:useBean id="mybean" scope="page" class="mybeanclass" />
    <jsp:setProperty name="mybean" property="*" />
    <%
    // I can use my bean here
    mybean.mymethod();
    // do something
    %>
    Now, i can't auto-fill my bean, because i've specific parameters. Then i write a custom tag that correctly fills the bean, but i don't know how can i register the variable so i can't use it later in code.
    <mytaglib:load id="mybean" scope="page" />
    <%
    // only works with one class type.
    // Scope ? how can i register my variable in various scopes ?
    // can i use my bean here ? how ?
    mybean.mymethod(); // crash!!!
    %>

    Now, i can't auto-fill my bean, because i've specific
    parameters. Then i write a custom tag that correctly
    fills the bean, but i don't know how can i register
    the variable so i can't use it later in code.
    <mytaglib:load id="mybean" scope="page" />
    <%
    // only works with one class type.
    // Scope ? how can i register my variable in various
    scopes ?
    // can i use my bean here ? how ?
    mybean.mymethod(); // crash!!!
    %> The simplest answer is to use the <jsp:useBean> to create the scripting variable and instantiate the bean, and then use the tag to populate the bean.
    <jsp:useBean id="mybean" scope="page" class="mybeanclass" />
    <mytaglib:load id="mybean" />The load tag could reference the bean as a PageContext attribute using the key specified in the id attribute ("mybean" in this case).
    If you don't want to use useBean, change the tld definition for the load tag to define a scripting variable. The <tag> definition would look something like:
    <tag>
            <name>load</name>
            <tag-class>yourpackage.LoadTag</tag-class>
            <body-content>JSP</body-content>
            <variable>
                <name-from-attribute>id</name-from-attribute>
                <variable-class>yourpackage.mybeanclass</variable-class>
                <declare>true</declare>
                <scope>AT_END</scope>
            </variable>
            <attribute>
                <name>id</name>
                <required>true</required>
                <rtexprvalue>false</rtexprvalue>
                <type>String</type>
            </attribute>
        </tag> In the tag, instantiate the bean and add it a page attribute using the value of id as the key. The JSP engine should generate a scripting variable of the same name.

  • Problem in using custom java beans

    Hi,
    We are using oracle JDeveloper 3.2.2 version for developing our Graphical User interface which
    involves Applets and custom beans.
    We faced the following problems when we tried to add the custom beans to JApplet.
    Problem 1. When I drag and drop the custom beans to JApplet, the gif image used by the bean is
    not displayed even when the gif image has been added in the archive file representing
    JavaBean
    Problem 2. When I modify the source code generated by Jdeveloper and come back to the design tab,
    the custom beans looses its look and feel and gets the look and feel of the standard
    bean from which it has been extended.
         For instance, I have a dropdownlist which has been extended from JCombobox.
         I drag and drop to the JApplet. The look and feel of the dropdownlist is
    maintained.
    Now I modify the source code for the dropdownlist in order to add items to it.
         After doing so, I come back to the design tab where i can see my dropdownlist
    appears with the look and feel of JCombobox.     

    HI,
    IF YOU create custom object the profile should be the same as standard.Also see whether the authorization object is added to the data target or not.
    Hope this helps
    Assign points if useful
    Regards,
    venkat

  • Trying to insert a custom visual bean gives me an error

    I've created a custom bean based on javax.swing.jpanel and it compiles fine. I've added it to the component panel as a visual bean but when I try to place it on a frame it throws me an error, which can be found below. I've definately had this visual bean working on another computer using forte but it may not be the same version of forte or java as on this machine. This machine has forte 3.0 and java 1.3.1. Other custom visual beans work fine. Any help greatly appreciated.
    Mike
    Fri Oct 05 12:37:41 BST 2001: java.lang.NullPointerException: null
    java.lang.NullPointerException
    at org.netbeans.modules.form.RADVisualContainer.initLayoutSupport(RADVisualContainer.java:48)
    at org.netbeans.modules.form.HandleLayer.addVisualBean(HandleLayer.java:436)
    at org.netbeans.modules.form.HandleLayer.access$1800(HandleLayer.java:43)
    at org.netbeans.modules.form.HandleLayer$HandleLayerMouseListener.mousePressed(HandleLayer.java:904)
    at java.awt.Component.processMouseEvent(Component.java:3712)
    at java.awt.Component.processEvent(Component.java:3544)
    at java.awt.Container.processEvent(Container.java:1164)
    at java.awt.Component.dispatchEventImpl(Component.java:2593)
    at java.awt.Container.dispatchEventImpl(Container.java:1213)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2210)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
    at java.awt.Container.dispatchEventImpl(Container.java:1200)
    at java.awt.Window.dispatchEventImpl(Window.java:926)
    at java.awt.Component.dispatchEvent(Component.java:2497)
    [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

    Hi, I have exact the same problem. Have you got any answer for this problem yet? Please forward it to me if you have one. Many thanks.

Maybe you are looking for

  • Where can I find a sample ERD for a University

    Hello. I have to develop a program in C# that manages details about the students, taxes, courses, etc and prints some reports. It's for my license degree. The programming part is not that hard but the task that is killing me is designing the database

  • Java application deployment/setup

    I'm in need of some information about how to go about creating an installation program for my java desktop application. We have a big project due in two months and one of the requirements is that it needs to be deployable on any machine, including ma

  • How to combine Digital Output, a delay and Analog Input in a fast loop

    I need to develop a process loop that runs at least at 250 Hz that performs a Digital output, than a delay of 50 microseconds and than an analog input of all the channels. All will be done using ATI MIO 64E3 card. Of course, the acquired data will be

  • PSE8 installation Error 1335

    Hi I've spent a very frustrating morning trying to install PSE8 using Windows 7.  I'm getting the following error each attempt: Error 1335. The cabinet file 'Data1.cab' required for this installation is corrupt and cannot be used. This could indicate

  • HP Compaq p6874 with Windows 7 AMD Athlon IIx2 220 Processor

    I have HP Compaq p6874 with Windows 7.  It has an ATI RAdeon HD 4200 video card.  Will the XFX R5 230 Radeon graphics card work in my CPU and fix my gaming issues?  Also, what PSU will I need to run that graphics card?  Games that I have jerk and the