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.
|