unable to display data on broswer using spring hibernate.below is my code and outputWrong ordering in generated table in jpaajax jquery url specificationwant to add two different tables(classes) in one hibernate criteriaGenericDAO + Spring + JPA2 no unique beanHibernate: ManyToMany inverse DeleteHow to render partial view in Spring MVCMappingJackson2HttpMessageConverter Can not find a (Map) Key deserializer for typecom.fasterxml.jackson.databind.JsonMappingException: Multiple back-reference properties with name 'defaultReference'org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update&ORA-02289: sequence does not existshow details of all orders placed by customer

How to deal with fear of taking dependencies

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

Could Giant Ground Sloths have been a good pack animal for the ancient Mayans?

Ideas for 3rd eye abilities

How do I create uniquely male characters?

Domain expired, GoDaddy holds it and is asking more money

Where else does the Shulchan Aruch quote an authority by name?

Unbreakable Formation vs. Cry of the Carnarium

Landing in very high winds

Are white and non-white police officers equally likely to kill black suspects?

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

"My colleague's body is amazing"

How can I plot a Farey diagram?

New order #4: World

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Prime joint compound before latex paint?

Typesetting a double Over Dot on top of a symbol

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

Is it wise to focus on putting odd beats on left when playing double bass drums?

Is there a way to make member function NOT callable from constructor?

Was there ever an axiom rendered a theorem?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

Is there any use for defining additional entity types in a SOQL FROM clause?



unable to display data on broswer using spring hibernate.below is my code and output


Wrong ordering in generated table in jpaajax jquery url specificationwant to add two different tables(classes) in one hibernate criteriaGenericDAO + Spring + JPA2 no unique beanHibernate: ManyToMany inverse DeleteHow to render partial view in Spring MVCMappingJackson2HttpMessageConverter Can not find a (Map) Key deserializer for typecom.fasterxml.jackson.databind.JsonMappingException: Multiple back-reference properties with name 'defaultReference'org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update&ORA-02289: sequence does not existshow details of all orders placed by customer






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Unable to display data on broswer using spring hibernate.below is my code and output..



Class: CustomerController



package com.luv2code.springdemo.controller;

import com.luv2code.springdemo.DAO.CustomerDAO;
import com.luv2code.springdemo.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.List;

@Controller
@RequestMapping("/customer")
public class CustomerController

@Autowired
private CustomerDAO customerDAO;

@RequestMapping("/list")
public String listCustomer(Model theModel)
List<Customer> theCustomers = customerDAO.getCustomers();

theModel.addAttribute("customers", theCustomers);

System.out.println(theCustomers);

return "list-customer";




Class: CustomerDAO Implementation



package com.luv2code.springdemo.DAO;

import com.luv2code.springdemo.entity.Customer;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public class CustomerDAOImpl implements CustomerDAO

@Autowired
private SessionFactory sessionFactory;

@Override
@Transactional
public List<Customer> getCustomers()
Session getSession = sessionFactory.getCurrentSession();

Query<Customer> theCustomers = getSession.createQuery("from Customer", Customer.class);

List<Customer> customers = theCustomers.getResultList();

return customers;




Class: Customer mapping to database



package com.luv2code.springdemo.entity;

import javax.persistence.*;

@Entity
@Table(name="customer")
public class Customer

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;

@Column(name = "first_name")
private String firstName;

@Column(name="last_name")
private String lastName;

@Column(name = "email")
private String email;

public Customer()


public int getId()
return id;


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


public String getFirstName()
return firstName;


public void setFirstName(String firstName)
this.firstName = firstName;


public String getLastName()
return lastName;


public void setLastName(String lastName)
this.lastName = lastName;



public String getEmail()
return email;


public void setEmail(String email)
this.email = email;



