cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lektroluv <>
Subject Searching an arraylist
Date Fri, 22 Jan 2010 22:58:43 GMT

I have a java class called Projects. This class has an arraylist of projects.
Constructor Projects:
public Projects() {
       projects = new ArrayList<Project>();
       Project s1 = new Project("Something in Java", "group1");
       Project s2 = new Project("Something in C++", "group2");
       Project s3 = new Project("Something in Ruby", "group3");


(Located at src/main/java/...)

Now I want to make a "search engine". 
With an input field I can search for a word (1 word) in the project titles.
If this word is found in a project title, the project should be added to a
new list.

At the end, a list of all the projects that contain the searched word should
be listed in the browser.

I will now show the things I have.
<form action="searchedList.html" method="post">
      <input name="searchWord"/>
    <input type="submit" value="search"/>


function demo() {
    var sw = cocoon.request.get("searchWord");



<?xml version="1.0" encoding="UTF-8"?>
  <h1>Het antwoord</h1>
     Voornaam: #{voornaam}
     Naam: #{naam}

View this message in context:
Sent from the Cocoon - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message