由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Expression Language 里如何调用jdk函数?
相关主题
Any body uses wicket framework for web development?JavaFx language
An interesting comment regarding Wicket.试了Vaadin
Anyone wants to talk about web frameworks?澳洲真是好地方,这样的职位都有10万刀
请问哪个J2EE MVC Framework最有前途Web前端的HTML+JavaScript+CSS可以理解为MVC吗?
view templating technologyjava学习范围 - for找工作
interview求助请问Java阵营最新潮的web development stack是什么?
A negative but well written article about Wicket请教一个jsp的问题
表格内容太长,要显示...,这是java还是html的功能?JSP - Expression Language (EL)到底流行不?
相关话题的讨论汇总
话题: wicket话题: count话题: language话题: expression话题: 函数
进入Java版参与讨论
1 (共1页)
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:
:
:
:
:

:
:

1 (共1页)
进入Java版参与讨论
相关主题
JSP - Expression Language (EL)到底流行不?view templating technology
Re: Custom Tag: embedding tag inside taginterview求助
where is my j2ee.jar fileA negative but well written article about Wicket
[转载] 请推荐关于Servlet和JSP编程的书表格内容太长,要显示...,这是java还是html的功能?
Any body uses wicket framework for web development?JavaFx language
An interesting comment regarding Wicket.试了Vaadin
Anyone wants to talk about web frameworks?澳洲真是好地方,这样的职位都有10万刀
请问哪个J2EE MVC Framework最有前途Web前端的HTML+JavaScript+CSS可以理解为MVC吗?
相关话题的讨论汇总
话题: wicket话题: count话题: language话题: expression话题: 函数