aspose file tools*
The moose likes Struts and the fly likes action servlet in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "action servlet in struts" Watch "action servlet in struts" New topic
Author

action servlet in struts

kishore nerella
Greenhorn

Joined: Jul 17, 2007
Posts: 15
Can we write our own ActionServlet program in struts.

If yes, then tell me the process of doing that.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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 ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
kishore nerella
Greenhorn

Joined: Jul 17, 2007
Posts: 15
That question was asked by Accenture
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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 ]
 
wood burning stoves
 
subject: action servlet in struts