Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

JSP Document HTML Output

Thread view: 
johkar - 04 Nov 2006 14:46 GMT
JSP documents require XML syntax for all HTML elements (<img />).  By
default, the elements are outputted with XHTML syntax, is there a way
to tell the JSP container that you want HTML 4 syntax (<img>) instead
of the XHTML version?

John
Andrew Thompson - 04 Nov 2006 15:25 GMT
> JSP documents require XML syntax for all HTML elements (<img />).  By
> default, the elements are outputted with XHTML syntax, is there a way
> to tell the JSP container that you want HTML 4 syntax (<img>)

As I understand it, <img/> is equally valid in HTML 4.01
as <img>, check it here.. <http://validator.w3.org/>.

>...instead of the XHTML version?

As someone looking to take HTML 4.01 through XHTML
and on to XML, I am curious as to why you are so keen to
go in the exact opposite direction.  Is this all for saving
a few bytes?

Andrew T.
johkar - 04 Nov 2006 18:28 GMT
> > JSP documents require XML syntax for all HTML elements (<img />).  By
> > default, the elements are outputted with XHTML syntax, is there a way
[quoted text clipped - 11 lines]
>
> Andrew T.

Thanks for the reply Andrew.

HTML 4.01 transitional allows XML style tags for img, input, br and the
like, however HTML 4.01 Strict does not.  I tend to prefer XHTML too,
but here is my situation.  I have a custom tag library which outputs
the wrapper HTML for applications (top banner, navigation, left and
right columns and footer.  Some of the tags (meta, img, link)  need to
be outputted the appropriate way in order to validate.  When HTML 4.01
and XHTML are passed in as a tag attribute value by the developer
(strict or transitional), either I need to do something in the tag
class...or maybe it can be handled somewhere else.  My question is if
there is a way to control this in the JSP...like the jsp:output tag or
something.  This will be used across the company and it needs to be
flexible for the various docttypes, not just my preference.

In addition, the developer's code would need to output appropriately
too.  Maybe the answer is to not use JSP documents if not declaring
XHTML.

John


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.