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.

16598 questions
3
votes
1 answer

Call custom controller in custom module for Magento

I have created a custom module in magento 1.9.2 named " question & answer " I have the phtml file placed in directory magento/app/design/frontend/rwd/template/question.phtml now, the form action should validate the form and I have the controller…
Jijo Nair
  • 828
  • 2
  • 11
  • 30
3
votes
3 answers

MVC with multiple controllers

I'm going crazy with the making of an application in Java/JavaFX. I have a project with more fxml files, each with a controller (exactly like this example JavaFX TabPane - One controller for each tab ) This is the main fxml file (screentab.fxml),…
silvia-ma
  • 33
  • 1
  • 4
3
votes
1 answer

Magento controller url redirects to dashboard

Basically in trying to create an inbox message which "read details" should redirect the user to a custom controller, however i can see the desired url in the browser for a second and then it redirects to the dashboard; this is how, currently, im…
VdeVentura
  • 2,041
  • 2
  • 15
  • 16
3
votes
1 answer

Unit-testing an Angular Controller's initialization function

I am faced with what is I believe a very straightforward scenario, but I cannot find a clear answer: I have a controller which does a number of things when created, including somewhat complicated stuff, and so I have created an initialization…
3
votes
6 answers

In game development, is the controller in MVC purely for dealing with user input?

I've read conflicting things on this. From Wikipedia: Controller Processes and responds to events, typically user actions, and may invoke changes on the model. It's the word TYPICALLY that is confusing. If not just user input, then what…
Iain
  • 9,432
  • 11
  • 47
  • 64
3
votes
1 answer

no function clause matching in Plug.Conn.send_file/5

I am trying to create a new route that will allow users to download the files they have uploaded. I created this route under the "/" scope. get "/media/:filepath", MediaFilesController, :download For now, I'm just trying to send images that are…
Paco
  • 4,520
  • 3
  • 29
  • 53
3
votes
4 answers

AngularJS $scope not watching changes from View

I have this small sample in which I hoped to see log messages in browser console indicating $scope watcher is working well, but it's unfortunately not the case.
G. Ghez
  • 3,429
  • 2
  • 21
  • 18
3
votes
2 answers

2 basic computer questions

Question 1: Where exactly does the internal register and internal cache exist? I understand that when a program is loaded into main memory it contains a text section, a stack, a heap and so on. However is the register located in a fixed area of…
user427390
3
votes
1 answer

Issue in fetching data from db to the views in laravel 5.2

Im new to laravel and studying it by creating some test projects myself in laravel 5.2. But i got stuck now with some issue in fetching data correctly from db in laravel 5.2 and display the result. I have a menu table in my db with fields -> id,…
Mahesh A R
  • 179
  • 4
  • 15
3
votes
1 answer

laravel 5.2 - passing route parameter to controller

I have the following route in a Laravel application: Route::get('/post/view/{id}', 'PostController@getView'); However I am unsure how to use the id passed as a parameter in the Controller method PostController@getView. Is there a simple way to pass…
datavoredan
  • 3,536
  • 9
  • 32
  • 48
3
votes
2 answers

Spring MVC ModelAttribute as Interface

Using a Spring MVC @Controller, how do I have a @RequestMapping endpoint have a @ModelAttribute declared as an interface? I want to have three different forms being posted to the mapping that the underlying classes are all of an interface type. So…
FiguringThisOut
  • 810
  • 2
  • 9
  • 18
3
votes
0 answers

Register controller and action manual at runtime

Is it possible in ASP.NET MVC to register an action in a controller manual? For example i have an instance of a controller and want to register it with an action at runtime? I need this, because in a special case it is not possible for me, to let…
BendEg
  • 20,098
  • 17
  • 57
  • 131
3
votes
2 answers

Dynamically create methods in Controller (RAILS)

I am trying to dynamically create methods for semi static pages. However, the code below does not seem to work. I get a wrong number of arguments (0 for 1) error. class PagesController < ApplicationController pages = %w[ page1 page2 page3 ] …
user2012677
  • 5,465
  • 6
  • 51
  • 113
3
votes
1 answer

delete request ajax jquery don't function

I'm trying to do a DELETE request with Ajax, but it doesn't function,I receive an internal error, but i can't see the problem, can you help me? this is the partial code of javascript: $.ajax({ url: 'http://localhost:8080/actors/remover', …
Federico Peppi
  • 57
  • 1
  • 1
  • 9
3
votes
1 answer

How to write in a text file in MVC

How can I convert the below code to a controller in MVC. I want to write inside the text file in MVC. I have tried to use this way that is shown below. So now I just want to convert this code to a controller. How can I do that? My current code look…
Dlamini.M
  • 109
  • 1
  • 10
1 2 3
99
100