No default constructor found; nested exception is java.lang.NoSuchMethodException with Spring MVC?

Spring cannot instantiate your TestController because its only constructor requires a parameter. You can add a no-arg constructor or you add @Autowired annotation to the constructor: @Autowired public TestController(KeeperClient testClient) { TestController.testClient = testClient; } In this case, you are explicitly telling Spring to search the application context for a KeeperClient bean and inject it … Read more

What to use? MVC, MVP or MVVM or…?

Actually, the ultimate post you’re looking for is this answer this answer from Karsten Lentzsch (of JGoodies fame) in the Swing Frameworks and Best Practices Swing Frameworks and Best Practices thread. Hello, I’ve been writing Swing apps for several years that many people find elegant. And I teach developers in working with Swing efficiently: how … Read more

Yes or no: Should models in MVC contain application logic?

Generally I try to keep controllers simple in terms of logic too. If business logic is required, it will go up to ‘service layer’ classes to handle it. This also saves repeating any code/logic too, which ultimately makes the whole project more maintainable if business logic was to change. I just keep models purely as … Read more

How to structure an enterprise MVC app, and where does Business Logic go?

In my apps, I usually create a “Core” project separate from the web project. Core project contains: Business objects, such as entities and such Data access Anything that is not specifically designed for web Web project contains: Controllers, which route requests from the UI to the core logic Views, which focus on presenting data in … Read more