• 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

JSP Subclassing

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I'm involved in a project which requires the production of HTML XML and WML from a JSP dependant on the client type. As the java code between the mark up languages will often be common we were thinking of introducing a Superclass between JSPBase or HTTPServlet and the 3 JSPs we will require for each type. This will allow each JSP to invoke inherited methods on the SuperClass rather than rewriting the same code. Is this the best way to do it? Also is a WAP JSP/Servlet on its way rather than going via a WAP gateway to translate to HTTP. TIA Graham
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I maybe wrong, but I will say it anyways....
From what I have read, this is precisely the type
of applications that use XSL/XSLT. Have the content
in XML format. Use an appropriate style-sheet depending
on the client. Convert the output of the transform to HTML,
by setting the appropriate processing instructions.
This way you have ONLY ONE place you have
to maintain your content, as opposed to three
places/sub-classes in the method you mentioned.
Again, you probably have your reasons why to want to go
one way or the other. My knowledge is theoritical, anyways.
Thanks for listening.
regds.
- satya
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic