Tapestry 页面中的内部类

发布于 2024-10-07 09:39:43 字数 89 浏览 0 评论 0原文

我们可以在Tapestry页面中声明/创建内部类并访问到相应的.tml页面吗?如果是,那么如何?如果没有,谁能解释一下为什么?

需要你们宝贵的意见。

Can we declare/create inner class in Tapestry page and access it to the corresponding .tml page? If yes, then how? If not, could anyone explain why?

Need your valuable input guys.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

童话 2024-10-14 09:39:43

是的,这有效。内部类会实时重新加载,但不会作为组件类进行检测。

我已经开始使用这种技术来定义页面所需的数据对象,因为我可以动态更新 @Validate 注释,甚至更改可用属性。

Yes, this works. The inner class is live reloaded but is not instrumented as a component class.

I've started using this technique to define data objects needed by the page, since I can update the @Validate annotations, or even change the available properties, on the fly.

无声无音无过去 2024-10-14 09:39:43

我找到了解决方案并与您分享。

假设我们有一个名为 Tpage 的挂毯页面。

public class Tpage {  
    // variables  
    @Property  
    private TpageInnerClass innerclass;  

    //some methods  

    // Inner class  
    public class TpageInnerClass { 
        // variable  
        //methods  
    }
}  

现在您可以访问 Tpage.tml 中的内部类变量。

希望大家都清楚。虽然我仍在寻找专家的评论。

I found the solution and am sharing it with you.

Let's assume we have a tapestry page named Tpage.

public class Tpage {  
    // variables  
    @Property  
    private TpageInnerClass innerclass;  

    //some methods  

    // Inner class  
    public class TpageInnerClass { 
        // variable  
        //methods  
    }
}  

Now you can access the inner class variable in Tpage.tml.

Hope it is clear to all of you. Though I am still looking for experts comments.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文