• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JSP page with Bean throws : NullPointerException

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I use a jsp page with beans and receiving a NullPointerException when I call the page. It behaves like my bean ("localityJDBCTemplate") is not initialized. I thought it was done here :


Relevant lines from my code are below.

Example.jsp :

Beans.xml :



 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think Spring beans are stored in HttpSession as attributes. Still you can try by adding session scope to your Spring bean, something like this:


I don't think this will work either but you can give it a try. Also I don't understand why you want to create a JdbcTemplate as a session bean. To make this work you might have to write a SessionListener and set the Spring beans as HttpSession attributes in that listener class...
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic