Struts2 Tag and Packages

Struts2 Tag and Packages

These days, I am considering to change our web project. What I am planning to do is reduce the size of our war package.
I want to make it smaller, so I need to move all the jar packages under WEB-INF/lib to WEB server classpath directory.

The related jar files are
struts2-core-2.1.8.1.jar
struts2-tiles-plugin-2.1.8.1.jar
xwork-core-2.1.6.jar

I put them to JBOSS_HOME/server/default/lib. But we used struts2 tag in our jsp file. So I need to copy the tag file.
I copy file struts-tags.tld from struts2-core-2.1.8.1.jar/META-INF/struts-tags.tld to WEB-INF/struts-tags.tld.

And what else?

I make some changes to web.xml as follow:
<jsp-config> 
<taglib> 
<taglib-uri>/struts-tags</taglib-uri> 
<taglib-location>/WEB-INF/struts-tags.tld</taglib-location> 
</taglib> 
</jsp-config>

That is it. Enjoy it to have your war package less than 200 kB, because I move all the jar files and images out of my war.

你可能感兴趣的:(struts2,tag,packages)