关于Tapestry的一些问题

Tapestry In Action Manning - Tapestry In ActionU.part3 立即下载

来源:http://forum.javaeye.com/viewtopic.php?t=6035&sid=42b6f6b88ee6a3cc2e2ccdea70a7fdf9

 

Tapestry也用了一段时间了,对于Tapestry基本上也是了解的很透了,不过也慢慢发现了一些问题,虽然Tapestry号称可重用的Server端控件,号称基于html模版,可是实际上还是有些问题。

首先,基于html模版其实不太有用,事实上一个动态页面写好以后,再用dreamweaver之类的工具打开编辑几乎不可能,所以这点优势可以说是很弱的。

其次,关于开发可重用控件的神话。

虽然控件开发出来以后用到的地方是很好用,可是他有以下缺点,足以打回可重用控件带来的好处

(1)开发控件的代价,开发控件要写.jwc,要写.js,要写.html, 要写.script, 要写java,要写library定义,太复杂了。

(2)理解/使用复杂控件的代码,以Tree为例,构造TreeModel是一件非常麻烦的事情。还要理解TreeSessionState

还有Table, 简单一个Table就要用上TableModel,TableSessionState,太复杂了.

而用jsp的话,做tree的话有TreeTag ,(http://www.jenkov.dk/projects/treetag/treetag.jsp)

做table的话有displaytag,都是一个非常简单非常好用的东西,

in fact i'm wondering taglib或者velocity也能做一些可重用的东西,做出来的东西来取代Tapestry的所谓可重用控件不会更难用。anyway,displaytag/treetag也算重用的)
(3) rewind / ListEditor listener / abstract getter and setter 不直观,难看。

(4)使用的代价,比如PopupLink,又要理解Tapestry对应控件,又要理解对应产生的javascript ,还不如一开始就直接写上javascript来的简单。

而且扩展困难,要扩展popupLink做跟多事情要麻烦死了。

(5) 扩展的代价,以service为例,扩展service 就要完全清楚tapestry底层的东西。以及跟其它系统(其他servlet构成的框架)交互的能力
例子可以参考Tapestry in Action里头的Ad Rotator例子,一个简单的
Ad Rotator就要新作service做很多工作,太可怕了,而传统的做法Ad Rotator是非常容易实现的。

(6)理解engine工作原理的代价

(7)调试的代价,如果涉及url encoding, engine, session ,abstract getter & setter等等,就很难作了

//封装太多,失去控制力了。

再次,page object 的逻辑duplicate 在java object 和 page specification 两个地方,太不直观了。往往研究页面关系要很费劲。

最后,单元测试的问题。Tapestry进行单元测试简直不可能,而用webwork是很容易的一件事。转去研究Webwork咯。
不过附带说的一下是,虽然Tapestry有满多缺点,但是他的Server端对于client 信息的Track技术还是相当不错的,用的一些url encoding, 、命名生成等等都非常棒,与传统做法大不一样,没想到servlet原来可以这样写法,对于我还是非常有启发的,这些知识可以用到其他地方去。

最近在作的一个xmlhttp command framework,就是受tapestry启发作的
(基本逻辑是client用xmlhttp发送命令,对应Servlet采用MVC model2.根据传来的的xmlhttp请求不同发送到不同action,目前dispatch action部分使用xwork)
xmlhttp请求类似于
<call namespace="..." actionName="...>
<param name="...">...</param>
</call>
而Servlet dispatch到对应的action执行。

通达信股本变迁文件(gbbq)解密方法 近年来A股市场跌宕起伏真特么精彩,本人愚钝,被整爆仓,损失惨重 痛定思痛,认为交易这种对纪律要求极高,且必须完全排除情绪影响的勾当,还是应该交给程序来干 数据哪里来呢?当然是拿来主义。。。问券商的交易软件要呗 到处查资料,得知通达信的权息文件数据齐全,不仅含有除权除息数据,还含有限售解禁、增发、可转债上市等股本变化数据 ——这对于某些对成交量变化敏感的交易模型是非常重要的 阅读详情

相关推荐

datart 二开环境搭建

下载源码, 地址: https://github.com/running-elephant/datart, dev 分支; 解压后使用 idea 打开; 服务端: 3.1 安装依赖, idea会自动安装; 3.2 修改配置文件 /config/application.yml 3.3 创建数据库,并将bin/datart.sql导入到数据库中 3.4 入口: /server/src/main/java/datart/DatartServerApplication.java [外链图片转存失败,源站可能有防.

又是再见? 6133

Tapestry资源

Introduction to Jakarta Tapestry首先肯定得写Tapestry的老家了:http://jakarta.apache.org/tapestry/index.html 当然还有Tapestry老大Howard Lewis Ship的Blog了:http://howardlewisship.com/blog/其 实个人认为从他们的wiki上面反而还能得到更多的信

池塘 604

Cesium 模拟飞机坠毁功能

Cesium 模拟飞机坠毁功能,粒子模拟

QQhelphelp的博客 1068

【tapestry3笔记】--tapestry 初探,《 tapestry in action 》第一章学习笔记

由于要维护一个项目,要用到tapestry3这个老框架,虽然这个框架很老,但是在我看来ta的思想还是很先进的---面向组件编程。 由于网上资料少的可怜,辛苦找了很久终于找到一本名为《tapestry in action》的工具书,以下学习笔记均以此书为参考。 正文---tapestry初探 tapestry in action 第一章学习笔记 tapestry是一款以组件为核心的开发框架,组...

weixin_30537391的博客 255

Unity安卓打包实战:SDK与JDK配置全攻略

本文详细介绍了Unity安卓打包过程中SDK与JDK的配置方法,包括工具下载、安装步骤、环境变量设置及常见错误排查。通过实战指南帮助开发者快速完成Unity安卓打包环境搭建,提升开发效率。

weixin_30338481的博客 415

告别理论劝退:用动画和Tanner图轻松理解QC-LDPC的译码原理(BP算法详解)

本文通过动画和Tanner图直观解析QC-LDPC码的BP译码原理,帮助读者轻松理解802.11ac协议中的编译码过程。文章详细展示了QC-LDPC的结构之美、BP算法的动态信息流动以及LLR的视觉化解读,并对比了硬判决算法的性能差异,为开发者和研究者提供了实用的可视化工具开发建议。

weixin_30411239的博客 492

【tapestry3学习笔记】--tapestry页面构成分析《 tapestry in action 》第一章学习笔记...

一个tapestry页面通常由3部分构成。xxxx.html;xxxx.page;xxxx.java。其中html文件为网页模版,告诉tapestry页面需要什么组件,都在哪里调用。page文件为模版说明,告诉tapestry框架,网页模版对应的组件具体类型等信息。 转载于:https://www.cnblogs.com/FindRui/p/6446544.html...

weixin_30692143的博客 171

与本地电脑PDF文档对话的PDF问答程序

紧接着,从PDF文档中提取文本,这部分代码的作用是遍历PDF文档中的每一页,并使用extract text(0方法提取每一页的文本内容,然后将这些文本内容累加到raw text变量中。PDF问答程序的实现方式是利用LangChain已实现的向量存储、嵌入,以及使用查询和检索相关的链来获取外部数据集及处理文档,在进行相关性检索后进行合并处理,将其置入大语言模型的提示模板中,实现与PDF文件交流的目的。例如,你正在为一项重要的报告寻找资料,你必须知道你需要查找的关键词,然后在大量的信息中筛选出你需要的部分。

weixin_43961909的博客 1420

Tapestry in Action

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.youkuaiyun.com/topmvp - topmvpThe creator of Tapestry details how to use this new frameworks components to create rich web-based GUIs usin

TopMVP 440

Python爬虫实战:使用Scrapy+Playwright高效爬取全球石油价格历史数据

python复制下载# 产品信息# 日期信息# 价格数据price = scrapy.Field() # 收盘价open = scrapy.Field() # 开盘价high = scrapy.Field() # 最高价low = scrapy.Field() # 最低价volume = scrapy.Field() # 交易量change_percent = scrapy.Field() # 涨跌幅# 元数据。

2201_76125261的博客 1020

基于YOLOv8的农作物病虫害检测系统设计与实现

国内如中国农业大学的科研团队采用改进的Faster R-CNN模型对小麦病害进行检测,取得了较好的效果。农作物病虫害是影响农业生产的重要因素之一,每年因病虫害导致的农作物减产高达20%-40%。YOLO(You Only Look Once)系列算法作为目标检测领域的代表性模型,以其高效、准确的特点在众多领域得到广泛应用。YOLOv8作为该系列的最新版本,在精度和速度上都有显著提升,非常适合农作物病虫害检测这类需要实时处理的应用场景。然而,现有研究仍存在一些不足:一是模型复杂度高,难以部署到移动设备;

YOLO 794

Tapestry乱码问题~

在windows下:不用.application也可以使用正常,无乱码在unix下面:需要配置: 工程名.application,工程名和web.xml中定义的一致。 比如你定义:address.application 内容是:  "-//Apache Software Foundation//Tapestry Specification 3.0//EN"  "http://jakarta.apa

笑看人参----JAVA,WEB2.0,SOA... 1670

STM32入门教程:WiFi通信

第四步:初始化串口 在生成的代码中,您可以找到一个名为 "USARTx_Init" 的函数,其中 "x" 是您选择的串口号。然后,我们使用 "AT+CIPSEND" 命令发送UDP数据,接收到服务器的回复,并在终端上显示收到的数据。在配置向导中,您可以选择启用USART串口功能,并根据您的硬件连接,将串口设置为与WiFi模块连接的串口。在上述代码中,我们使用了 "HAL_UART_Receive" 函数来接收串口数据,并使用 printf 来在终端上显示收到的数据。如果有任何问题,请随时向我提问。

2401_85258012的博客 1074

tapestry国际化的问题

今天学习了tapestry的页面国际化,但遇到一些小问题:我建立一个页面CurrentDate.html用来显示当前的时间: [code] Current Date yyy ttt [/code] CurrentDate.java代码: [code] public class CurrentDate extends BasePage...

yongganzhe 144

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

tapestry不能运行的问题

在tapestry中如果不会用到spring的话就不用配置Spring的contextLoadListener在web.xml中, 但是如果不配置的话会出现没有配置contextLoadListener的错误,主要原因在于把tapestry和spring的依赖包tapestry-spring放在了lib下面。 所以不能运行,只要把这个包去掉就可以。...

飞鹰之家 147

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

编写tapestry页面时碰到的问题集锦

popup window如何做? 在服务器端如何输出javascript代码? iframe如何实现?    其它已解决的问题:could not found adapator for class com.... java.lang.IllegalArgumentException 原因是类需要serializable 序列化 经典问题:java.lang.ClassC

清风 1242

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Tapestry + Spring + Hibernate 整合工作及相关问题

FrankSoo是我的项目经理。前段时间公司决定作个新的J2EE二次开发平台,以替换公司原有的开发平台。公司让FrankSoo和我组成平台开发项目组,FrankSoo担任项目经理。现在这个平台整合开发阶段已经结束,进入项目应用阶段。下面是我们的整合工作小结,介绍一下我们在工作中遇到的问题,以及我们选择的解决方案. 1、架构的选择 首先,我们都同意以我们现有的能力,没有足够的时间和资源自行开发一

鲤鱼商城 1424

Tapestry失效链接问题(stale link)

关于失效链接(stale link):     当form的动态部分用来表现持久化属性的时候, web浏览器和服务器有可能不同步,就造成了一个固有的问题。当form被submitted的时候,Tapestry会发觉引入的form与储存在服务器中的状态不匹配,这就是失效连接。     对于失效连接,是Tapestry特有的没有办法避免的问题。所以我们在处理这种情况的时候要非常小心。至于为什么...

rabbiter_gtt的专栏 307

tapestry登陆验证问题

大家好,我现在有一个关于tapestry验证的问题,我的一个需求是当用户登陆时,如果验证失败,将返回登陆页,如果成功则新开一个窗口,显示登陆成功信息。 首先我把自己的想法给介绍一下 1 用户登陆失败,我让target="_self",同时停留在登陆页,并显示校验信息。 2 验证成功,新打开一个页,此时的target="_blank",同样返回登陆页———&gt;登陆页根据返回的一个标识确定是否可以...

lean1252的专栏 197

Tapestry5中创建的模块无法自动装载的问题

在Tapestry5的模块创建过程中,我先是在Eclipse中创建了一个简单的工程:subappcom.gsww.subapp.SubappModulecom.gsww.subapp.pages.Test然后将其导出为.jar包在新的Tapestry应用中使用subapp这个模块,但是无法装载Test页面。奇怪的是将subapp模块在maven里面打包后的的jar包放入到应用里

敏捷开发专栏 294

Tapestry的使用感受、经验及存在问题

Tapestry的使用感受、经验及存在问题一、Tapestry简介    Tapestry是一个基于组件、监听事件的框架,它在web应用中的作用可以概括为“负责接受请求和产生HTML的响应”,它使用HTML模板、页面规范文件、对应的Java  page class通过ognl表达式(Object-Graph Navigation Language)的相关对象属性与Tapestry组件的绑定

youge的专栏 1711

解决tapestry中由于使用对象池而造成信息泄露的问题

在tapestry中,由于每个页面都需要使用一个页面对象,为了提高系统的性能和节约资源,考虑使用对象池,即多个页面模板在渲染的时候可能使用的是一个页面对象,那么此时就可能出现用户A看见了用户B的数据,这个是绝对不允许的,存在信息的泄露,解决的办法是,实现initialize()方法,在页面对象放入对象池之前对属性数据进行初始化: public class Result extends BaseP...

zhangwenjun8045 188

Tapestry中文问题

在.application增加

822

tapestry5.0.14的问题

我一直用tapestry5.0.5,以前用5.0.6也做了一个测试例子,最近想拿5.0.14学习一下,可是新建了一个工程后,从start.java提交后不能到index.java,我换了5.0.5就没问题了,最后细看了一下,原来是5.0.5在start.html页面时,当鼠标放在提交按扭上,状态拦会显示/myApp/start.form,jsessonid=.....;而5.0.14显示的则是st...

xbq0501 90
上一篇: Open source Java web application frameworks
下一篇: 关于表现层的框架技术框架选型,费神
JasonSeaver
博客等级 码龄25年 2粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值