Establish a composite view using Sitemesh - 3. Other discussion
Establish a composite view using Sitemesh - 1.Hello
Establish a composite view using Sitemesh - 2. Decorator
Establish a composite view using Sitemesh - 3. Other Discussion <- now
The previous article is enough to apply Sitemesh to improve your app, but I have found that there are some other stuff may also help everyone.
The printed interface decoration has one printed decorator, which allows you to use Http: //localhost/aaa/a.html? Printable = TRUE mode to apply other decorator (you specified) Give the original page for printing (exempt from the pictures of the sprays such as Header, Footer). Let's take a look at how to implement him: 1. First set in Web-Info / Sitemesh.xml:
<% @ Taglib Uri = "SiteMesh-Decorator" prefix = "decorator"%>
(printable version) i> p>
Chinese problem Since the default character set inside Sitemesh is ISO-8859-1, direct use will be garbled, we can correct it by the following method:
Method 1: You can find some findings in the profile of the Application Server you use. Do you have an eNCoding or Charset project, and then set to GBK or GB2312 to Method 2: This is also the way we have been using. 1. Set: <% @ page contenttype = "text / html; charset = GBK"%> to tell the Server you ask. 2. Definition in the head of each JSP page: Tell the browser you use the character set. Summary: Using Sitemesh's most common way: 1. Configure a good environment, 2. Describe you will build the wrapper in Web-Info / Decroators.xml. 3. Develop the wrapper described in Decroators.xml, it is best to store 4.ok in / _decorators directory, you can look at the hard results :)
Resources:
Download what I offer with Ant Build, I am tested under J2SDK-1_4_0, Tomcat4.0.3 and Tomcat5, first run /build.bat to generate /Dist/web.war files, and then implement your server. OpenSymphony team project collection: http://sourceforge.net/projects/opensymphony wiki: http://wiki.opensymphony.com/ Download the latest version CVS on sf CVS
About the Author:
Chen Peng, Xi'an Dongsoft. As a fanatic programmer hopes to grow progress every day, and hope to share happiness and knowledge with you. Please contact him in the following ways: email chen56@msn.com