Accessing ArrayList from a class and displaying it in a JSP page

I have a class


import java.util.ArrayList;
import java.util.Iterator;
//import java.util.Collections;



public class ArrayList_Test {

public void myMethod(){

ArrayList a = new ArrayList();
//String str = "test";
    }catch(Exception e)
          System.out.println("  "+e.toString());
   System.out.println("  My Array List"+ a.toString());
   Iterator I = a.iterator();
      System.out.println(" NEXT "+;
public static void main(String args[]){
                        ArrayList_Test b = new ArrayList_Test();

Now i have a JSP page

<%@ taglib uri="struts-logic.tld" prefix="logic" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page
contentType="text/html; charset=ISO-8859-1"
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"

<jsp:useBean id="array_test" class="ArrayList_Test" scope="application">
<jsp:setProperty name="array_test" property="*"/>
You entered<BR>
Name:<%/**= array_test. myMethod()**/%><BR>


                        id="array_test" type="id"
                        name="a" scope="application"
                              The Id is: <jsp:property
                                                name="array_test" property="id"/>

now i'm getting getting this error "Broken Link - /ArrayListJSP/struts-logic.tld - Standalone TLD files must be under the WEB-INF directory.      ArrayList.jsp      ArrayListJSP/WebContent      line 1"
I'm using WSAD for development and trying to display the ArrayList values in the above JSP page, pls see what's wrong, i'm a novice and step by step help will be good and i also have STRUTS support enabled. It would be good if i use STRUTS


Who is Participating?
siliconeagleConnect With a Mentor Commented:
did this help? havent heard anything on this thread for a while.
how have you configured your taglib in the web.xml file?
you should have a line such as this in web.xml:-

and the taglib TLD file shoud be in your WEB-INF directory.

you would use it in your page like this:-
<%@ taglib uri="/struts-logic" prefix="logic" %>
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.