Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4052700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:21:10+00:00 2026-05-20T14:21:10+00:00

I am doing a project which searches a specific member from my database searching

  • 0

I am doing a project which searches a specific member from my database searching for his memberId and then show selected information, but I’m having trouble with my Java Class Setter(not really sure if it was really the problem) because I keep on receiving error message from the catch(Exception ex)

javax.el.PropertyNotFoundException: The class ‘Project.Members’ does not have the property ‘FirstName’.

Can you help me figure out what was wrong with my code?

This is my servlet code:

public class SearchAMember extends HttpServlet {


protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    Connection con = null;
    PreparedStatement stmt = null;
    ResultSet rs = null;
    String query = "SELECT memberId, FirstName FROM members WHERE memberId = ?";
    try {
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Servlet SelectDemo</title>");
        out.println("</head>");
        out.println("<body>");

        try {
            Class.forName(Connect.DRIVER);
            con = DriverManager.getConnection(Connect.CONNECTION_STRING,
                    Connect.USERNAME, Connect.PASSWORD);

            stmt = con.prepareStatement(query);
            int findId = Integer.parseInt(request.getParameter("id"));
            stmt.setInt(1, findId);
            rs = stmt.executeQuery();

            Members std;
            if (rs.next()) {
                std = new Members();
                std.setMemberId(rs.getInt("memberId"));
                std.setFirstName(rs.getString("FirstName"));
                request.setAttribute("Members", std);
                RequestDispatcher rd = request.getRequestDispatcher("/DisplayAllMembers.jsp");
                rd.forward(request, response);
            } else {
                out.println("No record found...");
            }

        } catch (ClassNotFoundException ex) {
            out.println("Driver not found...");
        } catch (SQLException ex) {
            out.println("Failed connection or query...." + ex.getMessage());
        } catch (Exception ex) {
            out.println("Error.... " + ex.getMessage());
        } finally {
            try {
                con.close();
            } catch (SQLException ex) {
            }
        }
    } finally {
        out.println("</body>");
        out.println("</html>");
        out.close();
    }
}

/*<--HttpServlet Method was here-->*/
}

}

and my Member.java class for my getter and setter:

public class Members {

private int memberId;
private String Username;
private String Password;
private String FirstName;
private String MiddleName;
private String LastName;
private String Address;
private String Email;
private int CurrPoints;

public String getAddress() {
    return Address;
}

public int getCurrPoints() {
    return CurrPoints;
}

public String getEmail() {
    return Email;
}

public String getFirstName() {
    return FirstName;
}

public String getLastName() {
    return LastName;
}

public String getMiddleName() {
    return MiddleName;
}

public String getPassword() {
    return Password;
}

public String getUsername() {
    return Username;
}

public int getMemberId() {
    return memberId;
}

public void setAddress(String Address) {
    this.Address = Address;
}

public void setCurrPoints(int CurrPoints) {
    this.CurrPoints = CurrPoints;
}

public void setEmail(String Email) {
    this.Email = Email;
}

public void setFirstName(String FirstName) {
    this.FirstName = FirstName;
}

public void setLastName(String LastName) {
    this.LastName = LastName;
}

public void setMiddleName(String MiddleName) {
    this.MiddleName = MiddleName;
}

public void setPassword(String Password) {
    this.Password = Password;
}

public void setUsername(String Username) {
    this.Username = Username;
}

public void setMemberId(int memberId) {
    this.memberId = memberId;
}

}

also this is my Jsp:

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
</head>
<body>
    <h1>Members Information</h1>
    Id: ${Members.memberId}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Name: ${Members.FirstName}<br/>
</body>

Does the problem was at my Members.java class? I am really clueless what was wrong with it… please help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:21:11+00:00Added an answer on May 20, 2026 at 2:21 pm

    You should respect the Java naming conventions. Variables always start with a lowercase letter. Properties also start with a lowercase letter. And since the Members class represents one member, you should also call it Member, not Members.

    request.setAttribute("member", std);
    
    public class Member {
        private String firstName;
        // ...
        public String getFirstName() {
            return this.firstName;
        }
    }
    
    Id: ${member.memberId}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    Name: ${member.firstName}<br/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing Oracle database project which called Theatre booking system. I am trying
i am doing a project in which i have to get the image from
I am currently doing a project in which I have to request data from
I am doing a project which includes dynamic controls creation and removal from the
I am doing a project which is loading lot of data from the server.
I am doing a project which involves a good use of core data. I
I am doing a project which is based on storing the employee details, like
I am doing a project which involves authentication and I can't quite grasp the
I am doing a project in which I require btree or b+tree data structure.
I am doing a project in which i am designing a Text Editor application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.