由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 请问一个问题
相关主题
简单的EJB问题Re: 4年.NET经验在bay area大概能拿多少? (转载)
Stateful session bean到底有啥好处?spring解决了什么问题?
说说spring和ejb的差别关于EJB开发的几个问题
java servlet httpsession问题求教Which Web service is better EJB or RPC
急问:shoppingcart在eCommerce中究竟如何实现?About Hibernate
httpsession 问题Java,EJB的performance
大家都是搞技术的EJB2 Question
Java EE 习题 1j2ee without EJB
相关话题的讨论汇总
话题: session话题: bean话题: client话题: sfsb
进入Java版参与讨论
1 (共1页)
m**c
发帖数: 192
1
可以在不同的jsp页面里面使用同一个stateful session bean吗?
也就是那种同一个client session的相同的reference
如何让container知道 是同一个client session?
多谢了!
w******n
发帖数: 692
2
For your case, I think you should associate the stub with HttpSession object.
I have worked and reviewed >10 applications. No application uses stateful
session bean. In real world, I think stateful session bean and entity bean
are rarely used.

【在 m**c 的大作中提到】
: 可以在不同的jsp页面里面使用同一个stateful session bean吗?
: 也就是那种同一个client session的相同的reference
: 如何让container知道 是同一个client session?
: 多谢了!

m**c
发帖数: 192
3
多谢回复!
那么在HttpSession里面存放一个stateful session bean的reference
和先new 一个普通的java class再放到HttpSession里面有什么区别呢?

object.

【在 w******n 的大作中提到】
: For your case, I think you should associate the stub with HttpSession object.
: I have worked and reviewed >10 applications. No application uses stateful
: session bean. In real world, I think stateful session bean and entity bean
: are rarely used.

g*****g
发帖数: 34805
4
Can't agree more, and I would pleasantly replace stateless session bean
with Spring managed POJO bean.

object.

【在 w******n 的大作中提到】
: For your case, I think you should associate the stub with HttpSession object.
: I have worked and reviewed >10 applications. No application uses stateful
: session bean. In real world, I think stateful session bean and entity bean
: are rarely used.

g*****g
发帖数: 34805
5
Honestly, I don't know. The latter way is a standard way of doing the job.
And since Java is no Perl, why beat a dead horse?

【在 m**c 的大作中提到】
: 多谢回复!
: 那么在HttpSession里面存放一个stateful session bean的reference
: 和先new 一个普通的java class再放到HttpSession里面有什么区别呢?
:
: object.

m**c
发帖数: 192
6
The standard way is put a POJO instance in the HttpSession?
But I saw some applicatoins, they put stateful session beans in the
HttpSession
And for avoiding "NoSuchObject Exception", they always create new SFSB in
catch exception block
Are there any issues about the expiration of POJO instances in HttpSessions
and HttpSessions itself and even the SFSBs (this should be handled by the
EJB container)
btw: I know spring framework and Hibernate are better than J2EE, but seems
there are still lots of

【在 g*****g 的大作中提到】
: Honestly, I don't know. The latter way is a standard way of doing the job.
: And since Java is no Perl, why beat a dead horse?

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

I would say that's some... questionable practice.
If you can isolate the piece of code that does this, definitely go ahead and
send it to TheDailyWTF. 8-)

【在 m**c 的大作中提到】
: The standard way is put a POJO instance in the HttpSession?
: But I saw some applicatoins, they put stateful session beans in the
: HttpSession
: And for avoiding "NoSuchObject Exception", they always create new SFSB in
: catch exception block
: Are there any issues about the expiration of POJO instances in HttpSessions
: and HttpSessions itself and even the SFSBs (this should be handled by the
: EJB container)
: btw: I know spring framework and Hibernate are better than J2EE, but seems
: there are still lots of

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

object.
+1. Although SFSBs can be useful in some rich client applications, where
the client can't be trusted, in either the security or the reliability sense
, to properly maintain the session state.

【在 w******n 的大作中提到】
: For your case, I think you should associate the stub with HttpSession object.
: I have worked and reviewed >10 applications. No application uses stateful
: session bean. In real world, I think stateful session bean and entity bean
: are rarely used.

m**c
发帖数: 192
9

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Then how to let the
different JSP pages know they should use the same reference of SFSB and
store the web client's data without HttpSession?
SFSB is used to store the states of the client. I'm confused.
in
and

【在 m******t 的大作中提到】
:
: object.
: +1. Although SFSBs can be useful in some rich client applications, where
: the client can't be trusted, in either the security or the reliability sense
: , to properly maintain the session state.

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

As others have pointed out, it makes very little sense to use SFSB in a web
application. Just maintain the state in HttpSession.

【在 m**c 的大作中提到】
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Then how to let the
: different JSP pages know they should use the same reference of SFSB and
: store the web client's data without HttpSession?
: SFSB is used to store the states of the client. I'm confused.
: in
: and

m**c
发帖数: 192
11
OK, I understand, thanks a lot!

web

【在 m******t 的大作中提到】
:
: As others have pointed out, it makes very little sense to use SFSB in a web
: application. Just maintain the state in HttpSession.

1 (共1页)
进入Java版参与讨论
相关主题
j2ee without EJB急问:shoppingcart在eCommerce中究竟如何实现?
vaadinhttpsession 问题
本菜对EJB一问大家都是搞技术的
java的东西好多Java EE 习题 1
简单的EJB问题Re: 4年.NET经验在bay area大概能拿多少? (转载)
Stateful session bean到底有啥好处?spring解决了什么问题?
说说spring和ejb的差别关于EJB开发的几个问题
java servlet httpsession问题求教Which Web service is better EJB or RPC
相关话题的讨论汇总
话题: session话题: bean话题: client话题: sfsb