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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:39:48+00:00 2026-06-14T10:39:48+00:00

I have problem displaying details of a bean using JSTL. My servlet code is

  • 0

I have problem displaying details of a bean using JSTL. My servlet code is as follow

 protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();

    String username =request.getParameter("username");
    String password = request.getParameter("password");
    try {

        con = connection.connectionfile();

        pstmt=con.prepareStatement("select * from Login where Username=? and Password=?");
        pstmt.setString(1,username);
        pstmt.setString(2, password);
        rs = pstmt.executeQuery();

        if(rs.next())
        {
            ListGrabber grabber = new ListGrabber();
            List<DvdDetail> list = new ArrayList<DvdDetail>();
            list=grabber.getBeanList();

            request.setAttribute("listbean",list);
            RequestDispatcher view = request.getRequestDispatcher("listdetail.jsp");

            view.forward(request, response);


        }
        else
        {
            response.sendRedirect("loginerror.html");
        }

    } 
     catch(Exception ex)
     {
        ex.printStackTrace();
     }

    finally {            
        out.close();
        try
        {
            rs.close();
            con.close();
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
    }
}

Bean is as follow:

   public class DvdDetail {

private int id;
private String film_name;
private String released_date;
private String directed_by;
private String actor_name;
private String actress_name;
private int price;
private String banner;

public DvdDetail(int id,String film_name,String released_date,String directed_by,String actor_name,String actress_name,int price,String banner)
{

    this.id=id;
    this.film_name=film_name;
    this.released_date=released_date;
    this.directed_by=directed_by;
    this.actor_name=actor_name;
    this.actress_name=actress_name;
    this.price=price;
    this.banner=banner;

}

public String getActor_name() {
    return actor_name;
}

public void setActor_name(String actor_name) {
    this.actor_name = actor_name;
}

public String getActress_name() {
    return actress_name;
}

public void setActress_name(String actress_name) {
    this.actress_name = actress_name;
}

public String getBanner() {
    return banner;
}

public void setBanner(String banner) {
    this.banner = banner;
}

public String getDirected_by() {
    return directed_by;
}

public void setDirected_by(String directed_by) {
    this.directed_by = directed_by;
}

public String getFilm_name() {
    return film_name;
}

public void setFilm_name(String film_name) {
    this.film_name = film_name;
}

public int getId() {
    return id;
}

public void setId(int id) {
    this.id = id;
}

public int getPrice() {
    return price;
}

public void setPrice(int price) {
    this.price = price;
}

public String getReleased_date() {
    return released_date;
}

public void setReleased_date(String released_date) {
    this.released_date = released_date;
}



}

How would I print out multiple movies name in a JSP page but using only JSTL. In JSP I usually solve it as

List<DvdDetail> list = request.getParameter("listbean");
for(int i=0;i<list.size();i++)
{
  DvdDetail bean = list.get(i);
  ///displaying usng out.print(bean.getProperty());
}

I need to achieve same thing but using JSTL.

  • 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-06-14T10:39:49+00:00Added an answer on June 14, 2026 at 10:39 am

    Click on the info link in the popover on the JSTL tag you added on your question to get information about the JSTL and links to tutorials.

    What you want to achieve could be done like this:

    <ul>
        <c:forEach var="dvd" items="${listbean}">
            <li><c:out value="${dvd.film_name}"/></li>
        </c:forEach>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with displaying adsense ads in ie7 google adsense adds an iframe
I have a problem displaying non- ASCII characters in Matplotlib, these characters are rendered
I have a problem displaying zebra list after filtering results. I have a zebra
I'm generating dynamic HTML inside Delphi. I have no problem displaying UTF-8 strings inside
I have some problem with displaying emoji icon in Android TextView First, I found
I have a problem consistently displaying Facebook Comments on my AJAX driven website. Each
I have problem with my query on C, I’m using the oci8 driver. This
This is my first time really using graphics with Java. I have a problem
I'm currently having a problem in displaying some stuff in ListView . I have
I have a problem with my application which is here . Please follow steps

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.