aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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:
subject: How to share a context (Struts and servlet)
Similar Threads
Deploy struts app
Run Servlet on deployment
Database Connection Pooling initialization with dbcp
Loading two servlets at the startup?
Can't include other page content with RequestDispatcher.include()