注:最终版本带回来的“添加控制器”上下文菜单。
Note: the final release brought back the "Add Controller" context menu.
注意:VS 2013预览和RC中不包括“添加控制器”上下文菜单。
Note: VS 2013 Preview and RC did not include the "Add Controller" context menu.
演示如何创建基本MVC应用程序、添加控制器、添加视图以及添加单元测试。
Demonstrates how to create a basic MVC application, add controllers, add views, and add unit tests.
这会调出“添加控制器”对话框,允许你给要创建的控制器取名,以及表示你是否想自动地生成(scaffold)常见的CRUD方法
This will cause an “Add Controller” dialog to appear that allows you to name the Controller to create, as well as optionally indicate whether you wish to automatically “scaffold” common CRUD methods
要做到这点,你需要为每个界面都添加一个视图和视图控制器。
To accomplish this, you add a View and a View Controller for each screen you want to have.
在较小的机器上,添加磁盘和控制器可能是一个难题,还可能需要购置一个扩展单元。
On smaller machines, adding disks and controllers may be a challenge and may also require the purchase of an expansion unit.
在添加新控制器类或方法之后,它们就自动变为可用的了。
Once you add a new controller class or method, it becomes automatically available.
同样地,您在控制器中为应用程序添加的目的地和其他控制代码;您不在您的模型中放入这些数据。
Likewise, the controller is where you add destinations and other controlling code for your application; you don't put any of that stuff in your model.
这是应用程序的主入口点,也是添加新控制器方法的地方。
This is the main entry point for your application and the place to add new controller methods.
现在,您可以向控制器中添加更多的代码。
进行了这些更改后,需要添加计算机帐户(以便域控制器知道并信任工作站)和用户帐户。
After you've made these changes, you need to add machine accounts (so the workstations are known to the domain controller, and trusted) and user accounts.
现在,您可以使用更多Rails特性来添加更多模型、控制器和视图。
From here, you can use more Rails features to add more models, controllers, and views.
接下来,向Student控制器添加一个函数,称为edit,这也是edit选项所指向的位置。
Next, add a function to the Student controller called edit , which is where the edit option is pointing.
接下来,向Student控制器添加一个delete函数,这是delete选项所指向的位置。
Next, add a delete function to the Student controller, which is where the delete option is pointing.
然后,需要向Student控制器(清单6)添加一个函数,以便能够看到这个HTML表单。
Then you need to add a function to the Student controller (Listing 6) to be able see the HTML form.
通过向控制器类中添加scaffolding来测试Web服务。
Test the Web service by adding scaffolding to the controller class.
为使这些控制器能工作,您需要向portletweb . xml文件注册它们,方法是添加下列配置标志。
In order for these controllers to work, you need to register them with the portlet web.xml file by adding the following configuration markup.
Streamlined通过添加新运作,使得可以容易地修改现有控制器。
Streamlined makes it easy to modify the existing controllers by adding new actions.
与第 2部分中讨论的ACL组件不同,只在控制器的顶部添加一行代码即可包含Sanitize 组件。
Unlike the ACL component discussed in Part 2, the Sanitize component is included by adding a line to the top of your controller.
接下来,为了接收这个表单发布,向Student控制器添加函数update();代码如清单19 所示。
Next, to receive the form post, add the function update() to the Student controller; the code is shown in Listing 19.
第一次使用控制器命令还会添加额外的依赖项到您的项目中,比如springMVC和Tiles。
The first use of the controller command will also add additional dependencies, such as Spring MVC and Tiles to your project.
点击“添加”按钮会生成一个控制器类,并将它加到项目中去。
Clicking the "add" button will cause the controller class to be created and added to the project.
例如,要支持产品编辑,我们可以象下面这样在Products控制器上实现“Edit”action方法的HTTP - GET版本,然后调用“添加视图”命令。
For example, to enable product editing support we can implement the HTTP-GET version of our "edit" action method on our Products controller like below and then invoke the "Add View" command.
下一个任务是回到XCodeIDE,向视图控制器类定义添加一些成员变量、属性和方法,如清单5所示。
The next task is to go back to the XCode IDE and add some member variables, properties, and methods to the view controller class definition as in Listing 5.
第二个JSP(清单7)将通过提供一个输入框向存储器添加一条新的消息,并通过PortletAction方法将输入的值提交回控制器以进行处理。
The second JSP (Listing 7) handles adding a new message to the store by providing an input box, and Posting the value back to the controller through a PortletAction for processing.
您了解了如何通过调整控制器代码创建更为友好的URI、向UrlMappings . groovy添加映射以及创建一个定制codec。
You saw how to create friendly URIs by adjusting controller code, add mappings to UrlMappings.groovy, and create a custom codec.
你现在可以在一个控制器的action方法中键入Ctrl - M, Ctrl - V,或者在一个action方法中右击,选择“添加视图”上下文菜单项来生成新的视图模板。
You can now type Ctrl-M, Ctrl-V within a Controller action method, or right-click within an action method and choose the "Add view" context menu item to create new view templates.
我们添加了adsFor方法,因为这是从注册和登录控制器转发的内容。
You added the adsFor method, as this is what we have been forwarding to from the register and login controllers.
一个对话框确定添加文件到ClearCase控制器下。
Soctt介绍了活动过滤器(action filters),它们都以特性(attributes)的形式为控制器活动添加预处理和后处理逻辑。
Scott introduces action filters, which are attributes that add pre and post processing logic to controller actions.
应用推荐