提高到精通移动(android、IOS)App应用服务程序开发

6.2 开发提高
请学习同一下载包中的开发手册中的基本标签语言及表达式

6.3 精通移动App应用服务程序开发
熟悉轻开平台针对移动App(json格式)的规则及开发例子
除了基本开发标签语言及表达式(参见同一下载包中的开发手册)外,轻开平台特别针对移动App最常用的json文本格式开发的对应规则:
 文件扩展名须为json(如:one.json)或用JspEasy扩展的jsp文件名
 文件内容须为闭合的json格式,静态内容则可直接书写json格式,如:

{“item”:
    {
<chtml>
… …
</chtml>
    },”other”:”other value”
}

 value属性参数表示输出不带引号的值,如:

<price value>@{item:price}</price>

输出:”price”:51.24

 list属性参数表示输出为数组列表格式,end属性参数表示数组结束的位置(跟for的end值相等)

<for bags=item end="@{item:getLength}">
    <item list="@{item:getSuffix}" end="@{item:getLength}">
    <!-- list属性参数表示输出为数组列表格式,end属性参数表示数组结束的位置(跟for的end值相等) -->
        <name>@{item:name}</name>
        <price value>@{item:price}</price>
        <unit>@{item:unit}</unit>
    </item>
</for>

 nolast属性参数表示数组后边输出一个逗号

<for bags=item end="@{item:getLength}">
    <item list="@{item:getSuffix}" end="@{item:getLength}" nolast>
    <!-- list属性参数表示输出为数组列表格式,end属性参数表示数组结束的位置(跟for的end值相等), nolast属性参数表示数组后边输出一个逗号-->
        <name>@{item:name}</name>
        <price value>@{item:price}</price><!-- value属性参数表示输出不带引号的值 -->
        <unit>@{item:unit}</unit>
    </item>
</for>
<tatol>@{item:getLength}</tatol><!-- 前边的nolast就是用于在这组前边输出一个逗号 -->

 nokey属性参数表示不输出数组名称

<for bags=item end="@{item:getLength}">
    <item list="@{item:getSuffix}" end="@{item:getLength}" nokey>
    <!-- list属性参数表示输出为数组列表格式,end属性参数表示数组结束的位置(跟for的end值相等), nokey属性参数表示不输出数组名称-->
        <name>@{item:name}</name>
        <price value>@{item:price}</price><!-- value属性参数表示输出不带引号的值 -->
        <unit>@{item:unit}</unit>
    </item>
</for>

 无名称数组直接累成字符串输出即可

<chtml>
<!-- 正式json格式的内容,无名称数组直接累成字符串输出即可 -->
<for bags=item end="@{item:getLength}">
    <if x="@{item:getSuffix}" else=1>
        <bag id=pPage x=0><we name=name>"@{item:name}"</we></bag>
        <bag id=pPage><we name=name>@{pPage:name},"@{item:name}"</we></bag>
    </if>
</for>
</chtml>[@{pPage:name}]

 空数组直接输出:

[]

整套规则仍然突出Easy,几乎一看就能掌握。后边将结合实例进行学习

相关资源下载:
移动App应用服务器开发从入门到精通:http://download.csdn.net/detail/tx18/8741611
快速搭建移动App服务器 :http://download.csdn.net/detail/tx18/8737507
轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本:http://download.csdn.net/user/tx18

评论 21
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值