• Post Reply Bookmark Topic Watch Topic
  • New Topic

Good ways for JSP + tags  RSS feed

 
Manoj Pooleery
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sue Spielman
Author
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Manoj Pooleery
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!