0

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%>"

Some Java Guy
  • 4,992
  • 19
  • 71
  • 108

2 Answers2

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.

Community
  • 1
  • 1
axtavt
  • 239,438
  • 41
  • 511
  • 482
0

NO

ab will be interpreted as new variable. You can do this <%= a+b %>

Community
  • 1
  • 1
Nishant
  • 54,584
  • 13
  • 112
  • 127