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 struts-config.xml help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-config.xml help" Watch "struts-config.xml help" New topic
Author

struts-config.xml help

Mano haran
Greenhorn

Joined: Nov 30, 2006
Posts: 15
hi,

In an struts application,When struts-config.xml file load? and what is request processor?
what is the purpose of request processor?
last but not least where we write our business logic in struts?
is it action class or bean class(model)
Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
Go through the Struts Survival Guide by Srikanth Shenoy. It explains everything in detail.


- Christian
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3355

Hi,

First of all, the title for the question is misleading as this question does have more aspects out of struts-config.xml file.


When struts-config.xml file load?


As and when any request comes for the resource which requires the Struts ActionServlet to continue processing, the struts-config.xml file is coming into picture. To say with an example, when you say, *.do for the url-pattern, invoke the ActionServlet name which is mapped to the servlet-class of org.apache.struts.action.ActionServlet class!

But i m not too sure of it as it may depend on the Web or Application Server's nature!


what is request processor? what is the purpose of request processor?


RequestProcessor is one who handles and delegates the call to the execute() method of the appropriate Action classes. Same as how the service() method delegates the call to either doGet() or doPost() of a Servlet.


last but not least where we write our business logic in struts?
is it action class or bean class(model)


Basically, the bean class being used as a Model is to just represent the data! Action class is the main point of invocation where you may start your flow of implementing the business logic.

You can have a bit of business logic implemented in the Action Class and/or call the other layers for continue with the actual business logic.

Hope this helps to an extent!


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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts-config.xml help