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

Discussion in 'Java' started by VisionSet, Aug 7, 2006.

  1. VisionSet

    VisionSet Guest

    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
     
    VisionSet, Aug 7, 2006
    #1
    1. Advertising

  2. VisionSet

    Andy Dingley Guest

    VisionSet wrote:

    > 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.
     
    Andy Dingley, Aug 7, 2006
    #2
    1. Advertising

  3. VisionSet wrote:
    > 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?


    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
     
    Andrea Desole, Aug 7, 2006
    #3
  4. VisionSet

    VisionSet Guest

    Andy Dingley wrote:
    > VisionSet wrote:
    >
    > > 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.


    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
     
    VisionSet, Aug 8, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sebastien
    Replies:
    1
    Views:
    572
    Michael Borgwardt
    Nov 7, 2003
  2. shruds
    Replies:
    1
    Views:
    962
    John C. Bollinger
    Jan 27, 2006
  3. VisionSet

    Mother of a Refactor

    VisionSet, Jul 31, 2006, in forum: Java
    Replies:
    11
    Views:
    638
    Luke Webber
    Aug 1, 2006
  4. johkar
    Replies:
    4
    Views:
    506
    johkar
    Mar 13, 2007
  5. Augustin Prasanna

    Code Refactor - Include Namespace in existing files

    Augustin Prasanna, Mar 22, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    319
    David Wier
    Mar 22, 2007
Loading...

Share This Page