Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to display arraylist in jsp

newnetApr 13 2008 — edited Apr 15 2008
I try to display arrayList
past from servlet
my code looks like
<%@ include file="/expires.jsp" %>
<%@ page language="java" import="java.sql.*" contentType="text/html;charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CEDARS</title>
</head>
<body>


  
<% String allFound = (String) session.getAttribute("allFound");
hallA mydata= new hallA(); 
    for(int j=0; j<allFound.length(); j++){
	                 mydata=(hallA)allFound.get(j);  %>
	            <tr>           
	            <td>mydata.getUniversityN()</td>
	             <td> mydata.getName()</td>
	             <td>mydata.getRnumber()</td>
	             <td>mydata.getCurricumlum()</td>
	             <td> mydata.getGender()</td>
	             <td>mydata.getYear()</td>
	             <td>mydata.getMobilNo()</td>
	             <td>mydata.getEmail()</td>
	             <td> mydata.getFinalYear()</td>
	             <td> mydata.getPeriodOne()</td>
	             <td> mydata.getPeriodTwo()</td>            
	           </tr>           
	  <%}%>   
  
 
</body>
</html> and I got the error like
Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 13 in the jsp file: /showResultA.jsp
hallA cannot be resolved to a type
10: 
11:   
12: <% String allFound = (String) session.getAttribute("allFound");
13: hallA mydata= new hallA(); 
14:     for(int j=0; j<allFound.length(); j++){
15: 	                 mydata=(hallA)allFound.get(j);  %>
16: 	            <tr>           


An error occurred at line: 13 in the jsp file: /showResultA.jsp
hallA cannot be resolved to a type
10: 
11:   
12: <% String allFound = (String) session.getAttribute("allFound");
13: hallA mydata= new hallA(); 
14:     for(int j=0; j<allFound.length(); j++){
15: 	                 mydata=(hallA)allFound.get(j);  %>
16: 	            <tr>           


An error occurred at line: 15 in the jsp file: /showResultA.jsp
hallA cannot be resolved to a type
12: <% String allFound = (String) session.getAttribute("allFound");
13: hallA mydata= new hallA(); 
14:     for(int j=0; j<allFound.length(); j++){
15: 	                 mydata=(hallA)allFound.get(j);  %>
16: 	            <tr>           
17: 	            <td>mydata.getUniversityN()</td>
18: 	             <td> mydata.getName()</td>


An error occurred at line: 15 in the jsp file: /showResultA.jsp
The method get(int) is undefined for the type String
12: <% String allFound = (String) session.getAttribute("allFound");
13: hallA mydata= new hallA(); 
14:     for(int j=0; j<allFound.length(); j++){
15: 	                 mydata=(hallA)allFound.get(j);  %>
16: 	            <tr>           
17: 	            <td>mydata.getUniversityN()</td>
18: 	             <td> mydata.getName()</td>


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
I don't know how to fix it
thnak you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2008
Added on Apr 13 2008
7 comments
4,804 views