Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing a collection within a display tag.

2 views
Skip to first unread message

anvesh...@gmail.com

unread,
Jan 12, 2015, 6:21:51 AM1/12/15
to

I am using hibernate (many to many mapping) along with struts2.

In my model class below, i have strings and collections, which are read from DataBase using HQL. I

public class Test_Tools {
private int testToolID;
private String toolName;


private Collection<Application_Type> applicationTypes;
private Collection<Browser> browsers;

public Test_Tools() {

}

public int getTestToolID() {
return testToolID;
}

public void setTestToolID(int testToolID) {
this.testToolID = testToolID;
}

public String getToolName() {
return toolName;
}

public void setToolName(String toolName) {
this.toolName = toolName;
}


public Collection<Application_Type> getApplicationTypes() {
return applicationTypes;
}

public void setApplicationTypes(Collection<Application_Type> applicationTypes) {
this.applicationTypes = applicationTypes;
}

public Collection<Browser> getBrowsers() {
return browsers;
}

public void setBrowsers(Collection<Browser> browsers) {
this.browsers = browsers;
}

}


Here is my action class:
public class ReadToolsList extends ActionSupport implements SessionAware {
private Collection<Test_Tools> TestingToolsList = new ArrayList<Test_Tools>();

Map Session;

ReadToolsListLogic RDT = new ReadToolsListLogic();

public String toolsList() {

setTestingToolsList(RDT.readToolsLogic());

return Action.SUCCESS;
}

public String browserOpen() {
return Action.SUCCESS;
}

@Override
public void setSession(Map arg0) {
// TODO Auto-generated method stub

}

public Map getSession() {
return Session;
}

public Collection<Test_Tools> getTestingToolsList() {
return TestingToolsList;
}

public void setTestingToolsList(Collection<Test_Tools> testingToolsList) {
TestingToolsList = testingToolsList;
}
}

Now I want to print the records read from the DB in jsp page using display tag along with collections.

Please provide me with a sample code.
0 new messages