mvc

Recommendations for a Java 1.4 MVC framework for Jrun?

I am revisiting a project and need to limit it to Java 1.4 (unfortunately). I was interested in introducing a MVC framework to improve ease of maintenance in the future. Besides Struts 1, what options do I have? The lightweight the framework, the better. Not to dismiss Struts off hand, I've just heard a lot of bad things about it. If a...

Auto- Property Initialization or Service-Oriented assignments?

If my objects are for the most part simply holding data that will be sent to the View, does it make sense to implement a separate Service class to initialize object, retirve data and make assignments? Instead, shouldnt the object 'know' what it has to do when it is instantiated, and thus make appropriate calls to repository as needed? ...

C# MVC: View with optional ViewModel (data not always present / necessary)

Hello, I'm kind of stuck on an MVC problem. I have a registration view, reached by www.example.com/register, something like this: <form id="registrationform" method="post"> <fieldset> <label for="emailaddress">Email</label> <input id="emailaddress" name="emailaddress" type="text" /> //more inputs etc. </fieldset> </form>...

Thoughts on my MVC approach (data + domain + business logic). Newb

I'm writing a medical billing application and am using MVC (Spring) for the first time so I'm struggling to get an approach that feels right. Thoughts/comments would be appreciated. My "domain" classes Doctor Patient Claim BusinessLogic My controller classes ListPatients EditPatients FindPatients SubmitClaim My repository c...

ASP.NET MVC MembershipService Email

I have been working on an MVC project and I everything works at the moment except I can't force the user to confirm the email address before I active the user's account. I am using the built-in MembershipService/MembershipProvider that came with MVC. I was thinking of sending a normal email using an SmtpClient and MailMessage and then m...

MVC naming conventions for JSON actions

What naming convention is recommended when writing an MVC app that has both front-end and JSON paths to the required data? For example, let's say the user of your site has "Things". They should be able to go to a page to view their things, but we also need a way to pull those things back as JSON on other pages. I've been able to think...

How would you structure Zend_Auth & Zend_Acl in Zend Framework to obey having a Thin Controller?

There has been a fair bit of talk/debate lately in the Zend Framework community about thin controllers. Apparently there is a tendency of ZF users to view the Model as nothing more than the gateway to the database. The argument is that Models should be "fat" and do more of the work and Controllers shouldn't be chaining methods and doin...

Elmah basic setup questions/issues ...

I'm not finding this to be easy to setup; either there is a missing step in the setup configuration, it isn't work correctly, or I don't actually understand it's purpose. There is something definitely wrong here. The problem must obviously be me. I'm just not getting this to work. Here's what I've done. Create a brand new mvc applicat...

Should mock objects dispatch events?

I'm using this kind of wiring for my MVC and I want to test the controller. So far, I've found two ways : either my mock view dispatch events or my controller expose public methods. Dispatching events seems the way to go (as pointed out in an answer), but if my view is a simple mock object, how do I dispatch those events? ...

What is the MVC version of this code?

i'm trying to wrap my head around how to enterprise up my code: taking a simple routine and splitting it up into 5 or 6 methods in 3 or 4 classes. i quickly came up three simple examples of code how i currently write it. Could someone please convert these into an MVC/MVP obfuscated version? Example 1: The last name is mandatory. Col...

Best practices for handling user preferences in an iPhone MVC app?

I'm developing my first iPhone app, and while implementing user preferences, I have a few questions on how to best implement this. Assume the basic MVC pattern: MainView displaying data stored in a Model object; MainViewController handling the app logic. For the options, I have an OptionsView and an OptionsViewController. A RootView...

Does anyone know of a good guide to get Ninject 2 working in ASP.NET MVC?

I'm struggling with the documentation to figure out exactly what I need to. The documentation (to my understanding) is for 1.5 anyway. N.B: I don't want to extend NinjectHttpApplication I've configured it to use the NinejctControllerFactory in Application_Start() but I get a null reference exception on the KernelContainer.Kernel when i...

How to do iPhone's SMS app SPECIAL viewController shifting?

If anyone has used the iPhone's SMS app, there is a special animation with the compose view. When you first press compose, a modal view controlelr is shown. However as soon as you press send, it shifts to your chat view controler. But here are a few weird behavior: 1) The keybaord stays intact. Usually when you pop and push new contro...

Model View Controller

Hello, I've implemented a Model-View-Controller pattern in my application. It's not a web application but MVC is suitable for it. all updates to the Model are now routed through controller. Even the updates from the view is also send to controller and it will be routed to model. (I've state classes in between model and controller for ...

Refactoring a Zend_View_Helper_Action widget, utilizing Zend_Controller_Action_Helper_FlashMessenger, into a model

I've tried to create a login widget that can be included at will in any action that is outside the content of the application that requires login. My thought here was that I wanted a DRY-approach for rendering the login box with any error messages from a previous login attempt. To enable this I utilized the FlashMessenger for saving the ...

Examples of Java MVC Model 2 architecture?

Can anyone post or point me in the direction of a clear example of a from scratch implementation of Model 2 architecture? Below is a detailed description of Model 2, taken from this page. The Model 2 architecture for designing JSP pages is in reality, Model View Controller (MVC) applied to web applications. Hence the two terms can b...

ASP.NET MVC Custom Authorization

I have a question about custom authorization in MVC. I have a site that I want to limit access to certain pages, depending on their group membership. Now I have seen tons of examples on how to do this if there is a single admin group and a single user group, for example, but not any examples for a third level. For example, only user...

General MVC Questions - naming, structure (PHP)

Hello, I have tried many PHP MVC frameworks and I noticed that in many frameworks you can do things like this: $this->security->encodeForHTML(); So, basically there is a class Security, which contains a method encodeForHTML(). Isn't this Security class a singleton? Is there a specific name for this kind of "internal" singleton class?...

What are the recommended datagrids for asp.net mvc?

I have looked at a few data grids for an asp.net mvc app I am developing. I would like to get some opinions on the different datagrids for asp.net mvc. I would like to know the pros/cons with the data grid, if you care to share. ...

How can I call a JavaScript function defined in a PartialView after an AJAX request completes?

Here is my partial view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <script type="text/javascript"> function myFunction() { .... } </script> ....other html content ... On my page, I have a link that calls a controller action to render the partial view: <%= Ajax.ActionLink(..., new AjaxOptions { ..., On...