This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Small problem that I struggled for several days. I use frameworks Spring 3 + Hibernate + Struts 2.
I have a login action. I inject a bean via Spring and it works fine. Now I try to create an interceptor to separate the input validation and the action. But the intercetpor c'ant access to a bean.
An abstract of the interceptor
I updated applicationContext.xml as follows:
And finally I inject in struts.xml
And unfortunately I have always the following error
The strangest thing is when I do all the processing in the action (without interceptor) everything works good.
When you are calling that object from database? How you are doing that?
ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Jacques Mivi
Greenhorn
Joined: Nov 24, 2011
Posts: 7
posted
0
When you are calling that object from database? How you are doing that?
Hello,
My jsp - Account bar
My struts.xml
An abstract of the Action
And myapplicationContext.xml
With this way everything works good accountBean can be use with the jsp data.
Jacques Mivi
Greenhorn
Joined: Nov 24, 2011
Posts: 7
posted
0
When I try to change the interceptor in action. AccountBean can be use.
For exemple the interceptor
and struts.xml
Display what i record in the jsp.
The interceptors method intercept(ActionInvocation invocation) seems to disturb spring.
Jacques Mivi
Greenhorn
Joined: Nov 24, 2011
Posts: 7
posted
0
I'm progressing slowly.
It's seems that the bean "accountBean" it's different beetween the class action and class interceptor. The bean created with my accountbar.jsp is used to create the class action but not my interceptor.
I try to change the scope without success.
Jacques Mivi
Greenhorn
Joined: Nov 24, 2011
Posts: 7
posted
0
Still no solution, Any idea?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Struts 2 + Spring + Interceptors + Bean Null