• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Good ways for JSP + tags

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic