由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - How can I alert a spring message?
相关主题
Inject property file into a spring bean?使用eclipse方法对第三方库建立Wrapper的小技巧。
EJB bookhow to refactor overlayered applications?
What's going on with Spring IDE's website?Any body uses wicket framework for web development?
spring questionGif animation stops when clicking a link.
怎么用java作alert message啊?库存查询应该怎么做?
请教Programming booksa stupid question
请问java的ideSpring custom validation errors.
any tools for ...请教汉字的utf-8 mapping (转载)
相关话题的讨论汇总
话题: message话题: spring话题: alert话题: js话题: jsp
进入Java版参与讨论
1 (共1页)
g*****g
发帖数: 34805
1
I want to have a simple popup, but how can I get a spring message in
javascript so it supports I18N?
A**o
发帖数: 1550
2
make the jsp to encode right first.
generate the message using key or some scriptlet features.
so are you using spring mvc?

【在 g*****g 的大作中提到】
: I want to have a simple popup, but how can I get a spring message in
: javascript so it supports I18N?

g*****g
发帖数: 34805
3
Can you elaborate?

In javascript
alert(...)
Now how do you make the message pass to alert?

【在 A**o 的大作中提到】
: make the jsp to encode right first.
: generate the message using key or some scriptlet features.
: so are you using spring mvc?

A**o
发帖数: 1550
4
alert('');

【在 g*****g 的大作中提到】
: Can you elaborate?
:
: In javascript
: alert(...)
: Now how do you make the message pass to alert?

g*****g
发帖数: 34805
5
I must be too tired this afternoon and couldn't think. The way you mentioned
was what I first tried, but the js is an external file and it cannot be
resolved at client side.
The point is that tag must be resolved on server side, as long as it is in
jsp, it will be fine.
So I put it in a hidden input, get it in js function using getElementById,
and it's working great.
A**o
发帖数: 1550
6
it happened that i just suggest some coworker to do the same
this afternoon. however, the coworker's refactoring proposal
was denied. so nothing would happen.

mentioned

【在 g*****g 的大作中提到】
: I must be too tired this afternoon and couldn't think. The way you mentioned
: was what I first tried, but the js is an external file and it cannot be
: resolved at client side.
: The point is that tag must be resolved on server side, as long as it is in
: jsp, it will be fine.
: So I put it in a hidden input, get it in js function using getElementById,
: and it's working great.

A**o
发帖数: 1550
7
another workaround i was thinking this afternoon was:
make js an extension that will pass over to your JSP parser in the web.xml.
it's hack, i must say.

mentioned

【在 g*****g 的大作中提到】
: I must be too tired this afternoon and couldn't think. The way you mentioned
: was what I first tried, but the js is an external file and it cannot be
: resolved at client side.
: The point is that tag must be resolved on server side, as long as it is in
: jsp, it will be fine.
: So I put it in a hidden input, get it in js function using getElementById,
: and it's working great.

m******t
发帖数: 2416
8

mentioned
Whatever happened to rendering a good old javascript var in jsp and reference it from the js? 8-)
var alertmsg='';

【在 g*****g 的大作中提到】
: I must be too tired this afternoon and couldn't think. The way you mentioned
: was what I first tried, but the js is an external file and it cannot be
: resolved at client side.
: The point is that tag must be resolved on server side, as long as it is in
: jsp, it will be fine.
: So I put it in a hidden input, get it in js function using getElementById,
: and it's working great.

g*****g
发帖数: 34805
9
I want to keep the js from the jsp, coz the js is a big chunk of codes
by itself. So either you pass the message to js as a variable, which is
undesired since I called it in multiple places. Or the hidden input might
be the best trick.

reference it from the js? 8-)

【在 m******t 的大作中提到】
:
: mentioned
: Whatever happened to rendering a good old javascript var in jsp and reference it from the js? 8-)
: var alertmsg='';

1 (共1页)
进入Java版参与讨论
相关主题
请教汉字的utf-8 mapping (转载)怎么用java作alert message啊?
这叫啥名词?请教Programming books
JSTL problem请问java的ide
Re: Desperately need help on DB2 connection through jdbc in jsp pageany tools for ...
Inject property file into a spring bean?使用eclipse方法对第三方库建立Wrapper的小技巧。
EJB bookhow to refactor overlayered applications?
What's going on with Spring IDE's website?Any body uses wicket framework for web development?
spring questionGif animation stops when clicking a link.
相关话题的讨论汇总
话题: message话题: spring话题: alert话题: js话题: jsp