Solved

JSTL problem

Posted on 2003-11-19
11
2,365 Views
Last Modified: 2013-11-24
I am using JSTL on Weblogic 6.1 sp4.
The jsp works fine on Tomcat 4.1.127...but throws the following error in Weblogic.
***********************************************
unreported exception java.lang.Throwable; must be caught or declared to be thrown
                _c_forEach0.doCatch(_t); //[ /jsp/deals/listdealsresultsright.jsp; Line: 90]
                           ^
1 error
***********************************************
Here is the jsp code that causes problem:
**********************************************
      <c:forEach var="dealBean" items="${dealresult}" varStatus="status">
      <h1>Yahoo</h1>
         
      </c:forEach>
***********************************************
Again....the same code works fine in Tomcat 4.1.27.I dont change anything for weblogic.....i use same war file.

I have put the correct jar files in the WEB-INF/lib , that is standard.jar and jstl.jar

Please help , since i have been trying to make this work for a long time.

Thanx
0
Comment
Question by:rahulkothari
  • 6
  • 5
11 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 9785556
Hmmmm...odd...

does:

<%
  try
  {
%>
<c:forEach var="dealBean" items="${dealresult}" varStatus="status">
     <h1>Yahoo</h1>
</c:forEach>
<%
  }
  catch( Exception ex )
  {
      ex.printStackTrace( out ) ;
  }
%>

work?
  }
0
 

Author Comment

by:rahulkothari
ID: 9787057
will try in 1 hr and let u know.....thanx for the prompt answer
0
 

Author Comment

by:rahulkothari
ID: 9787618
Tim.....
First i got this error : un resolved Symbol : out.
Then i changed the ex.printStackTrace( out ) ;  - to - ex.printStackTrace( );
Now i am getting the : exception must be caught error again.....

Cant figure out why its doing that....
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9787928
Hmmmm....that's odd...

Are you sure it's the same verson of JSTL on both servers?

Is there a later version in which this may be fixed?

Can you post your JSP code?

Tim
0
 

Author Comment

by:rahulkothari
ID: 9788003
I am posting two pieces.....one is that i was using before (that workd with Tomcat 4.1.27) and the second one is which i got from ur ideas :
I am using templates.....so the code u will see doesnt have body and html, head etc tags.
********************************************************************************
<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html-el' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<c:set var="count" scope="page" value="0"/>

<div align="left"> <b><font color="#003366"> </font></b></div>
<!-- ========== CONTENT (start) ========== -->
<span class="redbold">Search Deals</span>
<a href="#" onClick="showHide('tbl2','e');return false;"><img id="e" src="./../images/expand.gif" border="0" alt="" width="15" height="15"></a>
<br>
<br>
<table id="tbl2" style= "display: none; border: 0px;position:relative; width="70%" border="0"  width="730">
 
  <tr>
    <td>
      <html:form action="/searchdeal" >
        <table width="309" class="tabTable">
    <tr>
      <td colspan="2" class="tabtitle">Search Deal By:</td>
    </tr>
    <tr>
      <td width="33%" class="right">Client MNC : </td>
      <td width="67%">
        <html:text styleClass="inputtextmedium" property="ccMNC"/>
      </td>
    </tr>
    <tr>
      <td width="33%" class="right"> Deal MNC: </td>
      <td width="67%">
        <html:text styleClass="inputtextmedium" property="dealMNC"/>
      </td>
    </tr>
    <tr>
      <td width="33%" height="46">&nbsp;</td>
      <td width="67%" height="46">
        <!--  <input type="button" class="submitsmall" name="Submit43" value="Search" onClick="window.location='./listdealsresults.jsp';">
        <input type="button" class="submitsmall" name="Button" value="Cancel" onClick="window.location='./home.jsp'">-->
      <html:submit styleClass="submitsmall" value="Search" property="button"/>
      <html:button styleClass="submitsmall" value="Cancel" property="button" onclick="window.location='./home.jsp'"/>
            
            <!-- ========== CONTENT (end) ========== -->
      </td>
    </tr>
  </table>
 </html:form>
     
    </td>
  </tr>
