controller

HTTP 404 my Spring Controller is not handle on my specific URL

Hi all, I create a Controller bean to map a dedicated URI. My web.xml file : <!-- Spring MVC Servlet (that will route HTTP requests to BlazeDS) --> <servlet> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>cont...

Bind a list with nested list

Hi, i've got this code Model public class PdfPage { public IEnumerable<PdfPhoto> Photos { get; set; } } public class PdfPhoto { public string path { get; set; } } View <ul> <li> <%= Html.Hidden("ListPages[0].Photos[0].path", "/public/pdfMaker/4_e.jpg")%> <%= Html.Hidden("ListPages[0].Photos[1].path", "/public/pdfMaker...

rails multiple form actions with ajax...

I have a basic Rails form like so: <%= form_for @person do |f| %> <%= f.label :first_name %>: <%= f.text_field :first_name %><br /> <%= f.label :last_name %>: <%= f.text_field :last_name %><br /> <%= f.submit %> <% end %> How could I optionally send the form information to another an entirely different controll...

iPhone MVC. Problems with the model.

I'm new to programming, iphone application programming in specific. After reading a bunch about MVC I decided to give it a try in a small application. As to my understanding, MVC works like this: Model: data, manipulating data, retrieving data. ViewController: formats data from the model (NSDate to specific style), etc. View: the actu...

Grails Controller Testing - Problems with dynamic methods

Hi, I'm running some old (but valid, i'm told) tests on a legacy application, and notice that many of them arent working. The error message usually is 'No method signature for some dymamic method' After using mockDomain I managed to solve that problem. However, I can't figure out how to test controllers that create objects inside. Fo...

Kohana 3 Controller Constructs

Trying to use __construct inside a controller to assign some variable but it keeps throwing errors. Hoping that someone can lead me in the right direction. class Controller_Mobile extends Controller { public function __construct() { parent::__construct(); $iphoneDetect = strpos($_SERVER['HTTP_USER_AGENT']...

Show latest posts all from unique tags (Rails 3.0, Acts_As_Taggable_On)

tags_controller.rb: def index @title = "tags" @posts = Post.tag_counts.collect do |tag| Post.tagged_with(tag).first(:order => "updated_at DESC") end @posts.uniq! end tags/index.html.rb: <%= render 'latest' %> _latest.html.erb: <%- for post in @posts -%> <%- post.tags.each do |t| -%> <%= link_to t.name, tag_path(t...

codeigniter check for user session in every controller

Hey guys, I have this private session in one of my controllers that checks if a user is logged in: function _is_logged_in() { $user = $this->session->userdata('user_data'); if (!isset($user)) { return false; } else { return true; } } Problem is that I have more than one Controller. How can I use this function in those other...

In grails, how do I get a reference to all current sessions?

I'd like to list all current sessions in an Admin Controller in grails. What's the easiest way to get a reference to e.g. a Collection of sessions from the controller? ...

How to let actions support more parameters?

I'm using pylons, and my action of controller is: class UserController(BaseController): def create(self): name = request.POST['name'] email = request.POST['email'] password = request.POST['password'] ... But I found in turbogears, I can do like this: class UserController: de...

Grails controllers and domains

I just had a quick question as I'm still learning grails. I have a controller class that just reads a text file and loads a list with information. I'm wanting to populate one of my domains through this list. Am I able to do it like this? For instance, I have a bookController, the controller does something like //psuedocode import book...

Specifying a different model than the controller name suggests

Guys, I've got a controller called "ResourcesController", but its really managing the CRUD for two different models. I don't actually have a model called Resource, so the controller is balking that it can't find it. Is there a way I can inform the controller which model I'll be working with so it doesn't freak out? The error that is ...

In Yii controller....

Hi php guru :) I'm newbie and learning Yii framework where Im designing first small application and got stuck on this position where I need your attention as your guys are guru. I have a 'City name' list on main layout in header section where a user select a 'City' then I would like to pass that City_id to 'PostController' and search f...

Simple one model singular resource routing problem.

I have a stripped down shopping cart application, currently with one model "cart", the cart id is stored in a session. the cart controller has this method so we always have a cart def initialize_cart if session[:cart_id] @cart = Cart.find(session[:cart_id]) else @cart = Cart.create session[:cart_id] = @cart....

How to know the 'controller' and 'action' from the request url in Pylons?

I want to log the controller and action when a request comes, so I write a __before__ in the base controller: class BaseController: __before__(self): controller = get_controller(request) action = get_action(request) logger.log('%s - %s'%(controller, action)) But I don't know how to get the controlle...

ASP.NET MVC Controller Factory life cycle

The DefaultControllerFactory contains three different methods: GetControllerInstance CreateController GetControllerType When is each method executed in the request lifetime? I've seen custom controller factories where one of these methods is overridden and implemented but I can't seem to find details on the execution path of each one...

Is there an AJAX function that can just GET a rails partial ?

My controller is shared by links from a search result page that needs a layout, and from the profile page itself that does not need a layout. What I would like to accomplish is a single controller method show that is both capable of drawing the partial by AJAX from the profile page, and draw the partial and layout from the search results...

Limit access by Controller or by Model?

I'm just starting to sketch up the base of a web-based system, and I would like the admin to have the possibility to limit access either by Controller or by Model. My problem is, I can't decide which one (or both?) of them I should go with. Any ideas? Pros/Cons? First I was leaning towards doing it in the Controllers, seeing as they "co...

HttpContext.Current.User is null in ControllerBase(asp.net mvc)

I have a ControllerBase class in an ASP.NET MVC Application. The other controllers inherit from ControllerBase. I want to access HttpContext.User.Identity.Name, but HttpContext is null. What's the matter? public ControllerBase() { var dataManager=new DataManager(); if (HttpContext.User.Identity.IsAuthent...

Rails 2 to Rails 3, method verification in controllers gone?

Coming from rails 2, most of my controllers would have these lines: verify :method => :post, :only => :create, :render => {:text => '405 HTTP POST required', :status => 405}, :add_headers => {'Allow' => 'POST'} verify :method => :put, :only => :update, :render => {:text => '405 HTTP PUT required', :status => 405}, :add_headers => {'Allo...