0

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.

Hikari
  • 3,797
  • 12
  • 47
  • 77
  • 1
    That's a lot of concerns that you're describing. Are you sure that you wouldn't be better off using something like Spring and Hibernate? – Vivin Paliath Mar 21 '13 at 22:10
  • lol I hate Hibernate, it only makes things complex with no need, DAO does it much better! – Hikari Mar 23 '13 at 02:39
  • These are all recurring features we use on all projects. They are simple, no need a more complex solution for them. I just don't like having to copy and adapt coupled code from a project to another, I want these components to be reusable. JSP template for example, we have our own template. – Hikari Mar 23 '13 at 02:41

1 Answers1

2

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:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Interesting, I'm gonna try that! So, I can create a dynamic web project, add Servlets and JSP to it, and export it as JAR and add it to another dynamic web project, and consume these Servlets and JSPs? – Hikari Mar 23 '13 at 02:51