Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Useing double ticks in an out.println statement

Status
Not open for further replies.

NJDrew

Technical User
Dec 21, 2001
31
US
Ok, I hava a Servlet thats createing an html page. The Java compiler won't let me compile w/ Double ticks (") in my out.println statements. Normaly this isn't a problem, I just replace the (") with single ticks ('), but now one of my out.printlns is a button with the action property useing window.location = "bla-ba-blah.html". Here is the line of code I have.
//out.println(&quot;<input type = 'buton' value = 'Welcome page' OnClick = 'window.location = &quot;/Welcome.html&quot;'>&quot;);

Were you see the double ticks, before and after /Welcome.html, have to be double ticks for this to work. Keep in mind that this page is on a local machine useing the Java Virtual Machine. Just in case you say &quot;well the address is wrong, but.&quot; :) Any suggestions would be greatly appriciated. Thanks, Drew
&quot;Mistakes are the portals of discovery&quot;
James Joyce
 
Have you tried added the <p> tag :

out.println(&quot;<p><input type = 'buton' value = 'Welcome page' OnClick = 'window.location = &quot;/Welcome.html&quot;'></p>&quot;);

Ben
 
ok, Sedj I tried the paragraph tag, but the compiler is still saying ) exspected after the second &quot;. window.location = &quot;/Welcome&quot;<---this one.

Wushutwist: I tried the escape \ and it worked like a charm.

Sedj and Wushutwist, thank you both for you help.

Drew &quot;Mistakes are the portals of discovery&quot;
James Joyce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top