Struts2 uses a configuration file called
struts.xml this xml file is used to start
project resources. That can be interceptors,
actions, results and others can also define global variables
, validations few bone
words is like the heart of our project.
can work with more xml files, but all
must be included in the file struts.xml
as follows
recommended when we are present a very large project
, because then we would be more orderly and easier
working, you could say we made a
modularization of our file.
file in practice I always put it in src
is not necessary to have it stored in web-inf folder
we must keep in mind that the structure our
struts.xml must respect the rules of a
xml format, since it will be transformed to (DTD
well formed xml file is as a validator of our
xml file and serves to cover it) to read, my cup
experience I have noticed that many errors are generated by forming
bad or wrong with this famous definition file,
have to note that reading this file
is sequential.
strustdefault.xml there is also the file and struts-plugin.xml
, these two files are included implicitly
(a resemblance to the Object class) and
have the default configuration and are loaded at startup
, in practice I can that are not
in our project, I work with netbeans and eclipce
times, but very little
is
others find it as
this package defines the working group, its
tag is
we share attributes or use of organizational form, a condition is mandatory
its name and its characteristics is that
may extend along with some major labels, we can find the tag
bean, these are created
by the framework and used and finally we discuss
constants (constant), this
are very useful as they can be used to define
settings, you can define what type of bean
to use, etc. As data we can say that
web.xml
initialization parameters are loaded as
FilterDispatchir constant. This is the famous FilterDispatcher
input of our project and is set in web.xml
to work with the constants must be
devmode = true, well this you can see from the
thousands of examples that can be
found in internet, but you know to which this
configuration.
as always I will leave good link, to enter in detail
strust2 more about, because we can find many examples
but if we do not understand what we always give
flying blind
link: Struts2 very good this link and this in English, well
explains the architecture of this framework and with only
next picture we can understand many things in this framework.
0 comments:
Post a Comment