In this paper the authors encrypt/decrypt and compress/decompress the data to be transmitted. The process is based on RSA algorithm. When data is being transmitted between two communicating parties, they need to ensure the security of the data. This paper primarily allows J2EE delayers to modify the existing or already deployed Java Servlets or Java Server Pages (JSPs), which are called as web components. This paper can modify the existing web components in such a way that they need not be disturbed, need not be re-compiled, and need not be re-deployed.