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

发布时间:2015-12-07 10:48:18 

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

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

{“item”:     { <chtml> … … </chtml>     },”other”:”other value” }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

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

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

输出:”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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

? 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就是用于在这组前边输出一个逗号 -->
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

? 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> </

相关文章

2015-12-08 10:58:20

输出Bag中的一条记录--精通android、IOS App应用服务程序开发

闭合的json格式内容{ item : { chtml ...

更多
2015-12-09 10:22:08

输出Bag中的所有记录为一个json数组---精通android、IOS App应用服务程序开发

书写闭合的json格式内容{ item : { chtml ...

更多
2015-12-10 09:37:57

nolast属性---精通android、IOS App应用服务程序开发

闭合的json格式内容 同上一博(也可见下边完整代码相关部分)初始化Ba ...

更多
2015-12-13 11:30:53

输出Bag中的所有记录为一个只有值的json数组---精通android、IOS App应用服务程序开发

闭合的json格式内容 不需要初始化Bag中的记录 同上一博(也可见下边 ...

更多