</table>


<hr width="665" align="left">
<span class="bio_listMedium">Deal Search Result : <font size=2 color="red"><c:out value="${matches}"/></font> matches found</span> <br>
<!-- ========== CONTENT (start) ========== -->
<br>

<logic:messagesPresent>
   <hr>
    <span id="errorsHeader"><bean:message key="errors.search.header"/></span>
    <html:messages id="error">
      <span id="errorsHeader"><li><c:out value="${error}"/></li></span>
    </html:messages>
    <hr>
</logic:messagesPresent>
<br>
<table width="36%" height="25" id="vtable">
  <tr>
    <th width="47%" nowrap height="24">
      <div align="center"><b>Client MNC</b></div>
    </th>
    <th width="53%" nowrap height="24">
      <div align="center"><b>Deal MNC</b></div>
    </th>
        
    <th width="53%" nowrap height="24">
      <div align="center"><b>Deal Name</b></div>
    </th>
          <th width="53%" nowrap height="24">
      <div align="center"><b>Deal Type</b></div>
    </th>
  </tr>
    <form name="Form1" action="#" method=POST>
      <c:forEach var="dealBean" items="${dealresult}" varStatus="status">
         <c:choose>

          <c:when test="${client != dealBean.ccMNC}" >
                  <tr class="view">
                        <td nowrap ><c:out value="${dealBean.ccMNC}"/></td>
                        <td nowrap ><a href="#" onClick="submitForm(this.id);return false;" id="<c:out value="${dealBean.dealMNC}"/>"><c:out value="${dealBean.dealMNC}"/></a></td>
                        <td nowrap ><c:out value="${dealBean.dealName}"/></td>
                        <td nowrap ><c:out value="${dealBean.dealTypeName}"/></td>
                        </tr>
                        <c:set var="count" scope="page" value="${0}"/>
          </c:when>
          <c:otherwise >
                        <c:set var="count" scope="page" value="${count + 1}"/>
                       <c:set var="cellClass">
                     <c:choose>
                        <c:when test="${count % 2 == 1}">alt</c:when>
                        <c:otherwise>alt1</c:otherwise>
                     </c:choose>
                </c:set>
                        <tr class="<c:out value="${cellClass}"/>">
                        <td nowrap ></td>
                        <td nowrap ><a href="#" onClick="submitForm(this.id);return false;" id="<c:out value="${dealBean.dealMNC}"/>"><c:out value="${dealBean.dealMNC}"/></a></td>
                        <td nowrap ><c:out value="${dealBean.dealName}"/></td>
                        <td nowrap ><c:out value="${dealBean.dealTypeName}"/></td>
                        </tr>      
          </c:otherwise>
      </c:choose>
       
          <c:set var="client" value="${dealBean.ccMNC}"/>
    </c:forEach>
</form>
</table>




********************************************************************************
<%@ taglib uri='struts/bean-el' prefix='bean' %>
<%@ taglib uri='struts/html-el' prefix='html' %>
<%@ taglib uri='struts/logic-el' prefix='logic' %>
<%@ taglib uri='jstl/c' prefix='c' %>
<c:set var="count" scope="page" value="0"/>

