开发者

Instance variable and methods in JSP in Google App Engine

Basically, we shouldn't use instance variables and methods in JSP declarations because it is not thread-safe. But GAE does not use threads. So should I use instance variables and methods in JSP declaration? I mean to ask whether it will cause any in开发者_如何学JAVAaccurate data?


GAE does not use threads by default, but you can turn it on.

So, if you do not turn it on (by declaring your app thread-safe) you will not run into threading issues.

However, why would you want to use instance variables and methods in a JSP in the first place? A JSP should just produce page output and do nothing else. If it gets complex to the point where you want to throw in instance variables and methods, you probably want to move code out into a Java class (beans, servlets, filters).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