2013-03-18

I have a problem.

I just got a web-application to develop and maintain, what I've got is a:

Java server code, running on Tomcat 6 (switching to something other and even upgrading to Tomcat 7 is not an option)

Jackson services to provide the data to AJAX

Hibernate, wrapped by JPA 2. All the DB-related code uses JPA EntityManager only, nothing is Hibernate-specific (except some auditing done with Hibernate Envers)

Client-side code is in JSPs (no servlets, pure JSP code). The only features used are include tags for a few static elements (header, footer).

jQuery, a lot of AJAX requests.

Bootstrap for CSS.

Urlrewrite filter - so page extensions don't matter at all.

I'm quite new to all of the web-dev stuff (coming from Java SE), but there are some things I don't like at all:

Getting/closing EntityManager for each call, manually managing transactions. That's a lot of boilerplate code.

No way to extract something like widgets in the client code. What I mean is that there's no way for me to use a single implementation of, say, list with a filter as it includes HTML code, CSS and JS and it seems ugly to just include JS code in JSPF.

I think, what I need is some framework/approach/technique to deal with all of that. I have a strong feeling that the way my application lives now is like 10 years old (not taking AJAX into account) and there are better ways of doing this.

The other problem is that the system is already in production, so I can't dedicate a lot of time to refactoring - all the changes should be small and independent, taking less than a day each. For instance, migrating to GWT is not an option for this exact reason.

Any advice? What stuff should I dig into?

Thanks in advance!

Show more