0

can anyone help me with the following thread? http://forum.springsource.org/showthread.php?110248-dao.save%28object%29-java.lang.NullPointerException&p=365538#post365538

Many thannks

2 Answers 2

2

Spring didn't inject PatientDaoImp into your controller. Try this:

public class PatientController {

  @Autowired
  private PatientDaoImp dao;

Also make sure the following declaration is in your *-servlet.xml context file (not the main context file):

<context:component-scan base-package="com.pems.web"/>
Sign up to request clarification or add additional context in comments.

1 Comment

Glad I could help. For the sake of both mine and yours reputation you should accept the most correct answer to each of your questions.
1

In addition please add:

<context:annotation-config/> 

to you *-servlet.xml file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.