摘自techno.blog("Dion")
META-INF/context.xml
Category: Java, Tech, Web Frameworks
It is always frustrating if you have to munge a server.xml in Tomcat, or the equivilent in other servers. At that point, your nice deployable .war file requires a README that says "oh, and make sure your server.xml is setup like this...".
At least now we have a feature that lets us put context information in the war file. I didn't know that Tomcat supported this until recently:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
auth="Container"
description="DB Connection"
name="jdbc/ebackbay"
type="javax.sql.DataSource"
password=""
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
validationQuery="select * from testdata;"
username="root"
url="jdbc:mysql://localhost/ebackbay"
maxActive="4"/>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>META-INF/context.xml</WatchedResource>
</Context>
Posted by dion at March 22, 2005 04:19 PM | TrackBack
摘自 Raible Designs
Trim Spaces in your JSP's HTML Category: Java One of the annoying things about JSPs is all of the dynamic (non-rendered) parts of the page still produce line breaks. This means that if you do a view-source, you'll likely see large blocks of whitespace.
The good news is you can get rid of this whitespace if you're using Tomcat 5.5.x. Just locate the "jsp" servlet in $CATALINA_HOME/conf/web.xml and add the following <init-param>: <init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
I tested it and it works great. This begs the question - why isn't this on by default? Source: Struts Mailing List. 三月 23, 2005 10:24 下午 MST Permalink