Solved

concatenate variable with HTML

Posted on 2009-05-18
3
3,628 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
[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
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:

623 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