Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Refactoring old tags: Tag Files (re: mother of a refactor)

Thread view: 
VisionSet - 07 Aug 2006 10:24 GMT
We have a poor tag solution for our content management system that
relies on html coments used as tags in a plain html file.
This file is parsed out by a *jsp* page line by line as a fileStream.
Each tag is replaced by laborious String library funcionality indexOf
etc.
So you get horrible scriplet syntax where content is all quoted in
String declarations.
Obviously content such as this is best presented as free format html or
jsp.
My idea towards improvement is to use tag libraries - I think called
Tag Files?  I can replace the old html comment tags with jsp custom
tags to specifically solve the ugly parseing we have at the moment.
Does this sound like the right approach as one step in my Mother of a
Refactor?

--
Mike W
Andy Dingley - 07 Aug 2006 16:42 GMT
> We have a poor tag solution for our content management system that
> relies on html coments used as tags in a plain html file.

> My idea towards improvement is to use tag libraries

Sounds good.

> Does this sound like the right approach as one step in my Mother of a
> Refactor?

One step - certainly very good.

However the first step in _refactoring_ is always the same. Set up an
automated test environment so that you can verify your "refactorings"
aren't changing anything. If you don't do this first, then you might be
"reworking" the code, but you aren't refactoring it in a controlled
manner.
VisionSet - 08 Aug 2006 09:28 GMT
> > We have a poor tag solution for our content management system that
> > relies on html coments used as tags in a plain html file.
[quoted text clipped - 13 lines]
> "reworking" the code, but you aren't refactoring it in a controlled
> manner.

Yes we are doing that, but that is a known.
I wnat to be thinking a step ahead.

The template file we have at present is not a jsp.  It is just a source
of parseing.
A JSP parses this template file.  Now I want to replace 1 tag at a
time.  So that the file continues to work on the old system, being
parsed but also acts as a JSP page in that the new custom tags are
handled by the container. How can I do that?

TIA,
Mike W
Andrea Desole - 07 Aug 2006 17:09 GMT
> We have a poor tag solution for our content management system that
> relies on html coments used as tags in a plain html file.
[quoted text clipped - 10 lines]
> Does this sound like the right approach as one step in my Mother of a
> Refactor?

It's not completely clear, but yes, I would say so.
What you should also consider is that maybe it's possible to do
everything just with the regular tags. With JSTL it's also possible to
do an XSLT transform (although I have never tried it). For what I
understand your situation is, maybe it's a good option


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.