This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2  Integrating Hibernate with Struts 2 Fraework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2  Integrating Hibernate with Struts 2 Fraework" Watch "Struts2  Integrating Hibernate with Struts 2 Fraework" New topic
Author

Struts2 Integrating Hibernate with Struts 2 Fraework

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528

Hello All,

In HibernateSessionInterceptor , i cannot understand the target parameter provided by the plugin.

While configuring


What is this target here actually refering to .

According to the docs it is referring to the target - Target object in Action

Please can anybody tell me what is this actually ??

If you want something you never had do something which you had never done
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Note that this interceptor is *not* part of Struts 2--questions about its use should be directed to its creator.

The documentation pretty much sums it up--the "target" property refers to the action property the interceptor will attempt to set with the Hibernate session. It probably would have been quicker to spend a minute or five with the source--it's open-source, and it's almost always quicker to just find out on your own than wait for someone else to answer.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
David Newton wrote:Note that this interceptor is *not* part of Struts 2--questions about its use should be directed to its creator.


Ya ,i was looking for an alternative than using Spring for this purpose.


The documentation pretty much sums it up--the "target" property refers to the action property the interceptor will attempt to set with the Hibernate session.


And Thanks a lot for this.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
David can you please also tell this :

I want to call a Stateless Session Bean from my Action class , so i am thinking of two options :

1) Write a Helper class for JNDI lookup.

2) Write a custom Interceptor which will call a SessionBean .

What will be the best approach.

Please guide what are pros and cons .

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No clue; I never use EJBs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts2 Integrating Hibernate with Struts 2 Fraework
 
Similar Threads
what is interceptor-ref tag in struts?
Struts2: file upload not working
problem in displaying actionerrors
[Solved] Pass bean from invocation action to target action in chain type result
Scope interceptor: scope.type = end not doing any cleanup.