
<?xml version="1.0" encoding="utf-8"?>
<SimpleControl descriptors="xworker.http.controls.SimpleControl">
<actions>
<GroovyAction name="doAction">
<code><![CDATA[//获取request参数,返回值匹配
def result = request.getParameter("result");
if(result == null || result == ""){
return "success";
}else{
return result;
}]]></code>
</GroovyAction>
</actions>
<view name="successView" title="Success">
<otherHeads><![CDATA[<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/2_6beta1/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>]]></otherHeads>
<htmlCode>
<htmlCode><![CDATA[<p>Hello World!</p>
<h3>SimpleControl是一个简单但完整的MVC框架。</h3>
<ul>
<li><strong>Model</strong><br />
是SimpleControl的doAction方法,负责处理请求和准备要返回的数据。<br />
</li>
<li><strong>View</strong><br />
是SimpleControl的view子节点,可以用来编写输出的界面。<br />
</li>
<li><strong>Control</strong><br />
是SimpleControl本身,它调用doAction方法并根据doAction方法的返回值匹配result输出。</li>
</ul>
<h3>比如本示例通过在URL中的result参数控制输出界面</h3>
<p> Success,<a href="do?sc=xworker.example.web.helloworld.SimpleControl&result=failure">
Jumps to Failue</a>.</p>]]></htmlCode>
</htmlCode>
</view>
<view name="failureView" _xmeta_id_="successView1" title="Failure">
<otherHeads><![CDATA[<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/2_6beta1/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>]]></otherHeads>
<htmlCode>
<htmlCode><![CDATA[<p>Hello World!</p>
<h3>SimpleControl是一个简单但完整的MVC框架。</h3>
<ul>
<li><strong>Model</strong><br />
是SimpleControl的doAction方法,负责处理请求和准备要返回的数据。<br />
</li>
<li><strong>View</strong><br />
是SimpleControl的view子节点,可以用来编写输出的界面。<br />
</li>
<li><strong>Control</strong><br />
是SimpleControl本身,它调用doAction方法并根据doAction方法的返回值匹配result输出。</li>
</ul>
<h3>比如本示例通过在URL中的result参数控制输出界面</h3>
<p>Failure,<a href="do?sc=xworker.example.web.helloworld.SimpleControl&result=success">Jumps to Success</a>.</p>]]></htmlCode>
</htmlCode>
</view>
<result name="success" value="xworker.example.web.helloworld.SimpleControl/@successView"></result>
<result name="failure" value="xworker.example.web.helloworld.SimpleControl/@successView1"></result>
</SimpleControl>