You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jacek Laskowski <jl...@apache.org> on 2005/11/04 00:31:33 UTC

PetStore issue at product.screen?product_id=x

Hi,

I've been working on getting PetStore to work on Geronimo and 
encountered an issue I can't yet work out.

Does anyone know what the following snippet does and why it doesn't work 
on Geronimo/Jetty? When I've uncommented the code within <%-- --%>, the 
page where you can place an order works, otherwise it does not. How 
could I pinpoint the root cause?

<c:forEach var="item" items="${pageResults.list}">
  <tr>
   <td class="petstore_listing">
    <c:url value="/item.screen" var="viewItemURL">
     <c:param name="item_id" value="${item.itemId}"/>
    </c:url>
    <a href='<c:out value="${viewItemURL}"/>'>
   <%--
     <c:out value="${item.attribute}" />
   --%>
     <c:out value="${item.productName}"/>
    </a>
    <br>
    <c:out value="${item.description}"/>
   </td>
   <td class="petstore_listing" align="right">
    <fmt:formatNumber value="${item.listCost}" type="currency" />
    <br>
    <c:url value="/cart.do" var="cartURL">
      <c:param name="action" value="purchase"/>
      <c:param name="itemId" value="${item.itemId}"/>
    </c:url>
    <a href='<c:out value="${cartURL}"/>'>
     Add to Cart
    </a>
   </td>
  </tr>
</c:forEach>

The url to the page is 
http://localhost:8080/petstore/product.screen?product_id=FL-DSH-01. Just 
  select pets category in the Pets frame on the left and nothing will be 
printed out unless the page has been changed(for reference it's in 
sandbox\petstore\target\geronimo-1.0-SNAPSHOT\config-store\36\petstore.war 
by default)

That's the last visible issue with PetStore. There's another with 
LoginModule, but I don't expect it will take much time to work out.

Any help appreciated.

Jacek

Re: PetStore issue at product.screen?product_id=x

Posted by Jacek Laskowski <jl...@apache.org>.
Jacek Laskowski wrote:

> I found the root cause, but did not a solution.

The solution is to work with the latest release of PetStore 1.4 that 
works fine.

The question I won't probably answer myself easily is why I didn't work 
with the version before? ;)

Jacek

Re: PetStore issue at product.screen?product_id=x

Posted by Jacek Laskowski <jl...@apache.org>.
Jacek Laskowski wrote:

> Does anyone know what the following snippet does and why it doesn't work 
> on Geronimo/Jetty? When I've uncommented the code within <%-- --%>, the 
> page where you can place an order works, otherwise it does not. How 
> could I pinpoint the root cause?
> 
> <c:forEach var="item" items="${pageResults.list}">
>  <tr>
>   <td class="petstore_listing">
>    <c:url value="/item.screen" var="viewItemURL">
>     <c:param name="item_id" value="${item.itemId}"/>
>    </c:url>
>    <a href='<c:out value="${viewItemURL}"/>'>
>   <%--
>     <c:out value="${item.attribute}" />
>   --%>

I found the root cause, but did not a solution. It fails on Tomcat 5.5.9 
(no Geronimo), too. When Item class (represented as the item variable, 
above) has two public methods - getAttribute() and getAttribute(int), 
Tomcat (and Jetty in Geronimo, which I think boils down to saying that 
it's Jasper or standard jstl impl, actually) prints out the following 
error message:

javax.servlet.jsp.el.ELException: Unable to find a value for "attribute" 
in object of class "coreout.Item" using operator "."
	org.apache.commons.el.Logger.logError(Logger.java:481)
	org.apache.commons.el.Logger.logError(Logger.java:498)
	org.apache.commons.el.Logger.logError(Logger.java:611)
	org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:340)
	org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
	org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
	org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
	org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:922)
	org.apache.jsp.index_jsp._jspx_meth_c_out_0(index_jsp.java:160)
	org.apache.jsp.index_jsp._jspx_meth_c_forEach_0(index_jsp.java:129)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:79)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)

When I remove the overloaded method with the int input argument, it 
works. How can I work it around? I wonder how it works on other 
application servers.

It seems it's not me who experiences the problem. I saw threads 
mentioning the same issue while deploying PetStore onto SJES and JBoss, 
e.g. http://forums.java.sun.com/thread.jspa?threadID=642376&tstart=120.

Jacek