@Override
public String toString()
return "Customer" +
"id=" + id +
", firstName='" + firstName + ''' +
", lastName='" + lastName + ''' +
", email='" + email + ''' +
'';





jsp page..



 <table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>

<!-- loop over and print our customers -->
<c:forEach var="tempCustomer" items="$customers">

<tr>
<td> $tempCustomer.firstName </td>
<td> $tempCustomer.lastName </td>
<td> $tempCustomer.email </td>
</tr>

</c:forEach>

</table>


Output



enter image description here










share|improve this question






























    1















    Unable to display data on broswer using spring hibernate.below is my code and output..



    Class: CustomerController



    package com.luv2code.springdemo.controller;

    import com.luv2code.springdemo.DAO.CustomerDAO;
    import com.luv2code.springdemo.entity.Customer;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.RequestMapping;


    import java.util.List;

    @Controller
    @RequestMapping("/customer")
    public class CustomerController

    @Autowired
    private CustomerDAO customerDAO;

    @RequestMapping("/list")
    public String listCustomer(Model theModel)
    List<Customer> theCustomers = customerDAO.getCustomers();

    theModel.addAttribute("customers", theCustomers);

    System.out.println(theCustomers);

    return "list-customer";




    Class: CustomerDAO Implementation



    package com.luv2code.springdemo.DAO;

    import com.luv2code.springdemo.entity.Customer;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.query.Query;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Repository;
    import org.springframework.transaction.annotation.Transactional;

    import java.util.List;

    @Repository
    public class CustomerDAOImpl implements CustomerDAO

    @Autowired
    private SessionFactory sessionFactory;

    @Override
    @Transactional
    public List<Customer> getCustomers()
    Session getSession = sessionFactory.getCurrentSession();

    Query<Customer> theCustomers = getSession.createQuery("from Customer", Customer.class);

    List<Customer> customers = theCustomers.getResultList();

    return customers;




    Class: Customer mapping to database



    package com.luv2code.springdemo.entity;

    import javax.persistence.*;

    @Entity
    @Table(name="customer")
    public class Customer

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private int id;

    @Column(name = "first_name")
    private String firstName;

    @Column(name="last_name")
    private String lastName;

    @Column(name = "email")
    private String email;

    public Customer()


    public int getId()
    return id;


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


    public String getFirstName()
    return firstName;


    public void setFirstName(String firstName)
    this.firstName = firstName;


    public String getLastName()
    return lastName;


    public void setLastName(String lastName)
    this.lastName = lastName;



    public String getEmail()
    return email;


    public void setEmail(String email)
    this.email = email;



    @Override
    public String toString()
    return "Customer" +
    "id=" + id +
    ", firstName='" + firstName + ''' +
    ", lastName='" + lastName + ''' +
    ", email='" + email + ''' +
    '';





    jsp page..



     <table>
    <tr>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Email</th>
    </tr>

    <!-- loop over and print our customers -->
    <c:forEach var="tempCustomer" items="$customers">

    <tr>
    <td> $tempCustomer.firstName </td>
    <td> $tempCustomer.lastName </td>
    <td> $tempCustomer.email </td>
    </tr>

    </c:forEach>

    </table>


    Output



    enter image description here










    share|improve this question


























      1












      1








      1








      Unable to display data on broswer using spring hibernate.below is my code and output..



      Class: CustomerController



      package com.luv2code.springdemo.controller;

      import com.luv2code.springdemo.DAO.CustomerDAO;
      import com.luv2code.springdemo.entity.Customer;
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Controller;
      import org.springframework.ui.Model;
      import org.springframework.web.bind.annotation.RequestMapping;


      import java.util.List;

      @Controller
      @RequestMapping("/customer")
      public class CustomerController

      @Autowired
      private CustomerDAO customerDAO;

      @RequestMapping("/list")
      public String listCustomer(Model theModel)
      List<Customer> theCustomers = customerDAO.getCustomers();

      theModel.addAttribute("customers", theCustomers);

      System.out.println(theCustomers);

      return "list-customer";




      Class: CustomerDAO Implementation



      package com.luv2code.springdemo.DAO;

      import com.luv2code.springdemo.entity.Customer;
      import org.hibernate.Session;
      import org.hibernate.SessionFactory;
      import org.hibernate.query.Query;
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Repository;
      import org.springframework.transaction.annotation.Transactional;

      import java.util.List;

      @Repository
      public class CustomerDAOImpl implements CustomerDAO

      @Autowired
      private SessionFactory sessionFactory;

      @Override
      @Transactional
      public List<Customer> getCustomers()
      Session getSession = sessionFactory.getCurrentSession();

      Query<Customer> theCustomers = getSession.createQuery("from Customer", Customer.class);

      List<Customer> customers = theCustomers.getResultList();

      return customers;




      Class: Customer mapping to database



      package com.luv2code.springdemo.entity;

      import javax.persistence.*;

      @Entity
      @Table(name="customer")
      public class Customer

      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private int id;

      @Column(name = "first_name")
      private String firstName;

      @Column(name="last_name")
      private String lastName;

      @Column(name = "email")
      private String email;

      public Customer()


      public int getId()
      return id;


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


      public String getFirstName()
      return firstName;


      public void setFirstName(String firstName)
      this.firstName = firstName;


      public String getLastName()
      return lastName;


      public void setLastName(String lastName)
      this.lastName = lastName;



      public String getEmail()
      return email;


      public void setEmail(String email)
      this.email = email;



      @Override
      public String toString()
      return "Customer" +
      "id=" + id +
      ", firstName='" + firstName + ''' +
      ", lastName='" + lastName + ''' +
      ", email='" + email + ''' +
      '';





      jsp page..



       <table>
      <tr>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Email</th>
      </tr>

      <!-- loop over and print our customers -->
      <c:forEach var="tempCustomer" items="$customers">

      <tr>
      <td> $tempCustomer.firstName </td>
      <td> $tempCustomer.lastName </td>
      <td> $tempCustomer.email </td>
      </tr>

      </c:forEach>

      </table>


      Output



      enter image description here










      share|improve this question
















      Unable to display data on broswer using spring hibernate.below is my code and output..



      Class: CustomerController



      package com.luv2code.springdemo.controller;

      import com.luv2code.springdemo.DAO.CustomerDAO;
      import com.luv2code.springdemo.entity.Customer;
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Controller;
      import org.springframework.ui.Model;
      import org.springframework.web.bind.annotation.RequestMapping;


      import java.util.List;

      @Controller
      @RequestMapping("/customer")
      public class CustomerController

      @Autowired
      private CustomerDAO customerDAO;

      @RequestMapping("/list")
      public String listCustomer(Model theModel)
      List<Customer> theCustomers = customerDAO.getCustomers();

      theModel.addAttribute("customers", theCustomers);

      System.out.println(theCustomers);

      return "list-customer";




      Class: CustomerDAO Implementation



      package com.luv2code.springdemo.DAO;

      import com.luv2code.springdemo.entity.Customer;
      import org.hibernate.Session;
      import org.hibernate.SessionFactory;
      import org.hibernate.query.Query;
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Repository;
      import org.springframework.transaction.annotation.Transactional;

      import java.util.List;

      @Repository
      public class CustomerDAOImpl implements CustomerDAO

      @Autowired
      private SessionFactory sessionFactory;

      @Override
      @Transactional
      public List<Customer> getCustomers()
      Session getSession = sessionFactory.getCurrentSession();

      Query<Customer> theCustomers = getSession.createQuery("from Customer", Customer.class);

      List<Customer> customers = theCustomers.getResultList();

      return customers;




      Class: Customer mapping to database



      package com.luv2code.springdemo.entity;

      import javax.persistence.*;

      @Entity
      @Table(name="customer")
      public class Customer

      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private int id;

      @Column(name = "first_name")
      private String firstName;

      @Column(name="last_name")
      private String lastName;

      @Column(name = "email")
      private String email;

      public Customer()


      public int getId()
      return id;


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


      public String getFirstName()
      return firstName;


      public void setFirstName(String firstName)
      this.firstName = firstName;


      public String getLastName()
      return lastName;


      public void setLastName(String lastName)
      this.lastName = lastName;



      public String getEmail()
      return email;


      public void setEmail(String email)
      this.email = email;



      @Override
      public String toString()
      return "Customer" +
      "id=" + id +
      ", firstName='" + firstName + ''' +
      ", lastName='" + lastName + ''' +
      ", email='" + email + ''' +
      '';





      jsp page..



       <table>
      <tr>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Email</th>
      </tr>

      <!-- loop over and print our customers -->
      <c:forEach var="tempCustomer" items="$customers">

      <tr>
      <td> $tempCustomer.firstName </td>
      <td> $tempCustomer.lastName </td>
      <td> $tempCustomer.email </td>
      </tr>

      </c:forEach>

      </table>


      Output



      enter image description here







      spring hibernate






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 7:23









      alseether

      1,70121731




      1,70121731










      asked Mar 8 at 7:12









      RazanRazan

      63




      63






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You're probably using an old version of jstl where expressions must be called witch <c:out/> tag.



          Try the following in your jsp



          <td><c:out value="$tempCustomer.firstName" /></td>
          <td><c:out value="$tempCustomer.lastName" /></td>
          <td><c:out value="$tempCustomer.email" /></td>





          share|improve this answer























          • I tried this way... but same issue.

            – Razan
            Mar 8 at 8:49











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058394%2funable-to-display-data-on-broswer-using-spring-hibernate-below-is-my-code-and-ou%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You're probably using an old version of jstl where expressions must be called witch <c:out/> tag.



          Try the following in your jsp



          <td><c:out value="$tempCustomer.firstName" /></td>
          <td><c:out value="$tempCustomer.lastName" /></td>
          <td><c:out value="$tempCustomer.email" /></td>





          share|improve this answer























          • I tried this way... but same issue.

            – Razan
            Mar 8 at 8:49















          0














          You're probably using an old version of jstl where expressions must be called witch <c:out/> tag.



          Try the following in your jsp



          <td><c:out value="$tempCustomer.firstName" /></td>
          <td><c:out value="$tempCustomer.lastName" /></td>
          <td><c:out value="$tempCustomer.email" /></td>





          share|improve this answer























          • I tried this way... but same issue.

            – Razan
            Mar 8 at 8:49













          0












          0








          0







          You're probably using an old version of jstl where expressions must be called witch <c:out/> tag.



          Try the following in your jsp



          <td><c:out value="$tempCustomer.firstName" /></td>
          <td><c:out value="$tempCustomer.lastName" /></td>
          <td><c:out value="$tempCustomer.email" /></td>





          share|improve this answer













          You're probably using an old version of jstl where expressions must be called witch <c:out/> tag.



          Try the following in your jsp



          <td><c:out value="$tempCustomer.firstName" /></td>
          <td><c:out value="$tempCustomer.lastName" /></td>
          <td><c:out value="$tempCustomer.email" /></td>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 7:42









          noiaverbalenoiaverbale

          826718




          826718












          • I tried this way... but same issue.

            – Razan
            Mar 8 at 8:49

















          • I tried this way... but same issue.

            – Razan
            Mar 8 at 8:49
















          I tried this way... but same issue.

          – Razan
          Mar 8 at 8:49





          I tried this way... but same issue.

          – Razan
          Mar 8 at 8:49



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058394%2funable-to-display-data-on-broswer-using-spring-hibernate-below-is-my-code-and-ou%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved