Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Rookie question - what does this block of struts 2 configuration do?  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the said xml code:





3 questions:

1. What does this "package" block do at a whole? It looks to me that it's dividing/branching something into a separate module.

2.  How does all those "action" work? Where will they be invoked? I know what they are, they are well, "actions" that are marked in struts.xml with a name so they could be called somewhere, I just don't know the details.

3. There is NO interceptors coming into play in this scenario, right?

My apologies for the very rookie questions?
 
Saloon Keeper
Posts: 5038
134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think most of that is covered here: https://struts.apache.org/getting-started/hello-world-using-struts2.html
 
Bartender
Posts: 9550
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim posted a good overview of how Struts works in general (your 2nd question).  I'll fill in some of the blanks.

Ted Modler wrote:
1. What does this "package" block do at a whole? It looks to me that it's dividing/branching something into a separate module.


A "package" in Struts lets you split up the configuration (and possibly declare a distinct web context "namespace").  See here

Ted Modler wrote:
3. There is NO interceptors coming into play in this scenario, right?


No.  There are interceptors declared in the default Struts configuration.  The package declaration in your example imports these settings (among others) by extending "struts-default".  See here
 
Ted Modler
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks guys, IJR the extend default thing. Although I forgot how default config works but I know where to find out.

Also thanks for the hello world page
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!