I have two values in JSP. For 1 I defined a=http:// and for 2nd I defined b=google.com Currently I am using concat_urls= "<%=a%><%=b%>" . Can I join them as concat_urls= "<%=ab%>"
Asked
Active
Viewed 53 times
0
Some Java Guy
- 4,992
- 19
- 71
- 108
-
**NO** `ab` will be interpreted as new variable. – Nishant Apr 11 '11 at 09:32
2 Answers
2
No. However, expression in <%= ... %> is a normal Java expression, so you can write
<%= a + b %>
Also note that in general use of scriptlets is discouraged.