This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

action servlet in struts

 
kishore nerella
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we write our own ActionServlet program in struts.

If yes, then tell me the process of doing that.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Certainly you can write your own ActionServlet. I'm not sure why you'd want to, but you can. It's a little like going out and buying a brand new car and then immediately pulling out the engine and replacing it with one you built yourself. If you didn't like the engine in the car, why did you buy it in the first place?

If you did replace the ActionServlet, it would make sense to extend the Struts ActionServlet rather than starting from scratch. It's really the RequestProcessor, though, that does most of the real work in Struts, so that's more likely the class that you'd want to extend if you want to customize how Struts works.

My recommendation, though, would be to spend the time to fully understand what Struts does and how it does it before you think about making broad changes to it. Since Struts is open source, you're free to look at the source code.
[ August 09, 2007: Message edited by: Merrill Higginson ]
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats perfect. I agree with Merrill completely.

Before you start overriding just try to analyze what the default ActionServlet does and what else you may need extra?

Though you are given the rights, it may NOT make sense as you would be unnecessarily re-inventing the wheel.

It will be alright just for the sake of testing, you are trying with your own. But make sure you do ALL the necessary stuff for the same.
[ August 10, 2007: Message edited by: Raghavan Muthu ]
 
kishore nerella
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That question was asked by Accenture
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kishore nerella:
That question was asked by Accenture


No matter where and by whom it is asked, i feel this would be the appropriate answer!
[ August 10, 2007: Message edited by: Raghavan Muthu ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic