Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Can I use ActionBeans in non-Servlet environement

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a doubt about Action bean in struts. The perform method in org.apache.struts.action.Action class expects parameters like ServletRequest/ServletResponse ..and so on. How do I use these action beans in non-serlvet environment. I want my action bean only to be bothered about DB access and business logic.
Cheers
Jayram
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Action beans and Forms were built for the Servlet environment so that's the reason they accept these parameters. I guess you could take the struts code and 'roll your own' controller. Just out of curiosity what kind of environment are you targetting.
 
Saloon Keeper
Posts: 26057
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For one thing, the Action class isn't a bean! In Struts, you use Form Beans for that kind of stuff - an Action is an extension of the servlet (controller) and not a model component.
Regardless, it's not a bad idea to package the actual business and data access logic in their own classes (or EJBs) and leave the Struts Action to do the dispatching.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic