??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品播放,自拍偷拍亚洲欧美,亚洲精品第一区二区三区http://www.aygfsteel.com/JavaZero/To feel the crazy worldzh-cnThu, 22 May 2025 05:16:06 GMTThu, 22 May 2025 05:16:06 GMT60PDF & iText http://www.aygfsteel.com/JavaZero/archive/2009/04/15/253425.htmlKenLeeKenLeeWed, 15 Apr 2009 03:32:00 GMThttp://www.aygfsteel.com/JavaZero/archive/2009/04/15/253425.htmlhttp://www.aygfsteel.com/JavaZero/comments/253425.htmlhttp://www.aygfsteel.com/JavaZero/archive/2009/04/15/253425.html#Feedback2http://www.aygfsteel.com/JavaZero/comments/commentRss/253425.htmlhttp://www.aygfsteel.com/JavaZero/services/trackbacks/253425.html最q要用到iText来处理PDF来提供User与服务器交互的途径, 所以从Google和Baidu上翻了翻,学到了一点东? 想Mark下来以后参?同时也可以和大家交流一?

Project最主要是要解决三个斚w的问?

1.用什么Software来生成可交互的Form?
2.用什么Open source tools来Pre-fill Form?
3.在User填完Data?又以什么方式Submit 到Server处理?

对于W一个问?自然是用Adobe 的Software?但是用Acrobat Proq是用Lifecycle Designer, 却让我费了不劲.Z么咧?因ؓAcrobat Pro和Lifecycle Designer 处理的Form的格式是不一L(fng). Acrobat Pro里面用的是AcroForm,是Acrobat3.0开始用的格?而Lifecycle Designer里面用的是Xfa Form,是基于XML? 两者的不同请参考以下的摘录:      

Acroforms and XFA forms are different technologies

The interactive forms that you create in LiveCycle Designer are different than the interactive forms that you create in Adobe Acrobat. If you create an interactive form in Acrobat, your form is based on Adobe’s Acroform technology. This technology dates back to Acrobat version 3, and Adobe provides the “Acrobat Forms API Reference” to provide the technical details for this technology. I would not recommend using Acroform technology because XFA is the better technology.
 
If you are moving from Acroforms to XFA forms, you need to know a couple of important facts about these two technologies:

1.LiveCycle Designer can edit a PDF form created in Acrobat, but Acrobat cannot edit a PDF form created in Designer.

2.JavaScript works differently in these two technologies. Some of the JavaScript routines that work in Acroforms will not work in XFA forms. Adobe has documented these differences in a 43 page online PDF called, “Converting Acrobat JavaScript for Use in LiveCycle Designer Forms.” Designer is a much more robust tool for using JavaScript in your forms, so I recommend that you learn how to script with the XFA object model. See Chapter 4, “Form Scripting,” for more information.

PS: you can find more in the below link: More info about XFA


        
















 

 







Lifecycle designer 是后来才有的东西,自然是比Acrobat Pro更先q也更适合用于交互,但我的项目最l还是选了Acrobat Pro,因ؓ我的W二个问题的{案是iText. iText可以用来Pre-fill XFA格式的Form,但是不知道ؓ什么用iText Create的submit button不能submit XFA form(按了Button后没有反?,后来上网查到原来iText不支持XFA Form, 所以也只能用Acrobat?

而且用Acrobat Pro创徏的Form有两个我自己觉得不错的优?以TextFeildcdZ?:

    1. Acrobat Pro创徏的AcroForm是没有层ơ结构的,而LifeCycle Desinger创徏的Form是有层次?什么意思咧?举个例子,同样是Add一个TextFeild, 把它命名为CustomerName,在AcroForm里面的名字就是CustomerName?而在XFA Form里面成了topmostSubForm[0].Page1[0].CustomerName[0],咋一?q真是烦.而且你的PDF一改的?那你的Feild name也相应改?q样Program也要改了....
    2. Acrobat Pro创徏的AcroForm的TextFeild可以自适应大小,一个TextFeildL有一定的长度,但要填的Value׃知有多长?有可能有个CustomerName真的很长?q在XFA Form里面׃有些Value Show不出?但Acrobat Pro创徏的AcroForm的TextFeild可以根据Value的大而改变字体的大小来适应TextFeild的长?

以上两点是我自己的认?也许Lifecycle Designer也可以做C上的效果,但目前我是不?因ؓ接触Lifecycle Designer比较?yu)?如果有大虄道的话请多多指教.



KenLee 2009-04-15 11:32 发表评论
]]>
The solution of problem: "code too large for try statement"http://www.aygfsteel.com/JavaZero/archive/2009/02/06/253623.htmlKenLeeKenLeeFri, 06 Feb 2009 10:33:00 GMThttp://www.aygfsteel.com/JavaZero/archive/2009/02/06/253623.htmlhttp://www.aygfsteel.com/JavaZero/comments/253623.htmlhttp://www.aygfsteel.com/JavaZero/archive/2009/02/06/253623.html#Feedback1http://www.aygfsteel.com/JavaZero/comments/commentRss/253623.htmlhttp://www.aygfsteel.com/JavaZero/services/trackbacks/253623.html今天到了个比较奇怪的问题,居然是因为JSP太大D文g~译不了,上网查了一?把解x法脓(chung)下来,以供以后参?

The problem is that there is a limit on the size of a compiled method in a
Java class file, and that limit is what we're running up against. Recall
that a JSP page is compiled into a servlet, and into essentially only one
method in that servlet. Hence, if your page contains many, many tags, that
method becomes too big, and up comes the exception that you're seeing.

There are a couple of (partial) solutions.

1) Break your giant page up into multiple smaller pages and bring them
together at run time using <jsp:include>. Note that <%@include> won't work,
because that's a compile-time include, which will get you straight back to
the original problem.

2) Look for places to save on tags. For example, the <html:option> tag was
recently extended to allow the specification of the text to display, so
that you can replace this:

<html:option ... ><bean:message key="foo"/></html:option>

with this:

<html:option ... key="foo"/>

More info pls access this link: Solution

我就是用了第一U方法解决的,之前include JSP的时候用?a href="mailto:%@include">%@include, 后来用了<jsp:include>׃会用问题?Z贴一下两者的区别:


<%@ page language="java" contentType="text/html" %>
<html>
<head>
      <title>newInstance.com</title>
      <meta http-equiv="Content-Type"
        content="text/html; charset=iso-8859-1" />
      <link href="/styles/default.css"
        rel="stylesheet" type="text/css" />
</head>
<body>
<%@ include file="header.jsp" %>
<%@ include file="navigation.jsp" %>
<%@ include file="bookshelf.jsp" %>
<%@ include file="/mt-blogs/index.jsp" %>
<%@ include file="footer.jsp" %>
</body>
</html>


虽然 include 非常适于静态内容ƈ?Web 面Q但对于动态内容却不尽如h意。我们在前一文章中在试N新装入高速缓存文件时发现了这一问题。与大多数页眉文件及脚文g不同Q动态内容变化频J,必须时刻更新。我们将首先D地重qC?include 伪指令的局限性,然后我将向?zhn)演示如何?jsp:include 标记来扩?JSP 的包含能力?/p>


高速缓存问?/p>

JSP include 伪指令的不之处有一个是Q它会导?Web 览器高速缓存所有页面。在处理诸如脚、版权声明或一l静态链接之cȝ静态组件时Q这是有意义的。这些文件不会改变,因此没有理由?JSP 解释器不断地重新轮询其中的数据。凡是可能的地方Q都应该实现高速缓存,因ؓ它改善了应用E序的性能?/p>


但是Q有时侯Q进行高速缓存会得不偿失。如果提入的内容来自使用动态数据(?Weblog 或数据库驱动?JSP 文gQ的E序Q甚臛_果所包含的内Ҏ(gu)l常变化?HTMLQ如旉戌Q,那么每当装入 Web 面Ӟ都需要显C些文件或E序的最新版本。遗憄是,JSP include 伪指令ƈ不具备这一功能。在试和开发周期中Q在览器中用高速缓存通常能够解决q一问题。但是,对于实际使用的应用程序而言Q性能是Q何设计决{过E中的一w要因素,用高速缓存ƈ不是一U可行的长远之计。更好的解决Ҏ(gu)是?jsp:include 标记?/p>

jsp:include 标记

jsp:include 只不q是一个不同于 include 的伪指o而已?jsp:include 的优点在于:?L会检查所含文件中的变化。过一会儿我们研I这一新标记的工作方式。但首先看一下两U?include 各自的代码,以便能够看到二者之间的异同?/p>

清单 2 昄了一个简单页面,它用了原始?JSP include 伪指令?/p>


清单 2. JSP include 伪指?br />
<%@ page language="java" contentType="text/html" %>
<html>
     <head>
      <title>JSP include element test</title>
     </head>
     <body>
      This content is statically in the main JSP file.<br />
      <%@ include file="included.html" %>
     </body>
</html>


清单 3 是同一个页面,只不q这里{成?jsp:include 标记?/p>


清单 3. 转成使用 jsp:include

<%@ page language="java" contentType="text/html" %>
<html>
     <head>
      <title>JSP include element test</title>
     </head>
     <body>
      This content is statically in the main JSP file.<br />
      <jsp:include page="included.html" flush="true" />
     </body>
</html>


(zhn)应该注意这两种代码cd之间的两大区别。首先, jsp:include 元素不用属?include 伪指令的 %@ 语法。实际上Q?jsp 前缀?JSP ~译器知道:它应该寻找标?JSP 标记集中的元素。其ơ,指定要包含的文g的属性从 file 变成?page ?/p>


flush 属?/p>

(zhn)可能已注意?jsp:include 代码CZ中的 flush 属性。顾名思义Q?flush 指示在读入包含内容之前是否清IZQ何现有的~冲区。JSP 1.1 中需?flush 属性,因此Q如果代码中不用它,会得C个错误。但是,?JSP 1.2 中, flush 属性缺省ؓ false。由于清I大多数时候不是一个重要的问题Q因此,我的是:对于 JSP 1.1Q将 flush 讄?trueQ而对?JSP 1.2 及更高版本,其讄为关闭?/p>


jsp:include 是如何工作的

如果(zhn)有点爱刨根问底Q那么可能十分想知道 jsp:include 标记的行Zؓ什么与 include 伪指令不同。道理其实十分简单: jsp:include 包含的是所包含 URI ?响应Q而不?URI 本n。这意味着Q对所指出?URI q行 解释Q因而包含的?生成的响应。如果页面是 HTMLQ那么将得到一点也没有变化?HTML。但是,如果?Perl 脚本、Java servlet 或?CGI E序Q那么得到的是从该E序解释而得的结果。虽焉面通常是 HTMLQ但实际E序恰好是达到目的的手段。而且Q由于每ơ请求页面的时候都会进行解释,因此从来不会象?include 伪指令时那样高速缓存结果。虽然这只是很小的变动,但它却导致了(zhn)所见到的行Z的全部差异?/p>


一U؜合搭配的解决Ҏ(gu)

include 伪指令在某些|站上有其用武之地。例如,如果站点包含一些(如果有变化,也很)几乎没有变化的页眉、页脚和D文gQ那么基本的 include 伪指令是q些lg的最佳选项。由?include 伪指令采用了高速缓存,因此只需攑օ包含文g一ơ,其内容就会被高速缓存,其结果会是极大地提高了站点的性能?/p>

然而,对于现在许多 Web 应用E序或站点而言Q地毯式的高速缓存ƈ不能解决问题。虽焉眉和脚可能是静态的Q但是不可能整个站点都是静态的。例如,从数据库提取D链接是很常见的,q且许多Z JSP 技术的站点q从其它站点或应用程序上的动?JSP 面提取内容。如果正在处理动态内容,那么需要采?jsp:include 来处理该内容?/p>

当然Q最好的解决Ҏ(gu)是经常把q两U方法؜合搭配用,每U构造用到最恰当的地斏V清?4 是؜合搭配包含解x案的一个示例?/p>

清单 4. 混合搭配解决Ҏ(gu)

<%@ page language="java" contentType="text/html" %>
<html>
<head>
<title>newInstance.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="/styles/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<jsp:include page="header.jsp" flush="true">
<jsp:param name="pageTitle" value="newInstance.com"/>
<jsp:param name="pageSlogan" value=" " />
</jsp:include>
<%@ include file="/navigation.jsp" %>
<jsp:include page="bookshelf.jsp" flush="true" />
<jsp:include page="/mt-blogs/index.jsp" flush="true" />
<%@ include file="/footer.jsp" %>
</body>
</html>


上面的代码显CZ前一文章中的示例烦引页面。导航链接和脚是静态内容,一q最多更改一ơ。对于这些文Ӟ我用了 include 伪指令。内容窗格包?Weblog ?#8220;bookshelf”lgQ它们是动态生成的。这两个lg需要一直更斎ͼ因此对它们,我用了 jsp:include 标记?header.jsp 文g有点奇怪。这个组件是从另一个本质上是静态的 JSP 面提取的。但是,正如(zhn)将注意到的那样Q它从包含页提取?#8220;标语”Q然后将它显C出来。要处理q一׃n信息Q我们必d늜文g传入参数。而要处理那些参数Q就必须使用 jsp:include 元素?/p>

 
后记:|上q有一USolution:

try giving this in the deployment descriptor.

<jsp-param>
<param-name>noTryBlocks</param-name>
<param-value>true</param-value>
</jsp-param>

本h没有试过, 不知好不好用....



KenLee 2009-02-06 18:33 发表评论
]]>
վ֩ģ壺 Ԫ| | | ɽ| | ²| | ³| ̫ԭ| | ߱| | ȫ| Ϫ| ƽ| ˹| ƽԭ| ƽ| | ʡ| ɽ| | ƺ| | | | | ʯȪ| | | ƽ| | ؼ| | | ׶| ϵ| Դ| Ʊ| Դ| Ƹ|