?
Solved

Coding links for dynamic html in a servlet

Posted on 1998-08-03
1
Medium Priority
?
188 Views
Last Modified: 2013-11-24
Please could you give me the code to get a link to appear in a dynamic html page, created in a servlet as follows:

out.println("<A HREF=http://www.javasoft.com/images/duke_404.gif TARGET=image> Load Image</a>")

I need to put double quotes around the file name and the target name, but the compiler will not accept this, it thinks they signify the end and start of new strings.

How do I get around this.

Thanks
0
Comment
Question by:help_me
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
shchuka earned 150 total points
ID: 1230784
This is simple:

out.println("<A HREF=\"http://www.javasoft.com/images/duke_404.gif\" TARGET=\"image\">Load Image</a>");

Basically, you need to prepend the double quote with a backslash (\)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question