• 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

Struts2 Extending the FilterDispatcher

 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Will it be a good practice to extend the Struts Fraewroks FilterDispatcher ?

I am trying to use Hibernate with Struts .Will it be a good pratice if i extend the FilterDispacther for calling Hibernate Utility classes ??

Anyone any views i want to discuss the Pros and cons with this approach.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is absolutely no reason to extend the dispatcher to do anything with Hibernate; this kind of thing is precisely what interceptors are for.

I'm assuming you're taking about creating an open-session-in-view-/OPSiV-style solution. Whether or not this is always the best solution is debatable; naive usage can lead to unexpected loss of performance in JSP pages due to lazy initialization.

Personally, I've switched over to using Spring's transaction support (there are similar solutions besides Spring) and have found it pretty handy. I also tend to initialize only the data I know will be used in the JSP to avoid the aforementioned performance hits, but part of that is due to some of the complicated data structures I've worked with lately and their expensive SQL queries.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

Now thinking to learn spring for this integration purpose.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic