a major roadblock to using any of the server-side scripting architectures for developing commercial software is the fact that (traditionally) the source code must be delivered to customers when deploying applications.
java source code is compiled into an intermediate code called bytecode, and the java virtual machine (jvm) interprets this bytecode directly. its the bytecode that makes java class files completely platform-independent. not only is the bytecode easy to decompile, but the descriptive variable names are included in it (and thus in the decompiled source code), making it much easier to understand the decompiled source code. this presents another formidable roadblock to deploying commercial java-based software.
this article outlines a technique to protect jsp-based applications in such a way that they can be deployed to customers without giving away source code or class files that are easy to decompile. this technique employs features of the java 2 platform, enterprise edition (j2ee) web application specification and a bytecode protection technology called obfuscation. a detailed example is provided that enables you to better understand the issues and the solution.
javaserver pages (jsp) provide a rapid development and deployment analog to active server pages (asp) with a few significant advantages. servlet source code is generated from the .jsp files in the form of .java files. these are then compiled into standard servlet .class files.
these servlet classes are loaded into a server (referred to as a container in java nomenclature). the container routes jsp requests to the corresponding class. with asp, the source code is actively interpreted at the server and the response is sent back to the client. with jsp, the java bytecode is preloaded into the container, making responses to requests highly efficient.
web application architecture
the web application specification ( java.sun.com/products/servlet/2.2/index.html" target="new"> http://java.sun.com/products/servlet/2.2/index.html, section 9) allows jsp applications to run on any platform and in any vendors j2ee-compliant container. it specifies a standard directory structure to hold static content (e.g., html pages and images), jsps, servlets, and supporting java classes. in addition, it defines a deployment descripto... 下一页