Hi again,

We are going way too far if you ask me. Not only are we moving away from the
spec(or is it that the spec wasn't fully defined) but it seems that we are
coding around a software bug(Don't you just hate that !). Sure there is a
couple of ways to fix it and in my situation I choose to take the mime type
route(suggested by Micael) since I don't want to go and change a couple of
pages' includes to pure java file handling. But thanks for the suggestion,
August. It is always good to consider more than one solution, and take the
best one for the situation. In this case I don't want to worry about the
character encodings and changing the mime type is simpler to change IF the
problem is actually a bug.

The problem I have with coding around a potential bug is that you do things
the hard way and in future you'll probably keep coding around the bug just
because you're afraid it might not have been fixed. So I would rather fix a
bug than to consider multiple workarounds to a simple problem. The other
thing is that bugs don't only occur at the expected level but they usually
escalate to higher levels and you start encountering workarounds among
workarounds.

So I feel that if it is a bug it needs to be fixed, if not the spec needs to
be more clear. Whatever the action, like Jeff, I feel that the <%@ include
... %> and  <jsp:include ... /> should at least have the same restrictions
and act in the same way.

Cheers,
Jonathan

 

-----Original Message-----
From: August Detlefsen [mailto:[EMAIL PROTECTED]]
Sent: 11 December 2001 03:45
To: Tomcat Users List
Subject: Re: Unable to include *.sum files (Again)


Yes, it is absolutely going too far, but from my experience the include
directive has been quirky from the start (no matter what platform). 

Hence, I have utility methods to do just such a thing, and I have
encountered a myriad of other include methods and taglibs as well
-seems everyone is trying to reinvent the (slightly off-round) wheel in
this case. 

--- Jeff Kilbride <[EMAIL PROTECTED]> wrote:
> We're going an awfully long way here to solve what could be cleanly
> done
> with a simple:
> 
> <jsp:include page="relativeURL" flush="true" />
> 
> Don't you think? All the container has to do is default the MIME type
> for
> unknown extensions to "text/html". Remember this is a JSP -- a
> scripting
> language which was originally designed to simplify life for web
> designers
> and other non-programmers. Having to open every included file
> manually with
> java code defeats that purpose.
> 
> Thanks,
> --jeff
> 
> ----- Original Message -----
> From: "August Detlefsen" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Monday, December 10, 2001 1:21 PM
> Subject: RE: Unable to include *.sum files (Again)
> 
> 
> > What text format are your .sum files using? Sounds like it may be
> UTF8.
> > Try this:
> >
> >    /**
> >     * Returns the String contents of a UTF8 file.
> >     *
> >     * This method throws any fileIO errors.
> >     *
> >     * @param sFileName   Full file path.
> >     * @return String   The contents of the file as a String object.
> >     * @throws Exception   Any fileIO errors
> >     */
> >     public static String getUTF8FileAsString(String sFileName)
> throws
> > Exception {
> >         RandomAccessFile inputFile = new
> > RandomAccessFile(sFileName,"r");
> >         String output = inputFile.readUTF();
> >         inputFile.close();
> >         return output;
> >     }
> >
> >
> > This method should work if your files are in ASCII:
> >
> >    /**
> >     * Returns the String contents of an ASCII file.
> >     *
> >     * This method throws any fileIO errors.
> >     *
> >     * @param sFileName   Full file path.
> >     * @return String   The contents of the file as a String object.
> >     * @throws Exception   Any fileIO errors
> >     */
> >     public static String getFileAsString(String sFileName) throws
> > Exception {
> >         RandomAccessFile inputFile = new
> > RandomAccessFile(sFileName,"r");
> >         byte[] inputbytes = new byte[(int)inputFile.length()];
> >         int numread = inputFile.read(inputbytes);
> >         inputFile.close();
> >         return new String(inputbytes);
> >     }
> >
> >
> >
> > --- Micael Padraig Og mac Grene <[EMAIL PROTECTED]> wrote:
> > > At 08:14 AM 12/10/01 +0200, you wrote:
> > > >Hi all,
> > > >
> > > >Thanks for all the responses(including the debate) to this
> question!
> > > It made
> > > >some real interesting reading material after the SHORT weekend!
> To
> > > get back
> > > >to August's suggestion: we've tried it but our problem is that
> the
> > > file
> > > >content is generated by a VB program and
> > > >contains some funny characters e.g. "CPI" rather than "CPI".
> When we
> > > >translate these to a string it either comes out as ?CPI? or as
> > > illustrated
> > > >in the attached image(This is also how
> > > >it displays in JBuilder).
> > > >
> > > >Regarding the debate I tend to agree with Jeff. If you want to
> > > display the
> > > >pure contents of a file you should be able to include the file
> using
> > > ><jsp:include> without having to define a mime type. I mean what
> > > happens if
> > > >you want to include a "code" example, for example a code snippet
> > > that
> > > >illustrates how to code something in C,C++,Java etc. If you
> define
> > > the mime
> > > >type it will try to translate it, which is not what we want in
> this
> > > case...
> > > >You could define it as type text but now you need to maintain
> two
> > > mime types
> > > >for one extension? Just doesn't sound right to me. The other
> thing
> > > that
> > > >bothers me is the fact that it works for the <%@ include...%>
> > > directive but
> > > >not for the <jsp:include.../> surely they should perform similar
> > > actions
> > > >simply using a different syntax?
> > > >
> > > >Thanks again,
> > > >Jonathan
> > >
> > > I still don't see, Jonathan, why you don't just use code in your
> > > include
> > > which catches the mime types and deals with them?  Why is the
> include
> > >
> > > important to you in the first instance?  I think the people in
> this
> > > list
> > > might be able to help you, if we knew what the facets of the
> problem
> > > are.  This sounds like a problem that can be solved, but I am not
> > > sure what
> > > the situation is.
> > >
> > > Micael
> > >
> > >
> > > --
> > > To unsubscribe:  
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands:
> <mailto:[EMAIL PROTECTED]>
> > > Troubles with the list:
> <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send your FREE holiday greetings online!
> > http://greetings.yahoo.com
> >
> > --
> > To unsubscribe:  
> <mailto:[EMAIL PROTECTED]>
> > For additional commands:
> <mailto:[EMAIL PROTECTED]>
> > Troubles with the list:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>



Disclaimer and Confidentiality Note.

Everything in this e-mail and attachments relating to the
official business of Standard Bank Investment Corporation(Stanbic)
is proprietary to the company. It is confidential, legally privileged
and protected by law. Stanbic does not own and endorse
any other content. Views and opinions are those of the
sender unless clearly stated as being that of Stanbic.

The person addressed in the e-mail is the sole authorised recipient.
Please notify the sender immediately if it has unintentionally reached
you and do not read, disclose or use the content in any way.

Stanbic can not assure that the integrity of this communication has been
maintained nor that it is free of errors, virus, interception or interference.






--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to