Flying-saucer + iText + Freemarker implements pdf export, supports Chinese, css and pictures
Preface
There is a requirement in the project to export the contract content to pdf. IText is an open source Java library for generating PDF documents. It can dynamically generate PDF from XML or database. It can also encrypt documents, control privileges, and support Java/C# etc. But the HTML parser provided by iText itself is not strong enoug ...
Posted by hussainz2000 on Thu, 13 Dec 2018 23:12:06 -0800
Servlet JSP Tutorial -- 1.14 Async Servlet Example
Asynchronous servlet is introduced in Servlet 3. This is a good way to deal with thread starvation when running threads for long periods of time.
Async Servlet
Before we understand what an asynchronous Servlet is, let's try to understand why we need it.
Suppose we have a Servlet that takes a lot of time, like the fol ...
Posted by heavenly on Thu, 13 Dec 2018 15:42:05 -0800
ASP.NET MVC logs using Log4net
Log4net introduction
Log4net, Apache's next open source project, is a clone of Log4j. We can control the destination of log information output. Log4net defines a variety of log information output modes. It can output logs to console, text files, windows log event viewer, including database, mail and other locations, so that we can quickly trac ...
Posted by kgahn on Tue, 11 Dec 2018 03:42:05 -0800
Struts 2 - > validate and interceptor
1.Validate
1.1 Rewriting validate Method
For example, do the login page on the front desk
action:
1.2 checkout framework
1. Write a checking rule file
It is a typical XML file in the format of ActionName-validation.xml
The validation file needs to add a dtd constraint description
The dtd description is in xwork-core
<!DOCTYPE va ...
Posted by KGodwin on Mon, 10 Dec 2018 10:09:06 -0800
Use and Analysis of [Curator] Persistent Ephemeral Node/Persistent Node
Persistent Ephemeral Node / Persistent Node
A persistent node that can be maintained when a link or session is interrupted.
1. key API
org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode
2. mechanism description
Actually, it's org.apache.curator.framework.recipes.nodes.PersistentNode.
Considering a lot of abnormal situations, it ...
Posted by Reef on Mon, 10 Dec 2018 09:21:05 -0800