Trimming output generated by JSP - Weblogic

This is a discussion on Trimming output generated by JSP - Weblogic ; Hi I have a problem with output generated by JSP. In place where I use taglib on JSP I have unnecessary space and new line characters. To solve this problem I decided to create a special Filter which will parse ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Trimming output generated by JSP

  1. Trimming output generated by JSP

    Hi

    I have a problem with output generated by JSP. In place where I use
    taglib on JSP I have unnecessary space and new line characters. To solve
    this problem I decided to create a special Filter which will parse the
    output stream and remove unnecessary characters.

    I would like to remove whitespaces to decrease the output page size. In
    my case pages generated by JSP with spaces are about 2-3 times bigger
    then pages without whitespaces.

    Does anyone had similar problem and found any elegant solution other
    then filter. The Filter works fine but I thing the output parsing isn’t
    very effective.

    I would be thankful for any help.
    Tom

  2. Re: Trimming output generated by JSP

    Hi

    I have a problem with output generated by JSP. In place where I use
    taglib on JSP I have unnecessary space and new line characters. To solve
    this problem I decided to create a special Filter which will parse the
    output stream and remove unnecessary characters.

    I would like to remove whitespaces to decrease the output page size. In
    my case pages generated by JSP with spaces are about 2-3 times bigger
    then pages without whitespaces.

    Does anyone had similar problem and found any elegant solution other
    then filter. The Filter works fine but I thing the output parsing isn’t
    very effective.

    I would be thankful for any help.
    Tom

  3. Re: Trimming output generated by JSP

    "Tomasz Pawlak" wrote in message news:41ff698a$1@mail...
    > I have a problem with output generated by JSP. In place where I use
    > taglib on JSP I have unnecessary space and new line characters. To solve
    > this problem I decided to create a special Filter which will parse the
    > output stream and remove unnecessary characters.


    Don't use a filter, you will be paying a performance penalty each time the
    page is accessed. Instead, write an ant task that strips the extra space
    from the JSP itself so that when it is compiled it will not contain any
    unneeded whitespace.

    Gerald



  4. Re: Trimming output generated by JSP


    > Don't use a filter, you will be paying a performance penalty each time the
    > page is accessed. Instead, write an ant task that strips the extra space
    > from the JSP itself so that when it is compiled it will not contain any
    > unneeded whitespace.
    >
    > Gerald


    Hi
    Many thanks for your suggestions Gerald.

    I didn’t write an ant task that strips the extra space from the JSP
    file. Instead I used ANT filterchain and few filters and it works great.

    Tom

+ Reply to Thread