`
yefeishan
  • 浏览: 108775 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
最近访客 更多访客>>
社区版块
存档分类
最新评论

Tapestry里怎么实现Jsp里的ServletContext.getRealPath("/")的

阅读更多

Tapestry里怎么实现Jsp里的ServletContext.getRealPath("/")的功能。

getRequestCycle().getInfrastructure().getContextPath();

@InjectObject("service:tapestry.globals.WebContext")
public abstract WebContext getWebContext();

getWebContext().getRealPath("/upload/")

 

@InjectObject("infrastructure:contextPath")
public abstract String getContextPath();

Then write some computeUrl method similar to this one (just typed this in,
no guarantee that this will work).

public String computeUrl() {
String locale = getLocale().getCountry().toLowerCase();
return getContextPath() + "/Public/flags/" + locale + ".gif";
}

分享到:
评论

相关推荐

    tapestry-bin-5.1.0.5

    4. **tapestry-ioc-LICENSE.txt**:这部分涉及Tapestry的依赖注入(IOC)框架,它是Tapestry实现组件之间解耦的关键部分。 5. **tapestry-upload-LICENSE.txt**:关于Tapestry中文件上传功能的许可信息,帮助开发者...

    tapestry 5 ..........

    - **实现验证逻辑**:利用Tapestry的内置验证机制来验证用户输入。 #### 5. 创建“Hi/Lo”游戏 文档中的“Hi/Lo”游戏是一个很好的实践项目,可以帮助开发者更好地理解Tapestry的核心概念。这个游戏的基本流程包括...

    Manning.Tapestry.in.Action.Mar.2004.rar

    《Tapestry in Action》是由Manning出版社在2004年3月出版的一本专业书籍,主要聚焦于Apache Tapestry框架的应用与实践。这本书详细介绍了如何使用Tapestry来构建高效、可维护且易于扩展的Java Web应用程序。...

    Tapestry.5.Building.Web.Applications.pdf

    《Tapestry 5.0:构建Web应用程序》是一份专为深入了解Tapestry 5.0框架而准备的详细指南。Tapestry是Apache软件基金会的一个开源项目,它提供了一种基于Java的声明式MVC(Model-View-Controller)框架,用于构建...

    Tapestry5, Packt.Publishing.Tapestry.5.Building.Web.Applications.Jan.2008.RETAiL.eBOOk-sUppLeX.pdf

    ### Tapestry5:构建Web应用程序 #### 一、Tapestry5概述 Tapestry5是一种先进的、基于Java的Web开发框架,它以其强大的功能、灵活性以及易用性著称。该框架由Howard Lewis Ship创建,并由Apache软件基金会维护。...

    tapestry-src-5.1.0.5.zip

    包含: tapestry 的源代码, tapestry集成spring2.0 tapestry快速启动 tapestry upload tapestry hibernate tapestry annotations

    Packt.Publishing.Tapestry.5.Building.Web.Applications.Jan.2008.pdf

    与传统的基于Servlet或JSP的Web开发方法相比,Tapestry 5通过组件化的方式降低了代码的耦合度,使得应用程序更易于维护和扩展。 #### 三、Tapestry 5的特点 - **组件化**:Tapestry 5的核心特性是其强大的组件模型...

    tapestry 5.1.0.5 官方组件文档 天涯浪子

    来自:http://tapestry.apache.org/tapestry5.1/tapestry-core/ref

    Tapestry-3-Getting Started.doc

    - 地址:[http://tapestry.apache.org/releases/3.0/update-site/](http://tapestry.apache.org/releases/3.0/update-site/) - 完成安装后,测试 Eclipse 内的 Tapestry 插件是否可用。 #### 三、开发流程 ##### ...

    史上最全面Tapestry学习教程

    - 访问 [http://tapestry.apache.org/](http://tapestry.apache.org/) 下载 tapestry-bin-5.1.0.5.zip。 - 备份以备后续使用。 ##### 1.5 新建 Web 工程 - **步骤**: - 打开 Eclipse,选择 File > New > ...

    将Tapestry整合到Spring里去.doc

    import org.apache.tapestry.engine.BaseEngine; import org.springframework.context.ApplicationContext; import org.springframework.web.context.WebApplicationContext; import org.apache.tapestry.request....

    apache-tapestry-5.3.8-bin.zip

    Tapestry的核心特性包括组件模型、依赖注入(通过Tapestry IoC实现)、异常处理、国际化支持等。 2. **Tapestry Core**:`tapestry-core-5.3.8.jar`是Tapestry框架的核心库,包含了框架的基础组件、服务和API。它...

    Tapestry5开发环境搭建(Eclipse)

    ### Tapestry5 开发环境搭建(Eclipse) 在本文中,我们将详细介绍如何使用 Eclipse、Maven 和 Jetty 搭建 Tapestry5 的开发环境。这不仅有助于理解基本的搭建流程,还能帮助开发者掌握必要的配置步骤和技术细节。 ...

    tapestry学习入门资料

    "tapestry学习入门资料" Tapestry 是一个开源的基于 servlet 的应用程序框架,它使用组件对象模型来创建动态的、交互的 web 应用。 Tapestry 使得 Java 代码与 HTML 完全分离,利用这个框架开发大型应用变得...

    Tapestry简单入门.rar_java Tapestry_tapestry

    Tapestry是一款强大的Java Web应用程序框架,由Apache软件基金会维护,它提供了一种基于组件的模型来构建动态、数据驱动的Web应用。本教程将帮助初学者了解Tapestry的基本概念,带你逐步入门并掌握其核心组件的使用...

    Brown, F. H. (Ed.). (1991). Reweaving the American Tapestry: A multigenerational approach to families. New York: Norton, 316 pp., [dollar]32.95

    Reweaving the American Tapestry: A multigenerational approach to families. New York: Norton, 316 pp., [dollar]32.95 Book Reviews 33 1 My overall impression is that the book contains some very ...

    Maven + Tapestry5.3.8 + Spring4.0.5 + Oracle10g

    这是Tapestry5.3.8 版本的一个大Demo,集合Spring4.0, 采用Maven 项目管理工具,没有集合Hibernate。 之所以说是个大Demo,是因为这项目中包含的内容并不少,包含: 1)解决了Tapestry5.3.8中文Bug问题 2)Tapestry...

    apache-tapestry-5.3.7-bin.zip

    Apache Tapestry是一个强大的Java web应用程序框架,由Apache软件基金会维护,专注于构建动态、交互式的Web应用。Tapestry 5.3.7是该框架的一个版本,提供了许多增强的功能和改进,以帮助开发者更高效地构建高质量的...

    Tapestry4开发指南

    然而,随着时间的推移,Tapestry4展现出的独特优势逐渐显现,尤其是其通过Hivemind提供的IoC和DI(Dependency Injection)机制,使得开发者能够根据具体需求重构Tapestry4的组件,从而实现更为个性化、符合特定场景的...

Global site tag (gtag.js) - Google Analytics