Top "Controller" questions

A controller is responsible for executing a sequence of instructions in response to some stimulus (maybe a command, action, or event).

Mockito Exception - when() requires an argument which has to be a method call on a mock

I have a very simple test case that is using Mockito and Spring Test framework. When I do when(pcUserService.…

java controller mockito spring-test
Which is better, return "ModelAndView" or "String" on spring3 controller

The way of return ModelAndView @RequestMapping(value = "/list", method = RequestMethod.GET) public ModelAndView list( @UserAuth UserAuth user, ModelAndView mav) { if (!…

spring-mvc controller
Spring MVC - Multiple submit button to a Form

I am trying to have 2 submit buttons post to a form, with each button action mapped to different controllers. Here …

java spring controller
How to access plain json body in Spring rest controller?

Having the following code: @RequestMapping(value = "/greeting", method = POST, consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE) @ResponseBody public String …

spring rest spring-mvc controller
Angular JS resizable div directive

My site will have multiple sections, each of which I intend to be resizable. To accomplish this I've made a "…

angularjs controller resize scope directive
How to get list of all routes of a controller in Symfony2?

I have a controller which implements all routes/URL(s). I had the idea to offer a generic index over …

symfony indexing controller routes symfony-2.1
Spring forward with added parameters?

Is there a way to forward a request to another Controller while adding some parameter data to it? I tried …

java spring controller forward
how to pass parameter with @url.action to controller

i have following code snippet i want to pass data-id="0" with my @url.action , how can i do this <…

url razor controller html-helper
Why does the property I want to mock need to be virtual?

I'm doing some unit testing, and mocking some properties using Moq. Now, this is a Controller test (ASP.NET MVC 3). …

c# asp.net-mvc unit-testing controller moq
How should one unit test a .NET MVC controller?

I'm looking for advice regarding effective unit testing of .NET mvc controllers. Where I work, many such tests use moq …

c# asp.net-mvc-3 unit-testing controller