m****g 发帖数: 12 | 1 在JSTL Expression Language (EL)里,怎样使用一些jdk自带的函数? 比如:
我有mymodel这样一个对象,它的一个成员叫count是string类型的。当我使用
时,因为类型不匹配将会出现错误。
请问怎样才能用java的标准函数(比如:Integer.parseInt("") )把count转换
成integer类型从而可以跟12进行比较? |
g*****g 发帖数: 34805 | 2 You don't, keep these in servlet, and pass the boolean variable
to jsp. Keep jsp as clean as possible.
【在 m****g 的大作中提到】 : 在JSTL Expression Language (EL)里,怎样使用一些jdk自带的函数? 比如: : 我有mymodel这样一个对象,它的一个成员叫count是string类型的。当我使用 : 时,因为类型不匹配将会出现错误。 : 请问怎样才能用java的标准函数(比如:Integer.parseInt("") )把count转换 : 成integer类型从而可以跟12进行比较?
|
m******t 发帖数: 2416 | 3
Why is something called "count" a string to begin with?
【在 m****g 的大作中提到】 : 在JSTL Expression Language (EL)里,怎样使用一些jdk自带的函数? 比如: : 我有mymodel这样一个对象,它的一个成员叫count是string类型的。当我使用 : 时,因为类型不匹配将会出现错误。 : 请问怎样才能用java的标准函数(比如:Integer.parseInt("") )把count转换 : 成integer类型从而可以跟12进行比较?
|
A**o 发帖数: 1550 | 4 Agree, just process the comparision before putting the result
into the context. what's the trouble of that?
【在 g*****g 的大作中提到】 : You don't, keep these in servlet, and pass the boolean variable : to jsp. Keep jsp as clean as possible.
|
t*******e 发帖数: 684 | 5 JSTL specification里面写明了不能直接访问Java class中的methods,除了string
functions,和getter setter methods. 目的是维护MVC pattern. |
m******t 发帖数: 2416 | 6
bug and I had a debate on this before. It is my opinion that it's
incredibly cumbersome to simply keep all logic in java.
Take this example, what if the intention is something like this:
You'll have to bend the definition of MVC really really, really hard
to convince me that that sh
【在 A**o 的大作中提到】 : Agree, just process the comparision before putting the result : into the context. what's the trouble of that?
|
t*******e 发帖数: 684 | 7
I wonder where we place those simple logic statements in Wicket page source
without JSTL.
Should we program these as a Wicket Panel class, and declare them as a Panel in Wicket page source?
【在 m******t 的大作中提到】 : : bug and I had a debate on this before. It is my opinion that it's : incredibly cumbersome to simply keep all logic in java. : Take this example, what if the intention is something like this: : : : : : : |
g*****g 发帖数: 34805 | 8 This is an interesting question. I am wicket newbie.
I guess a simple way is to treat the style class name as a label
And assign value in java.
So you assign "overflow-count" and "safe-count" in java code, for me,
that's not a big deal. If you are a perfectionist, consider doing
your indirection in CSS
">
【在 m******t 的大作中提到】 : : bug and I had a debate on this before. It is my opinion that it's : incredibly cumbersome to simply keep all logic in java. : Take this example, what if the intention is something like this: : : : : : :
|
A**o 发帖数: 1550 | 9 i like your approach in this case.
【在 m******t 的大作中提到】 : : bug and I had a debate on this before. It is my opinion that it's : incredibly cumbersome to simply keep all logic in java. : Take this example, what if the intention is something like this: : : : : : :
|