setArribute, Struts, and JSP

Posted on 2007-11-23
Last Modified: 2013-11-24
Here is a code snippet from one struts action:

             String isbn=request.getParameter("isbn");
             DAOFactory factory = DAOFactory.getDAOFactory(DAOFactory.FactoryImplementation.DB_DAO_FACTORY);
             BookDAO bao=factory.getBookDAO();
             Set<Section> sections=bao.getBook(new Isbn(isbn)).getSections();
             request.setAttribute("sections", sections);
             return mapping.findForward("success");

It forwards to a list.jsp page.

In list.jsp page, how shall I display "sections"?

Shall I use

<logic:present name="sections">

or something else?

Question by:tiger0516
  • 3
LVL 11

Assisted Solution

Manish earned 50 total points
ID: 20338488
LVL 11

Expert Comment

ID: 20338492
LVL 11

Accepted Solution

Manish earned 50 total points
ID: 20338493

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now