jQuery in Action, 3rd edition
The moose likes Struts and the fly likes How to share a context (Struts and servlet) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to share a context (Struts and servlet)" Watch "How to share a context (Struts and servlet)" New topic

How to share a context (Struts and servlet)

Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
I have a application coded in Struts. I want to install a servlet on the same app that has

Is there any way to send data from the Servlet to a method called in the Struts portion of the app?
I have tried (in the servlet):

And in the struts action:

with no luck.

Thanks in advance
Krishna Madhava

Joined: Sep 21, 2007
Posts: 11

you can share the data between servlets and struts like below...

in servlets set the data::


in struts 2 action class get the data:::

using ActionContext

ActionContext actionContext = ActionContext.getContext();

I hope it should work..

Thank you

I agree. Here's the link: http://aspose.com/file-tools
subject: How to share a context (Struts and servlet)
It's not a secret anymore!