Questions tagged [controller]

A controller is responsible for executing a sequence of instructions in response to some stimulus (maybe a command, action, or event). This is often used in conjunction with the Spring or model-view-controller tags.

A controller is responsible for executing a sequence of instructions in response to some stimulus (maybe a command, action, or event). It may be used to refer to the controller portion of the MVC (Model-View-Controller) pattern, or a general handler for actions and events that orchestrates a response. It may also refer to the Spring annotation @Controller.

As it can refer to a number of different things, this tag is best used in conjunction with other tags. So, if you're referring to the Spring @Controller annotation, use the Spring tag in conjunction with this one. If you're referring to the general MVC controller, use the model-view-controller tag.

15429 questions
3
votes
2 answers

Ruby on rails - How to make controller execute 2 actions simultaneously with ajax?

I am calling two different actions for the same controller with ajax in development environment. In one action I am updating a database in a very slow process. On the other action I want to get the percentual concluded to update a progressbar. …
capivarao
  • 70
  • 6
3
votes
0 answers

XDebug doesn't stop on breakpoints set on Yii controllers' actions

I code in Yii framewor, using Netbeans 8.0.1 and also Eclipse. My local developement environment is build on XAMPP. I can see, that breakpoints set anywhere within Wordpress code works just fine. But, when I try to set a breakpoint on any Yii's…
alex
  • 5,897
  • 7
  • 38
  • 66
3
votes
4 answers

Codeigniter: How to handle direct link to controller/function/param?

I have a simple controller function which deletes a DB entry (it uses a model function to do so). I have a link to this in one of my views (e.g. http://www.example.com/item/delete/3) and I’m using jQuery to display a confirm dialog to make sure the…
rebjr
  • 65
  • 2
  • 4
3
votes
1 answer

Multiple action for one servlet from different JSP

I am new to JSP/Servlet. I want to use one servlet for handling different request sent from different JSP form/button. For example student.jsp =>
Student ID:
user3731454
3
votes
1 answer

How to render json for all actions from the after_action filter in ApplicationController?

Is it possible to create an after_filter method in the Rails ApplicationController that runs on every action and renders to JSON? I'm scaffolding out an API, and I'd like to render output to JSON for every action in the…
Feckmore
  • 3,472
  • 5
  • 39
  • 47
3
votes
1 answer

Best way to pass data between ngRoute controllers (from one view to the next)

I'm wondering what's the best (per Angular way) of passing data between views that display on particular route and I would like to avoid passing data via URL as there can be a lot of it or would require some sort of conversion to strings etc. All in…
Robert Koritnik
  • 97,460
  • 50
  • 267
  • 388
3
votes
3 answers

AngularJS: Factory is always undefined when injected in controller

I am trying a simple example of an AddressBook Angular application. I have a factory that returns an array of records and it it gets displayed in a list view using a List controller angular.module('abModule', ['ngRoute']) .factory('AddressBook',…
3
votes
1 answer

Can't get a RoR project to work in production env

I have a problem with the setup of a new rails project. It works fine in development mode but crash in production. Here is what I mean. I have just one controller with a single method which are generated with rails rails g controller Products…
MZON
  • 295
  • 1
  • 3
  • 9
3
votes
1 answer

How Rails Controllers Should be Created? Should it be a verb, noun or an adjective?

I need some advice, what is the rule of the thumb when creating Rails controllers names? Should controller be all be verbs or a combination of nouns and verbs (or adjectives)? This is the example provided on creating controllers in…
Winston
  • 225
  • 1
  • 2
  • 7
3
votes
2 answers

Architecting ASP.net MVC App to use repositories and services

I recently started reading about ASP.net MVC and after getting excited about the concept, i started to migrate all my webform project to MVC but i am having a hard time keeping my controller skinny even after following all the good advices out there…
3
votes
2 answers

asp.net mvc post variable to controller

I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP codeigniter we can catch the post variable easily with $this->input->post("theinput"); I know that in ASP.Net MVC we can create an action method that will accepts…
strike_noir
  • 3,868
  • 11
  • 50
  • 92
3
votes
1 answer

ASP.NET MVC 5 publishing only controller doesn't update on host

There's probably a very logic answer to this question. If I update a controller and publish it to my webhost, the updated part doesn't seem to work, it looks like it didn't update the controller. However, when I publish my whole project everything…
Jenthe
  • 777
  • 2
  • 9
  • 26
3
votes
1 answer

Unit testing Grails controller chaining

I am unable to figure out how to test for a controller action that does 'chain'. I would like to verify the action. Grails: 2.4.2 Controller: class MyController { def index() { } def doesChain() { chain action: 'index', model: [name: "my…
raaputin
  • 105
  • 4
3
votes
4 answers

AngularJS DRY controller structure

The code below represents a situation where the same code pattern repeats in every controller which handles data from the server. After a long research and irc talk at #angularjs I still cannot figure how to abstract that code, inline comments…
enapupe
  • 10,639
  • 3
  • 24
  • 41
3
votes
0 answers

c# Controller won't accept utf-8 characters

I have a web API controller POST method that accepts incoming JSON. The posted JSON is UTF-8 encoded and sometimes contains extended ascii characters such as ¾ . Whenever these are included the parameter returns null. A simple example: public…
1 2 3
99
100