`

lift中的路径映射

 
阅读更多
以下英文引用自:http://simply.liftweb.net/index-3.3.html#toc-Subsection-3.3.1

引用
Once the access control is granted by SiteMap, Lift loads the view related to the URL. There are many mechanisms that Lift uses to resolve a path to a view, but the simplest is a one to one mapping between the URL path and the files in /src/main/webapp. If the URL is /index, then Lift will look for the localized (see 8.1 on page 1↓) version of /src/main/webapp/index.html. Once Lift loads the template, Lift processes it to transform it into the dynamic content you want to return in response to the URL input.


路径映射由SiteMap控制,如果有的话(Boot.scala文件中).
最简单的映射机制是一对一的映射,将URL路径映射到/src/main/webapp目录下,如果URL是/index,那lift会查找/src/main/webapp/index.html文件,前提是SiteMap未设置.
分享到:
评论

相关推荐

    大数据之数据挖掘课程:海量数据集挖掘 01-Mapreduce 共68页.pdf

    - **潜在因子模型**:通过将用户和物品映射到低维潜空间中,以捕捉用户和物品之间的隐含关系。 #### 7. PageRank - **定义**:由Google发明的网页排名算法,基于网页之间的链接结构进行排序。 - **原理**:每个...

    利用MFC编写的一个模拟电梯程序

    在`Lift_1618979415`这个文件中,很可能包含了实现上述功能的源代码和资源文件。通过对这些文件进行编译和调试,我们可以看到一个简单的电梯模拟系统如何运作。通过分析和学习这个程序,开发者可以加深对MFC框架的...

    simple-app-with-sailsjs

    这会将 Sails.js 安装到你的系统路径中,让你可以在任何目录下运行 `sails` 命令。 2. **创建项目** 创建一个新的 Sails.js 项目,可以使用 `sails new` 命令,例如: ``` sails new simple-app ``` 这会在...

    xtsummitpoll

    在描述中提到的“npm install -g”,这表示全局安装一个名为“帆”的包,这里的“-g”标志意味着安装到全局路径下,这样可以在任何项目中使用。 3. **帆 (Sails)**: “帆”很可能指的是Sails.js,这是一个基于...

    simpleInventory:使用Sails实施简单的库存

    例如,`'GET /inventory': 'InventoryController.read'`表示访问/inventory路径时,调用`InventoryController`的`read`方法。 对于视图部分,Sails默认使用EJS模板引擎。在`views`目录下创建`inventory`子目录,并...

Global site tag (gtag.js) - Google Analytics