Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Important classes in Struts?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
About from the Action and the DispatchAction classes is there any other class which one can extend?

Thanks in advance.

Mathew
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is also common to extend ActionForm.

Technically, though, you can extend any class in Struts that isn't declared as final. Struts is open-source, so you can look at the source and extend classes as needed. ActionServlet, RequestProcessor, ActionMapping, etc. can all be extended. I wouldn't recommend doing so, however, unless you're doing something that just doesn't fit into the way Struts works by default.
 
Mathew Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merril for your reply.I think I missed out the LookUpDispatch class too.

Thanks again
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DispatchAction and LookupDispatchAction both extend Action. you can extend pretty much everything like what merrill said, but consider first the reason(s) for extension.

i generally stay way from the core classes. consider using servlet filters to do generic pre-processing (e.g authentication) and post-processings (e.g applying xslt). there are properties of the struts controller that are configurable, but unknown and lead to unecessary extension (e.g setting nocache).

it is a good idea though to extend the Action classes since you can move common action codes such as the forwarding and error processings into 1 place. action form is another, but declarative form bean definitions cannot be extended (unless you customize the ActionServlet
 
This tiny ad is wafer thin:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic