1 Reply Latest reply on Feb 16, 2006 7:58 AM by Jaime Torres C.

    JSP problem inside a portlet for JBoss-2.2.0 over JBoss-4.

    Jaime Torres C. Newbie

      Good Day:

      It seems like i made a mistake in a jsp inside a portlet for JBoss-2.2.0
      over JBoss-4.0.3SP1 that I can not identify; This is the not working JSP.


      <%@ page session="true"%>
      <%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet' %>
      <%@ taglib uri='/WEB-INF/tld/c.tld' prefix='c' %>
      <%@page import="java.util.ArrayList" %>
      <portlet:defineObjects/>
      <TABLE cellpadding=0" style="font-family: monospace;
      color: #666666;" class="portlet-table-body">



      Codigo
      N o m b r e

      <c:forEach var="elem" items="${eapbList}"
      varStatus="status" >


      <c:out value="${elem.cod_eapb} />
      <c:out value="${elem.nom_corto} />

      </c:forEach>



      The following is a JSP thst works

      <%@ page session="true"%>
      <%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet' %>
      <%@ taglib uri='/WEB-INF/tld/c.tld' prefix='c' %>

      <%@page import="com.jtccia.c_contacto.beans.*" %>
      <%@page import="javax.servlet.jsp.jstl.core.LoopTagStatus" %>
      <%@page import="java.util.ArrayList" %>
      <portlet:defineObjects/>
      <%ArrayList eapbList = (ArrayList)session.getAttribute("eapbItems");
      %>
      <TABLE cellpadding=0" style="font-family: monospace;
      color: #666666;" class="portlet-table-body">



      Codigo
      N o m b r e

      <c:forEach var="elem" items="<%=eapbList %>"
      varStatus="status" >
      <%EapbItemBean eapbItem_1 = (EapbItemBean)pageContext.getAttribute("elem");
      short tip_conv = eapbItem_1.getTip_conv();%>


      <%=eapbItem_1.getCod_eapb() %>
      <%=eapbItem_1.getNom_corto() %>

      </c:forEach>



      The casting of the page attribute "elem" does not look as normal, but works.

      What should I do or include, to make the first JSP to work?

      Many thanks.

      Jaime Torres C.

        • 1. Re: JSP problem inside a portlet for JBoss-2.2.0 over JBos
          Jaime Torres C. Newbie

          Good Day:

          This is a reeditng and send of my previous mail.

          It seems like I made a mistake in a jsp inside a portlet for JBoss-2.2.0
          over JBoss-4.0.3SP1 that I can not identify.

          This is the not working JSP.


          ================ the start and ending tag simbols were changed with editing purpose


          [%@ page session="true"%]
          [%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet' %]
          [%@ taglib uri='/WEB-INF/tld/c.tld' prefix='c' %]
          [%@page import="com.jtccia.c_contacto.beans.*" %]
          [%@page import="java.util.ArrayList" %]
          [portlet:defineObjects/]
          [%ArrayList eapbList = (ArrayList)session.getAttribute("eapbItems");
          %]
          [TABLE cellpadding=0" style="font-family: monospace;
          color: #666666;" class="portlet-table-body"]
          [tbody ]
          [tr]

          [td]
          [table valign="top"]
          [tr style='background: #99ccff']
          [td align="left"]Codigo[/td]
          [td align="center"]N o m b r e[/td]
          [/tr]
          [c:forEach var="elem" items="${eapbList}"
          varStatus="status" ]
          [tr]
          [td][c:out value="${elem.cod_eapb}" /][/td]
          [td][c:out value="${elem.nom_corto}" /][/td]
          [/tr]
          [/c:forEach]
          [/table]
          [/td]
          [/tr]

          [/tbody]
          [/TABLE]

          ===================================================================

          This is a working JSP

          [%@ page session="true"%]
          [%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet' %]
          [%@ taglib uri='/WEB-INF/tld/c.tld' prefix='c' %]
          [%@page import="com.jtccia.c_contacto.beans.*" %]
          [%@page import="javax.servlet.jsp.jstl.core.LoopTagStatus" %]
          [%@page import="java.util.ArrayList" %]
          [portlet:defineObjects/]
          [%ArrayList eapbList = (ArrayList)session.getAttribute("eapbItems");
          %]
          [TABLE cellpadding=0" style="font-family: monospace;
          color: #666666;" class="portlet-table-body"]
          [tbody ]
          [tr]

          [td]
          [table valign="top"]
          [tr style='background: #99ccff']
          [td align="left"]Codigo[/td]
          [td align="center"]N o m b r e[/td]
          [/tr]
          [c:forEach var="elem" items="[%=eapbList %]"
          varStatus="status" ]
          [%EapbItemBean eapbItem = (EapbItemBean)pageContext.getAttribute("elem");
          %]
          [tr]
          [td][%=eapbItem.getCod_eapb() %][/td]
          [td][%=eapbItem.getNom_corto() %][/td]
          [/tr]
          [/c:forEach]
          [/table]
          [/td]
          [/tr]

          [/tbody]
          [/TABLE]

          =====================================================================

          The first JSP agrees with the examples that appear in almost any portlet book.
          The casting of the page attribute "elem" does not look as normal, but works.
          What should I do or include, to make the first JSP to work?.

          Many thanks.