- 浏览: 3472927 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
wanglf1207:
EJB的确是个不错的产品,只是因为用起来有点门槛,招来太多人吐 ...
weblogic-ejb-jar.xml的元素解析 -
qwfys200:
总结的不错。
Spring Web Flow 2.0 入门 -
u011577913:
u011577913 写道也能给我发一份翻译文档? 邮件437 ...
Hazelcast 参考文档-4 -
u011577913:
也能给我发一份翻译文档?
Hazelcast 参考文档-4 -
songzj001:
DbUnit入门实战
欢迎使用Induction!Induction是使用java编程语言进行web应用开发的
健壮高性能的框架。Induction属于基于请求的web框架,作为一个servlet部署在servlet容器中。Induction宣扬MVC的方
法进行web应用开发。Induction的几个关键设计目标是:
1.当modles,views和controllers发生变化时,消除对web应用程序必须重载的需求(我们相信一次简单的页面刷新就足够了)
2.modles,views,controllers之间的绑定是声明式的,这种方式可以在任何IDE中都能被解析
3.使得数据跟踪在用户界面模板中可用(尤其是HTML模板)
4.文件上传处理应该简单到很平凡的地步
5.在HTML表格中,数组(arrays)和字典类型(dictionary types )的使用应该尽可能简单
6.明智的使用XML(在每个应用程序中,Induction只需要一个XML文件)
7.是一种能够适应多种pattern应用的可扩充的架构
8.高性能
9.从JDK1.4到1.6都兼容(包括1.4和1.6)
About this tutorial
这份指南的目的是让你更快的使用Induction。Induction需要一个servlet容器。在这份指南中,我们使用Apache的Tomcat,不过你可以选择使用任何服从标准的servlet容器。
Installing
我们假设你已经在c:/dev/Tomcat6安装了Tomcat6。Induction本身不需要任何的安装步骤,它的jar包可以很容易地引入到你的web应用程序中。
Writing our first application - hello world
在这份指南中,我们会写一个简单的"hello world"应用,在这个应用里我们会列举出Induction的许多重要概念。
Writing a controller
首先我们写一个controller作为我们指南的开始,因为controllers是web应用程序中一个典型的entry。好,现在让我们开始写一个controller,让它在浏览器中打印一串字符。
import com.acciente.induction.controller.Controller;
import com.acciente.induction.controller.Response;
import java.io.IOException;
/** */ /**
* A very simple controller that does the customary "Hello World"
*/
public class HelloWorldController implements Controller
{
public void handler( Response oReponse ) throws IOException
{
oReponse.setContentType( " text/plain " );
oReponse.out().println( " Hello World, using a simple println() " );
}
}
在我们运行这个controller之前,先仔细的看一下。首先我们注意到HelloWorldController类实现了Induction的 Controller,Controller接口只是一个简单的标记接口,没有定义任何方法给它的实现类。当Induction接收到一个request 请求后,激活一个Controller实现,比如HelloWorldController类,Induction首先核实这个类是否是实现 Controller接口。因此目前Controller接口的存在的唯一理由是安全(主要考虑到Controller接口的可配置性)。因为 Controller只是一个标记性接口,所以handler方法并不是接口定义的。
接下来,我们可以看到handler方法有一个Response参数,Response类是继承 javax.servlet.http.HttpServletResponse接口,并简单的对servlet容器的response对象进行了封装。 Induction通过注入的方式,将参数Response值传给handler方法。一些能够作为handler参数的值,也是通过自动注入的方式,只 要它们是遵循以下类型:
Type | Description |
Request | facade to the servlet request, extends javax.servlet.http.HttpServletRequest |
Response | facade to the servlet response, extends javax.servlet.http.HttpServletResponse |
Form | provides access to the HTML form (if any) submitted with this request |
ControllerResolver.Resolution | provides access to the controller resolution object (very useful for writing generic parameterized controllers) |
model_class_name | instance of a user provided model class, the instance is managed to conform to a user specified lifecycle |
上面的类名是不完整的,Request, Response和Form类的更多信息,在package com.acciente.induction.controller中查看。
原文地址:http://www.inductionframework.org/getting-started-tutorial.html
先翻译一部分放上来,后面的会尽快贴出。
翻译的不通畅的地方,请见谅~
发表评论
-
说明SOA监管(SOA Governance)实例(收录备查)
2012-12-19 11:35 1716SOA 已经不是单纯技术问 ... -
Injecting Spring Beans into Java Servlets
2012-11-01 10:21 1909If you are working in a Java ... -
用 HttpServletResponseWrapper 实现 Etag 过滤器
2012-07-09 16:58 3709原文出处:http://blog.chenlb.com/200 ... -
Eclipse Indigo - Cannot install Android ADT Plugin
2012-02-29 01:17 3838When I try to install the And ... -
Eclipse Indigo - Cannot install Android ADT Plugin
2012-02-29 01:13 1940When I try to install the And ... -
[转]mybatis下的分页,支持所有的数据库
2011-07-21 13:21 14788大 家都知道,mybatis的自带分页方法只是逻 ... -
Java framework for text- & console-based forms?
2011-07-21 01:06 1673charva jcurses JNA , ... -
JNA(Java Native Access)学习入门
2011-07-21 01:04 22525Java Native Access 项目 在 ... -
使用IntrospectorCleanupListener 解决quartz引起的内存泄漏
2011-04-20 11:59 13290"在服务器运行过程中,Spring不停的运行的计划任 ... -
DBCP代码研读以及就数据库连接失效的解决
2011-03-31 11:03 3728问题 网上很多评论说DBCP有很多BUG,但是都没有指明是什 ... -
ContextLoaderListener
2010-12-06 15:58 8426(1) org.springframework.web.c ... -
Servlet3.0新功能: 异步处理
2010-12-06 15:22 3128J2EE 6和Glassfish 3V正式发 ... -
Servlet3.0引入的新特性
2010-12-06 15:20 3028Servlet3.0规范的新特性主要是为了3个目的: ... -
100個節點上運行群集亞馬遜EC2上Hazelcast
2010-12-03 23:59 3294本文的目的,適是给妳湮示的細節集群的100個節點。此湮示記錄, ... -
Spring Properties Reloaded
2010-12-02 14:54 4343Spring Properties Reloaded Som ... -
为spring2.5中的jpetstore增加perf4j监控
2010-09-02 13:51 2610perf4j是一款类似于log4j的性能检测工具. 它 ... -
语义网的学习资源大汇集(备忘)
2010-06-23 22:48 1692网上资源 http:/ ... -
使用 JOLAP 实现复杂分析查询
2010-06-06 13:42 1925Shashank Tiwari 在本文中对 ... -
HTML5 Canvas for Internet Explorer
2010-06-04 21:16 1830Canvascape http://www.benjoff ... -
大型网站架构演变和知识体系
2010-06-01 23:47 1913架构演变第一步:物 ...
相关推荐
Wind turbine with induction generation and with fixed pitch angle
induction-motor matlab file
it is the example for speed control of Induction motor with multilevel Inverter
感应触摸板原理:可以应用到触摸屏,触摸开关等多种地方
E-book Induction motor by Langraf S.V.
2011.11 Seite 1 编制 Issued by:崔莹 Ann Cui 施工安全培训 Safety Induction 施工安全培训 Safety Orientation 编制/主讲:崔莹 Issued by/Trainer: Ann CUI 2011.11 Seite 2 编制 Issued by:崔莹 Ann Cui 施工...
Induction motor matlab simulation
Modelling induction motor started by synchronous generator.
Modelling three-phase induction motor on simulink.
This model simulates direct torque control of a three phase induction motor
带转矩内环的转速,磁链闭环异步电动机矢量控制系统matlab-simulink仿真。
v/f control programming of induction motor
induction motor IFOC control
异步电机矢量控制,采用坐标变换即svpwm理论实现的matlab仿真,适于毕业设计等初学人群。
Human-level concept learning through probabilistic programinduction
commande victoriel indirect de la machyne asynchrone programme par matlabe
Three_Phase_Induction_Motor:基于MATLAB/Simulink的三相感应电机动态数学建模仿真模型。 仿真条件:MATLAB/Simulink R2015b
汽车诱导睡眠系统,做车辆主动安全项目用到的,下载后缩短你的开发
对异步电机的能耗制动过程进行了仿真,分析了在能耗制动过程中电机的特性
这是一个在MATLABR2010a的环境下搭建的异步发电机的仿真模型。运行良好,波形比较理想。