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 6858291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:08:22+00:00 2026-05-27T02:08:22+00:00

I am creating a simple guest book in JSP in order to learn this

  • 0

I am creating a simple guest book in JSP in order to learn this technology. Currently I have two classes: guestbook/GuestBook.class and guestbook/Entry.class (I haven’t finished the app yet, so I have only these classes) which are added into WEB-INF/libs/ and they’re included properly. In my file index.jsp I am using guestbook.GuestBook class; its method returns Vector. When I iterate over entries and I’d like to print an author of the entry, I can see:

javax.el.PropertyNotFoundException: Property 'author' not found on type guestbook.Entry

I must add that Entry class is public and author attribute is declared in such way:

public String author;

So it is public, too. This is my code when I iterate over the entries:

<c:forEach items="${entries}" varStatus="i">
  <c:set var="entry" value="${entries[i.index]}" />
  <li><c:out value="${entry.author}" /></li>
</c:forEach>

and

entry.class.name

returns guestbook.Entry

The classes are in package guestbook (as you can guess), entries vector is passed to pageContext.

I do not know what is wrong with my way of doing it. Can anybody help me please with that? (Thanks in advance!)

  • 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-27T02:08:23+00:00Added an answer on May 27, 2026 at 2:08 am

    JSP EL will not recognise public fields in your classes, it only works with getter methods (which is good practice anyway – never expose your classes’ state as public fields like this).

    So use

    private String author;
    
    public String getAuthor() {
       return author;
    }
    

    instead of

    public String author;
    

    As a side note, your JSTL is overly complicated, it can be simplified to:

    <c:forEach items="${entries}" var="entry">
      <li><c:out value="${entry.author}" /></li>
    </c:forEach>
    

    or even

    <c:forEach items="${entries}" var="entry">
      <li>${entry.author}</li>
    </c:forEach>
    

    although the latter form will not XML-escape the author name, so isn’t advised.

    Lastly, the Vector class is obsolete, you should use ArrayList instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating simple app on Silverlight 4. In folder of View I have
I have a fairly simple database that I inherited. For the purposes of this
I have created a simple command line tool that outputs hello world. This is
i want to create some simple wrapper classes for an existing class library. To
i am creating simple call filter application which restrict unwanted calls. i use following
Creating a simple RPG game, first time using XNA. Trying to get my character
Was creating a simple console application to do some prototyping and was shocked to
I'm just creating a simple list and then destroying it. And something is going
I am creating a simple web application. But I am facing a problem with
I'm creating a simple sticky note app. I want to make a JPopupMenu to

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.