Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call struts plugin from action class?

 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My application uses struts plugin interface. When the app comes up it gets connected to DB2 and executes some query. We have downtime for these and everything gets restarted at the same time. If DB2 is not up at the right time then the app fails and it throws servlet exception, since it uses plugin class while it comes up and stores the respective data in the servlet context.

I need workaround solution for this. So I thought of checking the context for each request and if the attributes in the context are null I thought of calling the plugin class again. Is this a good idea? If so how will I call the struts plugin class from my struts action class.

Please HELP!

Thanks in advance
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest you refactor. Put the code that does the initialization into a method in a separate utility class. Then call that method from both your plugin and your Action class.
 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill. After while driving to office I was thinking the same thing. Once again thanks for letting me know that I am on the right direction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic