avatar
Question on JSP EL# Java - 爪哇娇娃
T*e
1
It seems that EL is trying hard to convert my strings to double values. I
am confused. I remember the plus operator (+) can be used to concatenate
strings. Did I do anything wrong? What's the better way to deal with this?
I am using Tomcat 5.5.17 and JDK 1.5.0_06 on WinXP Home.
Thanks.
1: Working code
String resourceType = "service";
pageContext.setAttribute("resourceType", resourceType);
pageContext.setAttribute("resourceName", resourceType + "Name");
%>

select
ri.${resour
avatar
m*t
2
Nope, + does not concatenate two strings in EL. There isn't any way to
concatenate two strings within the ${} scope, not that I know of. I know, it
's surprisingly stupid.
avatar
g*g
3
Right, you can't do that. But you can do

it

【在 m******t 的大作中提到】
: Nope, + does not concatenate two strings in EL. There isn't any way to
: concatenate two strings within the ${} scope, not that I know of. I know, it
: 's surprisingly stupid.

avatar
T*e
4
Thanks. This is a solution.
However, not being able to concatenate strings within EL makes simple things
more difficult and less straightforward. I agree with magicfat that this
is stupid. Anyway, I am not that smart either and I can live with it :)

【在 g*****g 的大作中提到】
: Right, you can't do that. But you can do
: :
: it

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。