File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes difference between Action,ActionServlet class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "difference between Action,ActionServlet class" Watch "difference between Action,ActionServlet class" New topic
Author

difference between Action,ActionServlet class

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
What is the difference between Action,ActionServlet class?
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Similarity is they both are Java classes.

But ActionServlet is nothing but a Servlet (enhanced version of Servlet) and it definitely acts as a Controller in the MVC pattern as described.

Whereas the Action class is the actual class which is acting upon the data (Model) for implementing your business logic. Using which you carry out all your business flow.

The ActionServlet is responsbile for looking up the struts-config.xml file to identify the particular action class and instantiate it if necessary, and send the actual request,response objects along with the ActionMapping,ActionForm objects to the execute() method of the invoked Action class.

Once the execute() method is done with its flow, it actually returns the ActionForward object back to the ActionServlet (which actually invoked the execute() method). The ActionServlet unwraps the ActionForward object and finds out the "key" to forward the request to the next level.

does that help?


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]
deepumdk mavireddi
Greenhorn

Joined: Nov 30, 2007
Posts: 18
hey raghavaan , that really helped me .. thank you so much...

and most important.. NICE Meeting you..

thanks & regards,
Dilip
deepumdk mavireddi
Greenhorn

Joined: Nov 30, 2007
Posts: 18
hey raghavaan , that really helped me .. thank you so much...

and most important.. NICE Meeting you..

thanks & regards,
Dilip
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

My Pleasure dileep.

Nice meeting me? In this forum you mean to say?
jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
@ raghavan : beautifully explained... Crystal Clear concept. I am impressed.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

jazy, do you think raghavan will read this after 2 years. The thread is 2 years old. Please Dont Wake The Zombies like this...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
@ankit, It was appreciation dude. Doesn't matter when you appreciate one's work, what matters is you appreciate it. And don't forget the basic rule of this site

" BE NICE " or "LEAVE"
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: difference between Action,ActionServlet class