How did you create the war file?
If you are using ant, you can opt to exclude the java files.
You want to exclude your jsp files as well? Are you sure?
Hi .. you can create a WAR file using the JAR utility available. The only pre requisite is that you need to prepare a proper deployment folder structure and a proper deployment descriptor.
The command is as follows - " jar -cvf MyWarFileName.war".
Execute this command from the command line after going to the appropriate folder.
Whether there is way to only include .class files?
Well , whatever you keep in the folder on which you are running the JAR utility , will be included in the WAR file.
For e.g. The normal folder structure will be like below.
Place the package structure in the classes folder. And the Deployment Descriptor directly under the WEB-INF folder.
Thanks
[BPS: Added to code tags to dir tree to show indents.]