Solved

concatenate variable with HTML

Posted on 2009-05-18
3
3,230 Views
Last Modified: 2013-12-29
In my JSP I want to concatenate a variable in the anchor tag url

I did the following but it does not work

Please help
<% String object_id="123" %>
 <td class="formtext"><a href="http://localhost:8080/webtop/drl/objectId/'"+object_id+"'>View</a></td>
  	  <td class="formtext"><a href="http://localhost:8080/webtop/component/bravaview?objectId='"+object_id+'">Annotate</a></td>

Open in new window

0
Comment
Question by:sam990
  • 3
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24419170
Try
<% String object_id="123" %>
 <td class="formtext"><a href="http://localhost:8080/webtop/drl/objectId/'<%=object_id%>'>View</a></td>
          <td class="formtext"><a href="http://localhost:8080/webtop/component/bravaview?objectId='<%=object_id%>">Annotate</a></td>

Open in new window

0
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 24419177
Typos sorry
<% String object_id="123" %>
 <td class="formtext"><a href="http://localhost:8080/webtop/drl/objectId/'<%=object_id%>'>View</a></td>
          <td class="formtext"><a href="http://localhost:8080/webtop/component/bravaview?objectId=<%=object_id%>">Annotate</a></td>

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24419191
:-)
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 54
servlet example issue 6 46
Configure a Bean in an XML file 4 42
What is the use of Forwarding Class in java 1 18
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

820 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