Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 + Spring + Interceptors + Bean Null

 
Jacques Mivi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

If you have an idea I'm interested.

Thank you & Have a nice day

 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you are calling that object from database? How you are doing that?
 
Jacques Mivi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still no solution, Any idea?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic