Solved

concatenate variable with HTML

Posted on 2009-05-18
3
3,157 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

785 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