This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How to iterate my vector...? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to iterate my vector...?" Watch "How to iterate my vector...?" New topic
Author

How to iterate my vector...?

hans meiser
Greenhorn

Joined: Dec 29, 2008
Posts: 22
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...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

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?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to iterate my vector...?
 
Similar Threads
struts 2: how can i pass a Vector as a parameter?
struts2: how to pass a variable from one action to another action class.
dynamic drop down list
input values like name="bean.property" can not be populated to interceptors
Caching Issues with Hibnernate