• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Coding links for dynamic html in a servlet

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
help_me
Asked:
help_me
1 Solution
 
shchukaCommented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now