Currently, I have an application which use JSP for the view and it has got some tags which handle the various parts of the view. As and when the UI requirements are changing, it is beoming more and more difficult to maintain the tags. Is there a better way by which the UI portion can be detatched from the tags? Thanks -Manoj Pooleery.
If the tags are getting in your way rather than helping, one or more of the following are true: 1) The nature of your views are innapproiate for tag usage (rare) 2) Your tags aren't good abstractions of view components/functions 3) Your tags are poorly designed/written What about the tags is difficult to maintain? Are changes to the UI forcing lots of JSP page changes? if so, #2 may be true. Is it the tag handler code that's a mess? If so, perhaps #3 is the culprit. Tags should be making your pages easier to maintain, not harder. bear
Manoj: I agree with Bear, if your tags are causing you more problems, then chances are that they aren't designed well. They probably contain business logic, which is why when your UI requirements are changing; the business logic is also changing. Try thinking of the tags as a way to help with presentation logic, not business logic. Business logic is better in a Bean or Action class. Sue [ October 02, 2003: Message edited by: Sue Spielman ]
Since JSPs are typically used in Presentation Tier, the partner of JSP, tags, should be used for presentation tier... Business processing logics and services should be in Business Tier. If Tags are involved in business tier, it might make your app mess...
Sue, Bear and Ko, I agree to the fact that the presentation layer shouldn't be burdened with business logic. Let me explain the situation a little further - 70% of the application's UI is being handled by a single JSP. The app architecture is based on the MVC pattern. The view beans construct an XML document and pass it on to the JSP. The JSP then parses the XML document and displays the data. The pages have the following structure - - A header - sub header - a list of buttons (for actions that can be taken on the data) - data in the form of a table (the table has a header which allows for sorting, filtering of the data etc) - a footer which has controls for navigating between pages, changing the no of records that can be shown in a table etc. Now, all of it started off as a simple JSP, which over time, as and when the application grew, grew in complexity as well. More and more logic was added and we took out each section and made them into tags. Now, we have a skeletal JSP with tags in them which handles each of the parts' display. The problem is, when a portion of the UI requires changing, we have to go and change the tags, which I feel is not quite a good way to do things. I feel that the UI changes should be easy to make. Is there any way by which I can decouple the UI aspect from the tags? Can JSTL be used in a similar way? Is there any framework that anybody has used for the same? Thanks -Manoj.