aspose file tools*
The moose likes JSP and the fly likes jspx problem in ie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jspx problem in ie" Watch "jspx problem in ie" New topic
Author

jspx problem in ie

Ra Carter
Ranch Hand

Joined: Jul 30, 2005
Posts: 96
i have a jsp page using the pure xml syntax (the one that starts with <jsp:root). adding this one line of code to the head causes the page to not render in IE 7:



i don't think there is anything special happening in the site.js page, but here is the code anyway:



when i look at the code of the page generated i notice that thing have been reformated, for example, the script tag i wrote is rendered as:



could that be why it is not working in IE?
Ra Carter
Ranch Hand

Joined: Jul 30, 2005
Posts: 96
sorry i posted this question way to soon. if anyone is curious the solution is to add an empty comment inside the script tag because tomcat 5.5 renders it improperly for ie.

is this behavior changed in tomcat 6?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Originally posted by Ra Carter:
i have a jsp page using the pure xml syntax (the one that starts with <jsp:root).


Why? That format is not intended for hand-coded pages.

could that be why it is not working in IE?


Yes. self-closed script tags will not work properly in many browsers.

I highy recommend ditching the jspx syntax for the "normal" syntax. This is just the tip of the iceberg of the types of problems you will start running into.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Finney
Ranch Hand

Joined: Jan 25, 1999
Posts: 508
Originally posted by Bear Bibeault:

I highy recommend ditching the jspx syntax for the "normal" syntax. This is just the tip of the iceberg of the types of problems you will start running into.


Books like http://www.cookwood.com/html6ed/ encourage html page authors to write xhtml. It helps with validation. This brings 2 questions to mind:
1) Do most people write "normal" jsp syntax or are they writing xhtml / jsp syntax? (how will we ever really know for sure?)
2) if one is reading a book which favors xhtml and wants the html equivalent of what is being presented, where can one go to look up the html equivalent? I see http://www.w3schools.com/xhtml/default.asp and want instead a reference table or at least just 1 web page to reference.

Thanks.

tip: http://www.onjava.com/pub/a/onjava/2004/04/21/JSP2part3.html is a good article for JSP Documents (JSP XML)
[ August 07, 2007: Message edited by: Michael Finney ]

Michael Finney - "Always Striving To Serve You Better Every Day"
http://www.smilingsoftwaresolutions.com/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Books like http://www.cookwood.com/html6ed/ encourage html page authors to write xhtml.


XHTML and the JSP document format are separate issues. I highly encourage xhtml format in JSPs. But it really has nothing to do with the JSP document format, except that you must use xhtml with jspx.
[ August 07, 2007: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Further thoughts:

Originally posted by Michael Finney:
1) Do most people write "normal" jsp syntax or are they writing xhtml / jsp syntax? (how will we ever really know for sure?)


It's hard to know what "most people" are doing (and not that what "most people" do is the best way), but the majority of experienced developers that I know write "normal" JSP syntax with xhtml template text.

Remember that within a JSP, everything that's not a directive or action is simply template text. The JSP engine could care less if it's HTML, XHTML, or the results of your iguana walking across your keyboard.

2) if one is reading a book which favors xhtml and wants the html equivalent of what is being presented, where can one go to look up the html equivalent?


xhtml is correctly interpreted even if the doctype is set to html. So why the need for any conversion?
Michael Finney
Ranch Hand

Joined: Jan 25, 1999
Posts: 508
Ah I see. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jspx problem in ie