Abstract:To deal with the deficiency of modularization and dynamics, this paper proposes an architecture for web application based on OSGi, combined with the popular technologies of web application, such as servlets, JSPs, static documents and request handling, including the technique of integrating web application with OSGi, the change of structure and loading of application. Then it illustrates how to modularize and register web application components including servlets, filters and listeners, how to register, find and compile JSPs, how to register and find static documents. Finally, it discusses the process of dispatching and handling requests. With the architecture, besides continuing to use the existing technologies and frameworks, web application can also have the characteristics of modularization and dynamics.