<div align="left"> <b><font color="#003366"> </font></b></div>
<!-- ========== CONTENT (start) ========== -->
<span class="redbold">Search Deals</span>
<a href="#" onClick="showHide('tbl2','e');return false;"><img id="e" src="./../images/expand.gif" border="0" alt="" width="15" height="15"></a>
<br>
<br>
<table id="tbl2" style= "display: none; border: 0px;position:relative; width="70%" border="0"  width="730">
 
  <tr>
    <td>
      <html:form action="/searchdeal" >
        <table width="309" class="tabTable">
    <tr>
      <td colspan="2" class="tabtitle">Search Deal By:</td>
    </tr>
    <tr>
      <td width="33%" class="right">Client MNC : </td>
      <td width="67%">
        <html:text styleClass="inputtextmedium" property="ccMNC"/>
      </td>
    </tr>
    <tr>
      <td width="33%" class="right"> Deal MNC: </td>
      <td width="67%">
        <html:text styleClass="inputtextmedium" property="dealMNC"/>
      </td>
    </tr>
    <tr>
      <td width="33%" height="46">&nbsp;</td>
      <td width="67%" height="46">
        <!--  <input type="button" class="submitsmall" name="Submit43" value="Search" onClick="window.location='./listdealsresults.jsp';">
        <input type="button" class="submitsmall" name="Button" value="Cancel" onClick="window.location='./home.jsp'">-->
      <html:submit styleClass="submitsmall" value="Search" property="button"/>
      <html:button styleClass="submitsmall" value="Cancel" property="button" onclick="window.location='./home.jsp'"/>
            
            <!-- ========== CONTENT (end) ========== -->
      </td>
    </tr>
  </table>
 </html:form>
     
    </td>
  </tr>
</table>


<hr width="665" align="left">
<span class="bio_listMedium">Deal Search Result : <font size=2 color="red"><c:out value="${matches}"/></font> matches found</span> <br>
<!-- ========== CONTENT (start) ========== -->
<br>

<logic:messagesPresent>
   <hr>
    <span id="errorsHeader"><bean:message key="errors.search.header"/></span>
    <html:messages id="error">
      <span id="errorsHeader"><li><c:out value="${error}"/></li></span>
    </html:messages>
    <hr>
</logic:messagesPresent>
<br>
<table width="36%" height="25" id="vtable">
  <tr>
    <th width="47%" nowrap height="24">
      <div align="center"><b>Client MNC</b></div>
    </th>
    <th width="53%" nowrap height="24">
      <div align="center"><b>Deal MNC</b></div>
    </th>
        
    <th width="53%" nowrap height="24">
      <div align="center"><b>Deal Name</b></div>
    </th>
          <th width="53%" nowrap height="24">
      <div align="center"><b>Deal Type</b></div>
    </th>
  </tr>
    <form name="Form1" action="#" method=POST>
<%
  try
  {
%>
<c:forEach var="dealBean" items="${dealresult}" varStatus="status">
     <h1>Yahoo</h1>
</c:forEach>
<%
  }
  catch( Exception ex )
  {
      ex.printStackTrace();
  }
%>



</form>
</table>

********************************************************************************

Thanx in advance.....let me know if something isnt clear
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 35

Expert Comment

by:TimYates
ID: 9788185
I can see no reason why this doesn't work :-(

It's as if JSTL doesn't work on Weblogic...

Which version of JSTL are you using?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 250 total points
ID: 9788217
The first paragraph of this page:

http://www.gideonfamily.org/roller/page/cmdln/20030530

Also says that Weblogic 6.1 is a bit bug ridden...there also seems to be SP5 out...

Can you apply this pack?  It (hopefully) might fix this bug...

-- hehe..  "hopefully" and "might" in one sentence...  do I fill you with confidence? ;-)

Tim
0
 

Author Comment

by:rahulkothari
ID: 9788219
JSTL 1.0.....
atleast thats what i think i downloaded....how do i make sure what verision it is ??
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9788250
hmmm....don't know... :-(

JSTL is up to 1.1 now...

That won't fix your problem though (I don't think), as I am starting to get the feeling that it's a problem with the version of Weblogic you are using...

Hmmmmm....

Tim
0
 

Author Comment

by:rahulkothari
ID: 9791356
This sucks big time man.....
anyways the solution to the problem was that i replace the outermost JSTL tag (ie c:forEach) with struts logic:iterate tag...works like a charm now.
Thanx for the help anyways.......always good to know that someone is in it with u :)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9791839
Glad I could be of some help...even if it was only spiritual ;-)

Good luck with  the project!  Hope it goes smoother from here on in :-)

Tim
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
format the code in java 6 72
java JDK Download 7 65
sumHeights2  challenge 7 76
nestparen challenge 4 56
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now