Results 1 to 3 of 3
  1. #1
    Freddie is offline Member
    Join Date
    May 2007
    Posts
    41
    Rep Power
    0

    Default working with servlets

    I am trying to join 2 tables relationed by their classes and methods, and then send to my JSP to show them joined. Aclaration: in my servlet I execute this:
    Java Code:
    Vector listap = objp.SearchPerson(name);
    for(int i=0;i<listap.size();i++){
    objperson = (cPerson) listap.elementAt(i);
    objDistrict .SearchIdDistrict (objperson.getIdDistrict );
    District =objDistrict.getNombre();
    }
    but i can´t go on, because I am trying to send to my jsp an array that contain person and his District .

    In my servlet send to jsp like this:

    Java Code:
    req.setAttribute("listap",listap);
    req.getRequestDispatcher("/manPerson.jsp").forward(req,res);
    But as you can read I send person and I want to send name of the District

    thanks

  2. #2
    pegitha is offline Member
    Join Date
    Apr 2007
    Location
    Indiana
    Posts
    83
    Rep Power
    0

    Default

    Why don't you make a PersonDistrictBean, fill them with the data and send the list of PersonDistrictBeans to the jsp?

  3. #3
    Alan is offline Member
    Join Date
    May 2007
    Posts
    39
    Rep Power
    0

    Default

    Did you solve it?
    mm I think that in vector listap you didn&#180;t add the district.
    plz let me know if it was the problem

Similar Threads

  1. Java Servlets
    By kondalrao in forum Java Servlet
    Replies: 0
    Last Post: 04-14-2008, 11:12 AM
  2. Deploying Servlets
    By gapper in forum New To Java
    Replies: 2
    Last Post: 01-17-2008, 12:43 PM
  3. servlets or jsp
    By krishnapal in forum Advanced Java
    Replies: 1
    Last Post: 12-13-2007, 02:31 PM
  4. Servlets
    By nagaroopanandha in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 02:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •