Re: xhtml and Internet Explorer
I opened an enhancement request for this issue at: http://issues.apache.org/bugzilla/show_bug.cgi?id=24506 Cheers, Marius Marius Scurtescu wrote: Hi, Yes, I totally agree that this issue should be brought up with the JSP specification. I will look into that. Even if the suggestion is accepted it will be quite a while until a specification will deal with this issue and then even longer until there is going to be a Tomcat implementation supporting it. We are talking years I guess :-( For what I know the specification is not saying anything about this issue and if Tomcat is implementing it right now it will not go against the spec. Keeping strictly with the JSP directives (the issue can be extended to the JSP tags as well, but it gets more complicated) common sense is enough, I hope, to realize that whenever you add a directive you really don't want an empty line in your output. These empty lines are annoying at best (every time you check the source of a page generated by JSP you first see an empty page - quite stupid), and breaking your app at worst (like in the case of IE). The absolute best proof that there is a problem here that needs fixing is the fact that developers make their code unreadable just as a work around. Cheers, Marius Rodrigo Ruiz wrote: Marius, I think such a feature request should not be addressed to Tomcat, but to the JSP specification itself. Remember that Tomcat is being used as the reference implementation of servlet/JSP technologies, and so it should stick to the specification. Basically, as I see it, your request means a special treatment for a subset of directives in a few specific cases. I think it would imply that tags could be marked as not generating any output, so when in a single JSP line there were only such marked tags and leading / trailing spaces among them, the line itself could be omited from the output. Such a change should be made from the specification. Regards, Rodrigo Marius Scurtescu wrote: JSP is a templating language which is using a meta language: the JSP constructs. The new line is in the JSP indeed, but is it part of the meta language or part of the literal output? I would argue that these new lines are part of the meta language and that they should not be output. You put them there so the meta language you use is readable. See how FreeMarker, another templating language, is dealing with this issue: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping You are not asking the directive to scan anything, the page compiler could consider white space and newlines after a directive as part of that directive. Marius Adam Hardy wrote: On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
On 11/07/2003 06:48 PM Marius Scurtescu wrote: I opened an enhancement request for this issue at: http://issues.apache.org/bugzilla/show_bug.cgi?id=24506 Well formulated description! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Well, not necessarily unreadable, just different ;-) I usually play with the tag delimiters to allow some readability. For example, my JSPs usually begin with something like: [EMAIL PROTECTED] contentType=... import=... import=... errorPage=... %%! // class code %% // service code %!DOCTYPE ... ... And if I need to place two directives with no spaces in between, I write jsp:useBean id=data scope=request class=my.Data /jsp:getProperty name=data property=aField / It is not as clean as a directive per line, but at least it doesn't hurt too much :-P Regards, Rodrigo Marius Scurtescu wrote: Hi, Yes, I totally agree that this issue should be brought up with the JSP specification. I will look into that. Even if the suggestion is accepted it will be quite a while until a specification will deal with this issue and then even longer until there is going to be a Tomcat implementation supporting it. We are talking years I guess :-( For what I know the specification is not saying anything about this issue and if Tomcat is implementing it right now it will not go against the spec. Keeping strictly with the JSP directives (the issue can be extended to the JSP tags as well, but it gets more complicated) common sense is enough, I hope, to realize that whenever you add a directive you really don't want an empty line in your output. These empty lines are annoying at best (every time you check the source of a page generated by JSP you first see an empty page - quite stupid), and breaking your app at worst (like in the case of IE). The absolute best proof that there is a problem here that needs fixing is the fact that developers make their code unreadable just as a work around. Cheers, Marius Rodrigo Ruiz wrote: Marius, I think such a feature request should not be addressed to Tomcat, but to the JSP specification itself. Remember that Tomcat is being used as the reference implementation of servlet/JSP technologies, and so it should stick to the specification. Basically, as I see it, your request means a special treatment for a subset of directives in a few specific cases. I think it would imply that tags could be marked as not generating any output, so when in a single JSP line there were only such marked tags and leading / trailing spaces among them, the line itself could be omited from the output. Such a change should be made from the specification. Regards, Rodrigo Marius Scurtescu wrote: JSP is a templating language which is using a meta language: the JSP constructs. The new line is in the JSP indeed, but is it part of the meta language or part of the literal output? I would argue that these new lines are part of the meta language and that they should not be output. You put them there so the meta language you use is readable. See how FreeMarker, another templating language, is dealing with this issue: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping You are not asking the directive to scan anything, the page compiler could consider white space and newlines after a directive as part of that directive. Marius Adam Hardy wrote: On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Hi, Yes, I totally agree that this issue should be brought up with the JSP specification. I will look into that. Even if the suggestion is accepted it will be quite a while until a specification will deal with this issue and then even longer until there is going to be a Tomcat implementation supporting it. We are talking years I guess :-( For what I know the specification is not saying anything about this issue and if Tomcat is implementing it right now it will not go against the spec. Keeping strictly with the JSP directives (the issue can be extended to the JSP tags as well, but it gets more complicated) common sense is enough, I hope, to realize that whenever you add a directive you really don't want an empty line in your output. These empty lines are annoying at best (every time you check the source of a page generated by JSP you first see an empty page - quite stupid), and breaking your app at worst (like in the case of IE). The absolute best proof that there is a problem here that needs fixing is the fact that developers make their code unreadable just as a work around. Cheers, Marius Rodrigo Ruiz wrote: Marius, I think such a feature request should not be addressed to Tomcat, but to the JSP specification itself. Remember that Tomcat is being used as the reference implementation of servlet/JSP technologies, and so it should stick to the specification. Basically, as I see it, your request means a special treatment for a subset of directives in a few specific cases. I think it would imply that tags could be marked as not generating any output, so when in a single JSP line there were only such marked tags and leading / trailing spaces among them, the line itself could be omited from the output. Such a change should be made from the specification. Regards, Rodrigo Marius Scurtescu wrote: JSP is a templating language which is using a meta language: the JSP constructs. The new line is in the JSP indeed, but is it part of the meta language or part of the literal output? I would argue that these new lines are part of the meta language and that they should not be output. You put them there so the meta language you use is readable. See how FreeMarker, another templating language, is dealing with this issue: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping You are not asking the directive to scan anything, the page compiler could consider white space and newlines after a directive as part of that directive. Marius Adam Hardy wrote: On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Marius, I think such a feature request should not be addressed to Tomcat, but to the JSP specification itself. Remember that Tomcat is being used as the reference implementation of servlet/JSP technologies, and so it should stick to the specification. Basically, as I see it, your request means a special treatment for a subset of directives in a few specific cases. I think it would imply that tags could be marked as not generating any output, so when in a single JSP line there were only such marked tags and leading / trailing spaces among them, the line itself could be omited from the output. Such a change should be made from the specification. Regards, Rodrigo Marius Scurtescu wrote: JSP is a templating language which is using a meta language: the JSP constructs. The new line is in the JSP indeed, but is it part of the meta language or part of the literal output? I would argue that these new lines are part of the meta language and that they should not be output. You put them there so the meta language you use is readable. See how FreeMarker, another templating language, is dealing with this issue: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping You are not asking the directive to scan anything, the page compiler could consider white space and newlines after a directive as part of that directive. Marius Adam Hardy wrote: On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
On 10/30/2003 12:24 AM Marius Scurtescu wrote: Hi, I am using Tomcat 4.0.5 with JBoss 3.0.3 under Win2K and I am trying to generate XHTML pages with JSP. Everything is fine with Mozilla, but IE keeps showing the pages as raw XML. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. I checked the headers sent by the server (using LiveHTTPHeaders in Mozilla) and everything seems to be OK. The content type is text/html; charset=UTF-8 Hi Marius, what is LiveHTTPHeaders in Mozilla? I use Mozilla but I don't know that. Thanks Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
That's because IE ignores the Content-Type header and just looks at the first few bytes of the file to decide how to display it. What a POS. Anyway... (Christopher Schultz) IE works like this: in the first call to a web page, it checks the Content-Type and displays the web page accordingly. Next time you request the same page, it ignores the Content-Type. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. (Marius Scurtescu) So, do the following: 1. You have to make sure IE is foing to display the most recent page. You can do this by either adding a pragma/no-cache header, or go to (in IE): tools/internet options/temporary internet files/settings and, under check for newer versions of stored pages, select the every visit to the page option. When you are developing, this last thing should ALWAYS be done. Otherwise, you might be getting IE cached versions of the web page and asking yourself why the changes aren't working. 2. Force IE to read the Content-Type again. Simply shut down the browser, and request your xhtml page to see if it works. Hope that helps. Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
LiveHTTPHeaders is a very cool plug-in for Mozilla. It captures HTTP request/response headers. It's like having a RequestDumperValve in your browser ;) http://livehttpheaders.mozdev.org/ Adam Hardy wrote: On 10/30/2003 12:24 AM Marius Scurtescu wrote: Hi, I am using Tomcat 4.0.5 with JBoss 3.0.3 under Win2K and I am trying to generate XHTML pages with JSP. Everything is fine with Mozilla, but IE keeps showing the pages as raw XML. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. I checked the headers sent by the server (using LiveHTTPHeaders in Mozilla) and everything seems to be OK. The content type is text/html; charset=UTF-8 Hi Marius, what is LiveHTTPHeaders in Mozilla? I use Mozilla but I don't know that. Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(OT) LiveHTTPHeaders (was Re: xhtml and Internet Explorer)
Jon, LiveHTTPHeaders is a very cool plug-in for Mozilla. It captures HTTP request/response headers. It's like having a RequestDumperValve in your browser ;) http://livehttpheaders.mozdev.org/ Okay, this is one of the coolest (and simple) tools I've ever seen. Thanks for pointing it out to us! -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Thanks for all the replies. I did solve the mystery. IE is indeed a POS. It looks like it completely ignores the Content-Type headers and it just scans the beginning of the file. The JSPs I was struggling with are using lots of JSP directives (tag lib and page), includes and tiles. The result was that there were many empty lines after the DOCTYPE declaration and the html tag. IE seems to be scanning for the html tag (don't ask why) and if it does not find it soon enough then it gives up and treats the file as raw XML. Pretty smart. I attached a test file which on my system is treated as raw XML. If I delete on single empty line before the html tag then it is treated as XHTML. Now this is sort of a show stopper for me, unless I find a way to reduce the empty lines a the top of a file. Is there a way in Tomcat to prevent the creation of an empty line for each JSP directive? I cannot move the html tag on top since it is generated in a layout file and imported through tiles. A few more observation regarding IE. It seems that one it guessed the type of a page it is caching that info in memory. Deleting temporary files and forcing a check on every visit does not help. You have to close the browser in order to flush this cache. Loading pages from the file system has a completely different logic, it is based on the file extension (there is no scanning for html tag). Thanks again, Marius Carlos Pereira wrote: That's because IE ignores the Content-Type header and just looks at the first few bytes of the file to decide how to display it. What a POS. Anyway... (Christopher Schultz) IE works like this: in the first call to a web page, it checks the Content-Type and displays the web page accordingly. Next time you request the same page, it ignores the Content-Type. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. (Marius Scurtescu) So, do the following: 1. You have to make sure IE is foing to display the most recent page. You can do this by either adding a pragma/no-cache header, or go to (in IE): tools/internet options/temporary internet files/settings and, under check for newer versions of stored pages, select the every visit to the page option. When you are developing, this last thing should ALWAYS be done. Otherwise, you might be getting IE cached versions of the web page and asking yourself why the changes aren't working. 2. Force IE to read the Content-Type again. Simply shut down the browser, and request your xhtml page to see if it works. Hope that helps. Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Put all the tag and page directives on one line. Looks horrible in the source but if it works... The alternative is to write a filter which wraps the response and strips off the empty lines at the beginning as they are written to the outputstream. We've implemented this and it works quite nicely. We restrict it to text/* content-types ;) The only downer is the additional broken pipe IOExceptions that we now log when someone hits stop in their browser. :( Jon Marius Scurtescu wrote: Thanks for all the replies. I did solve the mystery. IE is indeed a POS. It looks like it completely ignores the Content-Type headers and it just scans the beginning of the file. The JSPs I was struggling with are using lots of JSP directives (tag lib and page), includes and tiles. The result was that there were many empty lines after the DOCTYPE declaration and the html tag. IE seems to be scanning for the html tag (don't ask why) and if it does not find it soon enough then it gives up and treats the file as raw XML. Pretty smart. I attached a test file which on my system is treated as raw XML. If I delete on single empty line before the html tag then it is treated as XHTML. Now this is sort of a show stopper for me, unless I find a way to reduce the empty lines a the top of a file. Is there a way in Tomcat to prevent the creation of an empty line for each JSP directive? I cannot move the html tag on top since it is generated in a layout file and imported through tiles. A few more observation regarding IE. It seems that one it guessed the type of a page it is caching that info in memory. Deleting temporary files and forcing a check on every visit does not help. You have to close the browser in order to flush this cache. Loading pages from the file system has a completely different logic, it is based on the file extension (there is no scanning for html tag). Thanks again, Marius Carlos Pereira wrote: That's because IE ignores the Content-Type header and just looks at the first few bytes of the file to decide how to display it. What a POS. Anyway... (Christopher Schultz) IE works like this: in the first call to a web page, it checks the Content-Type and displays the web page accordingly. Next time you request the same page, it ignores the Content-Type. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. (Marius Scurtescu) So, do the following: 1. You have to make sure IE is foing to display the most recent page. You can do this by either adding a pragma/no-cache header, or go to (in IE): tools/internet options/temporary internet files/settings and, under check for newer versions of stored pages, select the every visit to the page option. When you are developing, this last thing should ALWAYS be done. Otherwise, you might be getting IE cached versions of the web page and asking yourself why the changes aren't working. 2. Force IE to read the Content-Type again. Simply shut down the browser, and request your xhtml page to see if it works. Hope that helps. Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Marius, Thanks for all the replies. I did solve the mystery. IE is indeed a POS. I told you :) IE seems to be scanning for the html tag (don't ask why) and if it does not find it soon enough then it gives up and treats the file as raw XML. Pretty smart. Now this is sort of a show stopper for me, unless I find a way to reduce the empty lines a the top of a file. Is there a way in Tomcat to prevent the If you have multiple JSP directives at the tops of your pages, consider putting them onto the same line. For example: [EMAIL PROTECTED] import=... % [EMAIL PROTECTED] language=Java % jsp:include page=foo.jsp / jsp:include page=bar.jsp / jsp:include page=baz.jsp / Maybe change this to: [EMAIL PROTECTED] import=... %[EMAIL PROTECTED] language=Java %jsp:include page=foo.jsp /jsp:include page=bar.jsp /jsp:include page=baz.jsp / Also note that all of your [EMAIL PROTECTED] ... % directives can be put together into one directive, which uses less space. Tomcat really can't be blamed, because you are putting the newlines into the JSP file yourself. The only thing I can think of would be to have Tomcat ignore trailing whitespace on JSP source lines that nothing but a JSP directive or something like jsp:include... You other option might be to create a filter that collapsed multiple consecutive newlines into a single one. This might break some of your page, though. A few more observation regarding IE. It seems that once it guessed the type of a page it is caching that info in memory. Even better! What version of IE are you using, BTW? I'm wondering if they've finally fixed this in IE 6.0. I still use 5.5 when I view a site that's so broken in Mozilla that I can't make sense of it (which makes me pretty much furious). -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Marius Scurtescu wrote: Thanks for all the replies. I did solve the mystery. IE is indeed a POS. It looks like it completely ignores the Content-Type headers and it just scans the beginning of the file. You know what's great about that? It's not a bug, it's a feature. http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/moniker/overview/appendix_a.asp Internet Explorer BY DESIGN ignores the content-type and decides for itself what to do with the file. Their reasoning? this type of behavior is necessary to identify a .gif file being sent as text/html *shakes head* Good luck with the newline issue; sorry I don't have any advice to offer :) Bean The JSPs I was struggling with are using lots of JSP directives (tag lib and page), includes and tiles. The result was that there were many empty lines after the DOCTYPE declaration and the html tag. IE seems to be scanning for the html tag (don't ask why) and if it does not find it soon enough then it gives up and treats the file as raw XML. Pretty smart. I attached a test file which on my system is treated as raw XML. If I delete on single empty line before the html tag then it is treated as XHTML. Now this is sort of a show stopper for me, unless I find a way to reduce the empty lines a the top of a file. Is there a way in Tomcat to prevent the creation of an empty line for each JSP directive? I cannot move the html tag on top since it is generated in a layout file and imported through tiles. A few more observation regarding IE. It seems that one it guessed the type of a page it is caching that info in memory. Deleting temporary files and forcing a check on every visit does not help. You have to close the browser in order to flush this cache. Loading pages from the file system has a completely different logic, it is based on the file extension (there is no scanning for html tag). Thanks again, Marius Carlos Pereira wrote: That's because IE ignores the Content-Type header and just looks at the first few bytes of the file to decide how to display it. What a POS. Anyway... (Christopher Schultz) IE works like this: in the first call to a web page, it checks the Content-Type and displays the web page accordingly. Next time you request the same page, it ignores the Content-Type. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. (Marius Scurtescu) So, do the following: 1. You have to make sure IE is foing to display the most recent page. You can do this by either adding a pragma/no-cache header, or go to (in IE): tools/internet options/temporary internet files/settings and, under check for newer versions of stored pages, select the every visit to the page option. When you are developing, this last thing should ALWAYS be done. Otherwise, you might be getting IE cached versions of the web page and asking yourself why the changes aren't working. 2. Force IE to read the Content-Type again. Simply shut down the browser, and request your xhtml page to see if it works. Hope that helps. Carlos Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
I will consider implementing a filter to remove the empty lines before the html tag. For now I eliminated most of the empty lines by changing: [EMAIL PROTECTED] import=... % [EMAIL PROTECTED] language=Java % jsp:include page=foo.jsp / jsp:include page=bar.jsp / jsp:include page=baz.jsp / to: [EMAIL PROTECTED] import=... language=Java %jsp:include page=foo.jsp /jsp:include page=bar.jsp /jsp:include page=baz.jsp / Ugly, but at least there is one directive per page. It would be great if the JSP compiler would not output new lines for lines containing only JSP directives. I will fill a feature request for this. I am using IE 6 SP1, so this issue is still not fixed. Microsfot may not even be aware of it. Thanks, Marius Christopher Schultz wrote: Marius, Thanks for all the replies. I did solve the mystery. IE is indeed a POS. I told you :) IE seems to be scanning for the html tag (don't ask why) and if it does not find it soon enough then it gives up and treats the file as raw XML. Pretty smart. Now this is sort of a show stopper for me, unless I find a way to reduce the empty lines a the top of a file. Is there a way in Tomcat to prevent the If you have multiple JSP directives at the tops of your pages, consider putting them onto the same line. For example: [EMAIL PROTECTED] import=... % [EMAIL PROTECTED] language=Java % jsp:include page=foo.jsp / jsp:include page=bar.jsp / jsp:include page=baz.jsp / Maybe change this to: [EMAIL PROTECTED] import=... %[EMAIL PROTECTED] language=Java %jsp:include page=foo.jsp /jsp:include page=bar.jsp /jsp:include page=baz.jsp / Also note that all of your [EMAIL PROTECTED] ... % directives can be put together into one directive, which uses less space. Tomcat really can't be blamed, because you are putting the newlines into the JSP file yourself. The only thing I can think of would be to have Tomcat ignore trailing whitespace on JSP source lines that nothing but a JSP directive or something like jsp:include... You other option might be to create a filter that collapsed multiple consecutive newlines into a single one. This might break some of your page, though. A few more observation regarding IE. It seems that once it guessed the type of a page it is caching that info in memory. Even better! What version of IE are you using, BTW? I'm wondering if they've finally fixed this in IE 6.0. I still use 5.5 when I view a site that's so broken in Mozilla that I can't make sense of it (which makes me pretty much furious). -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. For now I eliminated most of the empty lines by changing: [EMAIL PROTECTED] import=... % [EMAIL PROTECTED] language=Java % jsp:include page=foo.jsp / jsp:include page=bar.jsp / jsp:include page=baz.jsp / to: [EMAIL PROTECTED] import=... language=Java %jsp:include page=foo.jsp /jsp:include page=bar.jsp /jsp:include page=baz.jsp / Ugly, but at least there is one directive per page. It would be great if the JSP compiler would not output new lines for lines containing only JSP directives. I will fill a feature request for this. I doubt you will get far with such a feature request. If you consider what the JSP is doing, you'll see it's only doing it's job. The new line is in the JSP! It's nothing to do with the tag / page directive. Asking the tag or page directive not to output a new line afterwards is like asking it to scan ahead in the JSP to determine what comes next, and if it's a new line, please delete it. Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
JSP is a templating language which is using a meta language: the JSP constructs. The new line is in the JSP indeed, but is it part of the meta language or part of the literal output? I would argue that these new lines are part of the meta language and that they should not be output. You put them there so the meta language you use is readable. See how FreeMarker, another templating language, is dealing with this issue: http://freemarker.sourceforge.net/docs/dgui_misc_whitespace.html#dgui_misc_whitespace_stripping You are not asking the directive to scan anything, the page compiler could consider white space and newlines after a directive as part of that directive. Marius Adam Hardy wrote: On 10/30/2003 10:08 PM Marius Scurtescu wrote: I will consider implementing a filter to remove the empty lines before the html tag. For now I eliminated most of the empty lines by changing: [EMAIL PROTECTED] import=... % [EMAIL PROTECTED] language=Java % jsp:include page=foo.jsp / jsp:include page=bar.jsp / jsp:include page=baz.jsp / to: [EMAIL PROTECTED] import=... language=Java %jsp:include page=foo.jsp /jsp:include page=bar.jsp /jsp:include page=baz.jsp / Ugly, but at least there is one directive per page. It would be great if the JSP compiler would not output new lines for lines containing only JSP directives. I will fill a feature request for this. I doubt you will get far with such a feature request. If you consider what the JSP is doing, you'll see it's only doing it's job. The new line is in the JSP! It's nothing to do with the tag / page directive. Asking the tag or page directive not to output a new line afterwards is like asking it to scan ahead in the JSP to determine what comes next, and if it's a new line, please delete it. Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
xhtml and Internet Explorer
Hi, I am using Tomcat 4.0.5 with JBoss 3.0.3 under Win2K and I am trying to generate XHTML pages with JSP. Everything is fine with Mozilla, but IE keeps showing the pages as raw XML. I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. I checked the headers sent by the server (using LiveHTTPHeaders in Mozilla) and everything seems to be OK. The content type is text/html; charset=UTF-8 The content generated by the JSP page is valid XHTML. I saved it to a file and when loaded from the file system it is rendered properly by IE. Any clues? Thanks, Marius - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xhtml and Internet Explorer
Marius, I am using Tomcat 4.0.5 with JBoss 3.0.3 under Win2K and I am trying to generate XHTML pages with JSP. Everything is fine with Mozilla, but IE keeps showing the pages as raw XML. That's because IE ignores the Content-Type header and just looks at the first few bytes of the file to decide how to display it. What a POS. Anyway... I know that this issue came up before on this list, but the solution suggested previously (adding a page directive with the content type) does not work. IE still ignores the Content-Type. I checked the headers sent by the server (using LiveHTTPHeaders in Mozilla) and everything seems to be OK. The content type is text/html; charset=UTF-8 The content generated by the JSP page is valid XHTML. I saved it to a file and when loaded from the file system it is rendered properly by IE. What does the first line in your document look like? Do you have a !DOCTYPE in there, or do you start with an html header? -chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jsps xhtml and Internet Explorer
Hi there, anoyone know this one? I have a jsp page written to the xhtml standard. It looks like this: ?xml version=1.0? !-- - Author(s): - Date: - Copyright Notice: - @(#) - Description: -- jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:html=/WEB-INF/struts-html.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:dt=http://jakarta.apache.org/taglibs/datetime-1.0; xmlns:c=http://java.sun.com/jstl/core; xmlns:fmt=http://java.sun.com/jstl/fmt; version=1.2 html:html xhtml=true head [...] /head body [...] /body /html:html /jsp:root All seems fine. The page compiles properly and looks nice on every browser I've tried. Except Internet Explorer (v6), where it simply displays the XML source tree. I tried adding: mime-mapping extensionjsp/extension mime-typetext/html/mime-type /mime-mapping (and simlarly for xhtml) to the web.xml (both the webapp one and the global one). I'm using tomcat 4.0.6 and java 1.4.1 (I can't easily upgrade these because this is what my client use). I've had a search through the FAQs, this list's archive and on Google and can't find the solution. Has anyone seen this before? Many thanks, Graham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsps xhtml and Internet Explorer
Bill, many thanks: that worked perfectly. Graham MSIE has a bad habit of ignoring Content-Type, so I don't know that this will work. However, what you want is: jsp:directive.page contentType=text/html; charset=iso-8859-1 / (of course, change the charset if you aren't using iso-latin-1). [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, anoyone know this one? I have a jsp page written to the xhtml standard. It looks like this: ?xml version=1.0? !-- - Author(s): - Date: - Copyright Notice: - @(#) - Description: -- jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:html=/WEB-INF/struts-html.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:dt=http://jakarta.apache.org/taglibs/datetime-1.0; xmlns:c=http://java.sun.com/jstl/core; xmlns:fmt=http://java.sun.com/jstl/fmt; version=1.2 html:html xhtml=true head [...] /head body [...] /body /html:html /jsp:root All seems fine. The page compiles properly and looks nice on every browser I've tried. Except Internet Explorer (v6), where it simply displays the XML source tree. I tried adding: mime-mapping extensionjsp/extension mime-typetext/html/mime-type /mime-mapping (and simlarly for xhtml) to the web.xml (both the webapp one and the global one). I'm using tomcat 4.0.6 and java 1.4.1 (I can't easily upgrade these because this is what my client use). I've had a search through the FAQs, this list's archive and on Google and can't find the solution. Has anyone seen this before? Many thanks, Graham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Graham Stark, Virtual Worlds phone: (+044) 01908 618239 mobile: 07952 633185 Homepage http://www.virtual-worlds.biz Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla Virtual Economy http://www.bized.ac.uk/virtual/economy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsps xhtml and Internet Explorer
MSIE has a bad habit of ignoring Content-Type, so I don't know that this will work. However, what you want is: jsp:directive.page contentType=text/html; charset=iso-8859-1 / (of course, change the charset if you aren't using iso-latin-1). [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, anoyone know this one? I have a jsp page written to the xhtml standard. It looks like this: ?xml version=1.0? !-- - Author(s): - Date: - Copyright Notice: - @(#) - Description: -- jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:html=/WEB-INF/struts-html.tld xmlns:bean=/WEB-INF/struts-bean.tld xmlns:dt=http://jakarta.apache.org/taglibs/datetime-1.0; xmlns:c=http://java.sun.com/jstl/core; xmlns:fmt=http://java.sun.com/jstl/fmt; version=1.2 html:html xhtml=true head [...] /head body [...] /body /html:html /jsp:root All seems fine. The page compiles properly and looks nice on every browser I've tried. Except Internet Explorer (v6), where it simply displays the XML source tree. I tried adding: mime-mapping extensionjsp/extension mime-typetext/html/mime-type /mime-mapping (and simlarly for xhtml) to the web.xml (both the webapp one and the global one). I'm using tomcat 4.0.6 and java 1.4.1 (I can't easily upgrade these because this is what my client use). I've had a search through the FAQs, this list's archive and on Google and can't find the solution. Has anyone seen this before? Many thanks, Graham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]