Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to retrieve List content in JSP from Hibernate Query Language

How to retrieve List content in JSP from Hibernate Query Language

Scheduled Pinned Locked Moved Database
javadatabasetutorial
1 Posts 1 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr ARUL SUJU D
    wrote on last edited by
    #1

    I Developed the program that retrieve the content from Database and store it in the List

    List studentList=session.createQuery("from Student s where s.lastName=:lastName and s.firstName=:firstName")
    .setString("lastName",lname)
    .setString("firstName",fname).list();
    for(Student studentinfo:studentList)
    {
    System.out.println(studentinfo);
    }
    model.addAttribute("result",studentList);
    And i have passed the result to the JSP File

    ${result}
    ${item}
    

    I am getting the result like this

    "Student{id=6, firstName='arul', lastName='suju', address='s;lda'}"

    But i want print the value one by one,Can any one suggest better code in JSP

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups