RSS Forums RSS
Please support our JSP advertiser: Lunarpages JSP Web Hosting

URGENT: JSP - StackOverFlow Error

Join Date: Apr 2006
Posts: 8
Reputation: lwinn213 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lwinn213 lwinn213 is offline Offline
Newbie Poster

Help Re: URGENT: JSP - StackOverFlow Error

  #2  
Apr 27th, 2006
UPDATE

Here are the Jsp files, after some debugging both pages display, just when I add in the jsp:getproperty then I get the StackOverflowError.

How can i get the JSP to use these values but not cause this Overflow error?

index.jsp

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<head>
<title>Electronic Store | Admin</title>
<link href="qc310.css" rel="stylesheet" type="text/css">
</head>
<body>
<table border='0' cellspacing='0' cellpadding='0' width='600'>
<tr>
    <td colspan='2' bgcolor='#CCCCCC' align='center'><b>Electronic Store</b></td>
</tr>
</table>
  <br /><html:link page='/viewprod.do'>View product list</html:link> 
  <br /><html:link page='/update.do'>Update product</html:link>
 <br />
 <br />
 <table width="600" border="0">
      <tr>
        <th scope="row">______________________________________________________</th>
      </tr>
</table>
 <table border='0' cellspacing='0' cellpadding='0' width='600'>
<tr>
    <td colspan='2' align='center'><div align="left"><span class="copyright">&copy; 2006 Lukas Winn</span><br />
   <br />
    </div></td>
</tr>
</table>
    <p>&nbsp;</p>
</body>
</html:html>
</html>

viewprod.jsp (without jsp:getproperty set)

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<jsp:useBean id="select" class="elecstore.SelectBean">
  <jsp:setProperty name="select" property="pid" />
  <jsp:setProperty name="select" property="prodId" />
  <jsp:setProperty name="select" property="prodType" />
  <jsp:setProperty name="select" property="man" />
  <jsp:setProperty name="select" property="product" />
  <jsp:setProperty name="select" property="qty" />
  <jsp:setProperty name="select" property="price" />
  <jsp:setProperty name="select" property="dateAdded" />
  <jsp:setProperty name="select" property="stockOnOrder" /> 
</jsp:useBean>
<html:html>
  <head>
    <title>Electronic Store | View Product Database</title>
    <link href="qc310.css" rel="stylesheet" type="text/css">
  </head>
  <body>
  <h1>Product Database</H1>
    <h2>
   Products:
 
 
    </h2>
    <P><html:link page="/home.do">back to main...</html:link></p>
  </body>
</html:html>

viewprod.jsp (with jsp:getproperty set)
(THIS IS WHERE THE STACKOVERFLOW OCCURS...)

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<jsp:useBean id="select" class="elecstore.SelectBean">
  <jsp:setProperty name="select" property="pid" />
  <jsp:setProperty name="select" property="prodId" />
  <jsp:setProperty name="select" property="prodType" />
  <jsp:setProperty name="select" property="man" />
  <jsp:setProperty name="select" property="product" />
  <jsp:setProperty name="select" property="qty" />
  <jsp:setProperty name="select" property="price" />
  <jsp:setProperty name="select" property="dateAdded" />
  <jsp:setProperty name="select" property="stockOnOrder" /> 
</jsp:useBean>
<html:html>
  <head>
    <title>Electronic Store | View Product Database</title>
    <link href="qc310.css" rel="stylesheet" type="text/css">
  </head>
  <body>
  <h1>Product Database</H1>
    <h2>
   Products:
         <jsp:getProperty name="update" property="pid" /><br />
         <jsp:getProperty name="update" property="prodId" /><br /> 
  <jsp:getProperty name="update" property="prodType" /><br />
  <jsp:getProperty name="update" property="man" /><br />
  <jsp:getProperty name="update" property="product" /><br />
  <jsp:getProperty name="update" property="qty" /><br />
  <jsp:getProperty name="update" property="price" /><br />
  <jsp:getProperty name="update" property="dateAdded" /><br />
  <jsp:getProperty name="update" property="stockOnOrder" /><br />
 
    </h2>
    <P><html:link page="/home.do">back to main...</html:link></p>
  </body>
</html:html>

update.jsp

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html locale="true">
<head>
<title>Electronic Store | Update Product</title>
<link href="qc310.css" rel="stylesheet" type="text/css">
</head>
<body>
<html:form action="/update.do">
<br /><br /><b>Electronic Store | Update Database</b><br /><br />  
  Please enter the updated information and then click on update to make the changes to the database<br />
  <form action="update.jsp" method="post" name="updateForm" id="updateForm">
    <table width="300" border="0">
      <tr>
        <th width="132" scope="row"><div align="left">Product ID</div></th>
        <td width="147"><html:text property="prodId" /></td>
      </tr>
      <tr>
        <th scope="row"><div align="left">Qty</div></th>
        <td><html:text property="qty" /></td>
      </tr>
      <tr>
        <th scope="row"><div align="left">Price</div></th>
        <td><html:text property="price" /></td>
      </tr>
      <tr>
        <th colspan="2" scope="row"><div align="left"><br />
              <html:submit> Update</html:submit>
        </div></th>
      </tr>
      <tr>
        <th colspan="2" scope="row">_____________________________________</th>
      </tr>
    </table>
    </form>
  <br />
  </html:form>
    <html:errors/>
    <logic:present name="prodId">
    Output
  <br /><bean:write name="prodId"/>
     <br /><bean:write name="price"/>
  <br /><bean:write name="qty"/>
    </logic:present>
 <html:link page="/home.do">back to main... </html:link><br /><br />
 <table width="300" border="0">
      <tr>
        <th scope="row">_____________________________________</th>
      </tr>
      <tr>
        <th scope="row"><div align="left"><span class="copyright">&copy; 2006 Lukas Winn</span></div></th>
      </tr>
    </table>
 <br />
 <br />
   <br />
</body>
</html:html>
Reply With Quote  
All times are GMT -4. The time now is 9:27 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC