This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts-config.xml help

 
Mano haran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through the Struts Survival Guide by Srikanth Shenoy. It explains everything in detail.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic