• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to iterate my vector...?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello! I have a problem with my jsp file.

First i have my Action Class:

public class EmployeeProblemLoadAction extends ActionSupport implements SessionAware, ValidationAware
{

private static final long serialVersionUID = 1L;
private Map session;

private Vector<Problem> problemVector = null;
private Exception exception = null;

public String loadProblems()
{
try
{
LoginGrantTicket loginTicket = (LoginGrantTicket) session.get(TicketSystemSessionConstants.KEY_SESSION_LOGIN_GRANT_TICKET);

String userId = loginTicket.getLoginUser().getUserId();

DataLoadUnit dataLoadUnit = new DataLoadUnit();

problemVector = dataLoadUnit.LoadProblems(userId);

return Action.INPUT;
} catch (Exception e)
{
// TODO Auto-generated catch block
this.exception = e;
return Action.ERROR;
}
}


public Map getSession()
{
return session;
}


public void setSession(Map session)
{
this.session = session;
}


public Vector<Problem> getProblemVector()
{
return problemVector;
}


public void setProblemVector(Vector<Problem> problemVector)
{
this.problemVector = problemVector;
}


public Exception getException()
{
return exception;
}
}


In this class i create my vector, and add problemObjects which belong to a user, into this vector. Now i would like to display a table in my jsp file, for every object in my vector there should be one row.

i tried to iterate over the vector, but i think i did not use the right syntax.

Maybe someone of you could give me some advice?

Thank you very much...
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by hans meiser:

i tried to iterate over the vector, but i think i did not use the right syntax.



Welcome to the JavaRanch.
Can you show us what syntax you used?
 
reply
    Bookmark Topic Watch Topic
  • New Topic