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,774
  • 19
  • 66
  • 104

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
  • 233,923
  • 40
  • 499
  • 475
0

NO

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

Community
  • 1
  • 1
Nishant
  • 52,245
  • 13
  • 108
  • 124