• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt regarding Struts

 
Geeta Puttappanavar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. In struts 1.x, how many times the struts-config.xml will be read? Fir each request or only once when the 1st request comes???

2. In struts 2 who will read the struts.xml. I know the ActionProxy is responsible to read it. If that is the case how the FD-->ActioMaper---> ActioMappoing will decide whether to include the action or not?? Here ActioMapping class also will read the struts.xml or what?? Please clear my doubts in details.

Thanks in advance,
Geeta
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class responsible for reading struts.xml

It will read only once but you can override it to reading on each and every request



When enabled, Struts 2 will reload your resource bundles on every request (meaning you can change your .properties files, save them, and see the changes reflected on the next request).

For further details refer the following link Struts2 DevMode
 
Sandy Chatterjee
Ranch Hand
Posts: 55
Hibernate Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In struts 1.x, how many times the struts-config.xml will be read? For each request or only once when the 1st request comes???


For each request the struts-config.xml will be read, not from the file but from the objects created with the configuration file.
When the first request comes, in the init() method, the ActionServlet reads the Struts Config file and creates appropriate Struts
configuration objects (data structures) into memory. Creating configuration objects is an one time process.
But for each and every request the configuration object is read to create ActionMapping object for that particular request.
 
Geeta Puttappanavar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohana Rao Sv wrote:Class responsible for reading struts.xml

It will read only once but you can override it to reading on each and every request



When enabled, Struts 2 will reload your resource bundles on every request (meaning you can change your .properties files, save them, and see the changes reflected on the next request).

For further details refer the following link Struts2 DevMode


k. In struts1 xml file will read only once Then what about in struts2??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic