I am a third-party developer, and I am in a lot of layered form of jsp and I see quite a lot of solutions for entering data (models) into the view. I recently came across a taglib solution that retrieves data in jsp, which seems more natural and reasonable to me.
Problem first
Given one page and treating it as a separate entity, MVC makes an absolute sense, however one page can be quite complex and most likely reuses the components / services that are used on other pages. As a result, the controller also becomes quite complex.
In my experience, the page is volatile, because customers like to shift functionality around or turn the entire site inside out with the next “redesign”. This usually leads to a rather tedious refactoring project, where literally EVERYTHING needs to be rewritten.
Then there is the problem of consistency, on one page the data set is placed in the ModelView as a "list", and on the other page where the "list" can be abstract, it is placed in the ModelView as a "specificList". Maintaining coherence during the project life cycle becomes a tedious worldly task and is usually avoided, but this is exactly what happens with a clean MVC solution.
Decision
So, in a recent project that I inherited, I saw two solutions that retrieve data in a pageView. The first rather ugly use of jsp: include is to invoke the jsp page and burn another controller.
Secondly, I found it pretty elegant, they used taglib to pull specific datasets into the pageView. Taglib was documented inside the TLD, and it was nice to use it. Suddenly, I could reuse data on multiple pages without messing with controllers.
So, in this project I had to implement a “redesign”, and all the data pushing solutions made my work a lot easier, however, at the points where they used data injection (MVC), it was a pain in the ass (I'm not a java developer ) and java developers to help where they are few.
, taglibs, , , (MVC) , ( jsp).
Taglib
, services.tld / .
- getEmployeeAddress
- getEmployees
<services:getEmployees filter="a">
</services:getEmployees>
() , java-dev . pageView, pageView (, , ), ( , ) .
:
1.) , , ? = P
2.) ? ( , ).
3.) taglib ?
4.) // taglib Java-dev?
, MVC Java-, (sofar) jsp, API ... , , , , Ajax shizzle, , , - ...