String output question
Why wont this print?
out.print("<LINK REL="STYLESHEET" TYPE="text/css" href="style.css">")
How can I tell Java to ignor the special characters?
Because you have not constructed the string properly
it should be
"<LINK REL="STYLESHEET" TYPE="text/css" href="style.css">"
"<LINK REL='STYLESHEET' TYPE='text/css' href='style.css'>"
Nope, not true
When you want the output HTML code to be XHTML compliant for instance, you need to have it like <link rel="stylesheet" type="text/css" href="style.css">
This can be done like this:
out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">");
when using ["] in a String in Java you need to escape it using a [\]
what is not true about the fact that he did not cunstruct his string properly. I offered an alternative, it works as I use it my self. The issue was he did not construct his string correctly. So there is nothing to say nope, not true about.
By airrazor in forum Java
Last Post: 11-06-2005, 11:18 AM
Last Post: 09-09-2005, 12:17 PM
By Martin in forum VB Classic
Last Post: 12-03-2001, 04:53 AM
By Patrick Comeau in forum VB Classic
Last Post: 03-22-2001, 11:50 PM
By Mike in forum VB Classic
Last Post: 04-24-2000, 04:30 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL