• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Doubt regarding Struts

 
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
 
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
 
Ranch Hand
Posts: 55
Mac Hibernate Java
  • 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??
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!