自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Clouda URL使用說明

移動開發(fā)
URL是Web app中很重要的部分,在router部分介紹過URL中pattern與controller的關(guān)系,在這節(jié)將詳細(xì)介紹Clouda中URL的格式和使用。

URL是Web app中很重要的部分,在router部分介紹過URL中pattern與controller的關(guān)系,在這節(jié)將詳細(xì)介紹Clouda中URL的格式和使用。

Clouda中URL的組成格式如下:

  1. 域名/{controller}/{arguments[1]}/{arguments[2]}/...?params1=string&params2=string 
  • controller

    與router中的pattern對應(yīng)

  • arguments

    URL中的傳遞參數(shù)

  • params

    與controller中使用env.redirect(queryPath ,paramMap)傳遞的paramMap對應(yīng)

一個URL格式的實(shí)例:

  1. URL: localhost:8080/debug.html/studentList/index/123/007?p=2 

對應(yīng)router定義為:

  1. sumeru.router.add{ 
  2.     { 
  3.        pattern: '/studentList/index'
  4.        action: 'App.studentList' 
  5.     } 

上面介紹了Clouda中URL的組成規(guī)則,那么Clouda是如何解析URL呢?下面介紹Clouda的解析方法。

  • 自動匹配到 /controller是/studentList/index

  • 將后面的參數(shù) /123/007 作為 arguments傳入env.arguments

  • 將p傳入session和controller的params參數(shù)中

在上面的實(shí)例中看到URL中帶有參數(shù),那么如何獲取URL中的參數(shù)呢?可按照下面方法獲?。?/p>

  • env.arguments["/studentList/index","123","007"]

  • session.get('p')或者通過上面Controller之間傳參部分中的params.p獲取;

一般在開發(fā)階段需要在瀏覽器中對應(yīng)用進(jìn)行debug,看到應(yīng)用的源碼;而在開發(fā)完成發(fā)布后,不希望別人看到應(yīng)用的源碼,為了滿足開發(fā)者的這種需求,Clouda有調(diào)試模式和正式模式。

  • 調(diào)試模式

    使用debug.html訪問進(jìn)入調(diào)試模式,在調(diào)試模式下可以看到工程的源碼,方便在瀏覽器中進(jìn)行調(diào)試

    1. localhost:8080/debug.html/studentList/index/123/007?p=2 
  • 正式模式

    使用index.html訪問進(jìn)入正式模式,在正式模式下看到的是經(jīng)過編譯后代碼

    1. localhost:8080/index.html/studentList/index/123/007?p=2 

 

責(zé)任編輯:張葉青
相關(guān)推薦

2009-12-28 11:34:22

WPF處理消息

2010-06-03 13:49:04

Sendmail 配置

2011-03-15 10:00:01

NetfilterIPTables

2019-09-29 14:33:30

Redis集合元素

2010-05-27 14:28:41

TortoiseSVN

2009-12-15 15:13:07

.NET Framew

2009-12-21 10:10:25

Oracle產(chǎn)品

2009-12-24 16:20:43

WPF Tooltip

2010-05-27 14:02:04

SVN使用說明

2010-05-07 13:43:27

Unix Shell

2010-05-27 14:38:37

2010-07-28 09:49:27

FlexBuilder

2009-12-15 10:17:38

VS 2010軟件

2009-12-25 18:12:43

WPF裝飾器

2010-05-27 14:18:00

SVN使用說明

2020-06-28 09:03:26

Linuxtree命令目錄

2010-01-05 16:33:35

使用JSON

2009-12-31 09:42:41

ADO對象模型

2010-01-04 16:54:22

ADO分頁

2009-12-29 14:28:58

ADO數(shù)據(jù)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號