Hikari
Hikari

Reputation: 3947

Creating a Servlet+JSP framework and consuming it in other projects

I wanna develop a small Framework to help us on reusability. It will have some Java components to handle Permissions, DAO, Logging, etc, and some Servlet components for handling Authentication, request parameters, etc. And also JSPs with HTML snippets, header, footer, CSS, JS, etc etc.

What I can't find out, is how to deploy this Framework as a jar lib, to be consumed by other applications. Where should WebContent, JSP, etc should be, and how to export it in Eclipse.

Upvotes: 0

Views: 597

Answers (1)

BalusC
BalusC

Reputation: 1109532

Where should WebContent, JSP, etc should be

In /META-INF/resources folder of the Java source folder. Just create one if it doesn't already exist.


and how to export it in Eclipse

Just as JAR into /WEB-INF/lib of a web project. You can let Eclipse automatically do that by specifying the shared project in Deployment Assembly of the dynamic web project.

You can also create the shared project from the beginning on as Web Fragment Project. It'll prepare the folder structure for you and automatically be added as Deployment Assembly of an existing project.

See also:

Upvotes: 2

Related Questions