How to view all users on a database - JDBC Struts

On my database table I have 6 rows of users.

I want to display all the users in the database.

When I run my code I get the value for the 6th row 6 times.


public String allMembers() throws SQLException {
List<String> members = new ArrayList<String>();
        connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/Web", "root", "root");
        Statement statement = connection.createStatement();
         ResultSet res = statement.executeQuery("select * from Users");
        while ({
            userName = userName.trim();
    }catch (SQLException e) {
    return "SUCCESS";


     <b>Example of Iterator Tag</b><br/>
     <s:iterator value="members" status="ctr">
     <s:property value="userName"/> 

How can I fix this and get it to display all users.

String userName

private String userName;
public String getUserName() {
    return userName;

public void setUserName(String userName) {
    this.userName = userName;


In your action class

List<String> members = new ArrayList<String>();

public List<String> getMembers() {
        return members;

    public void setMembers(List<String> members) {
        this.members = members;

In your jsp

<s:iterator value="members" status="memberStatus">


You do


Which does unknown things. But then you continue...

        userName = userName.trim();

Where does userName come from? Where is it set to what?

Need Your Help

ncurses: Is it possible to refresh a window without removing its borders?

c++ ncurses

Since I haven't found anything else online I'm guessing that wborder just "mvprintw"s characters to the appropriate parts of the window instead of actually making a border object or anything deeper...

Logstash not_analyzed

csv logstash kibana elastic-stack

I am a total newby to the ELK stack and probably trying to setup a much to complicated config to start with... :-)