Struts 1 vs Struts 2

Here are few comparison of Jakarta Struts framework version 1.X and 2.X
The entire approach has been changed in Struts 2 by introduction of dependency injection and interceptors. Here are few key differences...


1. Servlet Dependency:


Actions in Struts1 have dependencies on the servlet API since the HttpServletRequest and HttpServletResponse objects are passed to the execute method when an Action is invoked.

In case of Struts 2, Actions are not container dependent because they are made simple POJOs. In struts 2, the servlet contexts are represented as simple Maps which allows actions to be tested in isolation. Struts 2 Actions can access the original request and response, if required. However, other architectural elements reduce or eliminate the need to access the HttpServetRequest or HttpServletResponse directly.

2. Action classes

Struts 1 requires Action classes to extend an abstract base class. Extending an abstract class instead of interface is one of design issues of struts 1.x framework that has been resolved in the struts 2 framework.
In case of Struts 2 Action class may or may not implement interfaces to enable optional and custom services. In case of Struts 2 , Actions are not container dependent because they are made simple POJOs. Struts 2 provides a base ActionSupport class to implement commonly used interfaces. Albeit, the Action interface is not required. Any POJO object with an execute signature can be used as an Struts 2 Action object. Struts 2 also provides a way to maintain action objects using spring container.

3. Validation


Struts1 and Struts 2 both supports the manual validation via a validate method.
Struts1 uses validate method on the ActionForm, or validates through an extension to the Commons Validator. However, Struts 2 supports manual validation via the validate method and the XWork Validation framework. The Xwork Validation Framework supports chaining validation into sub-properties using the validations defined for the properties class type and the validation context.

4. Threading Model

In Struts1, Action resources must be thread-safe or synchronized. So Actions are singletons and thread-safe, there should only be one instance of a class to handle all requests for that Action. The singleton strategy places restrictions on what can be done with Struts1 Actions and requires extra care to develop. However in case of Struts 2, Action objects are instantiated for each request, so there are no thread-safety issues. (In practice, servlet containers generate many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.)

5. Testability

Testing Struts1 applications are a bit complex. A major hurdle to test Struts1 Actions is that the execute method because it exposes the Servlet API. A third-party extension, Struts TestCase, offers a set of mock object for Struts1. But the Struts 2 Actions can be tested by instantiating the Action, setting properties and invoking methods. Dependency Injection support also makes testing simpler. Actions in struts2 are simple POJOs and are framework independent, hence testability is quite easy in struts2.

6. Harvesting Input

Struts1 uses an ActionForm object to capture input. And all ActionForms needs to extend a framework dependent base class. JavaBeans cannot be used as ActionForms, so the developers have to create redundant classes to capture input.
However Struts 2 uses Action properties (as input properties independent of underlying framework) that eliminates the need for a second input object, hence reduces redundancy. Additionally in struts2, Action properties can be accessed from the web page via the taglibs. Struts 2 also supports the ActionForm pattern, as well as POJO form objects and POJO Actions. Even rich object types, including business or domain objects, can be used as input/output objects.

7. Expression Language

Struts1 integrates with JSTL, so it uses the JSTL-EL. The struts1 EL has basic object graph traversal, but relatively weak collection and indexed property support. Struts 2 can also use JSTL, however it supports a more powerful and flexible expression language called "Object Graph Notation Language" (OGNL).

8. Binding values into views

In the view section, Struts1 uses the standard JSP mechanism to bind objects (processed from the model section) into the page context to access. However Struts 2 uses a "ValueStack" technology so that the taglibs can access values without coupling your view to the object type it is rendering. The ValueStack strategy allows the reuse of views across a range of types which may have the same property name but different property types.

9. Type Conversion

Usually, Struts1 ActionForm properties are all Strings. Struts1 uses Commons-Beanutils for type conversion. These type converters are per-class and not configurable per instance. However Struts 2 uses OGNL for type conversion. The framework includes converters for basic and common object types and primitives.

10. Control Of Action Execution

Struts1 supports separate Request Processor (lifecycles) for each module, but all the Actions in a module must share the same lifecycle. However Struts 2 supports creating different lifecycles on a per Action basis via Interceptor Stacks. Custom stacks can be created and used with different Actions as needed.


Comparison of struts 2 with struts 1, comparing struts 1 and Struts 2, struts 1 or struts 2 which one to use, struts 2 vs struts 1

42 Post Comment

Anonymous said...

nike free, kate spade outlet, prada handbags, coach factory outlet, oakley sunglasses, true religion, coach purses, oakley sunglasses, louboutin, michael kors outlet, ray ban, louis vuitton outlet online, jordan shoes, coach factory, longchamp outlet, ray ban sunglasses, louis vuitton handbags, coach outlet, nike shoes, true religion outlet, tiffany and co, michael kors outlet, true religion jeans, oakley sunglasses, gucci outlet, louboutin, chanel handbags, polo ralph lauren outlet, oakley sunglasses, ray ban sunglasses, toms shoes, oakley sunglasses, tory burch outlet, air max, coach outlet store, nike air max, polo ralph lauren, burberry outlet online, burberry outlet online

Anonymous said...

air max, nfl jerseys, nike free, marc jacobs, chi flat iron, air max, hogan, air jordan, nike free, mcm handbags, new balance shoes, ghd, mont blanc, louis vuitton, yoga pants, louis vuitton, bottega, karen millen, longchamp, juicy couture outlet, louboutin, abercrombie and fitch, rolex watches, nike air max, ralph lauren, reebok outlet, birkin bag, ralph lauren, nike air max, vans, lancel, north face outlet, insanity, supra shoes, lululemon, ferragamo shoes, beats by dre, timberland, hollister, converse shoes, mulberry

pae young said...

cheap are not barbour jacket sale furious, vacated jump, a cheap barbour international jackets sharp reversal of the body, cheap barbour international jackets Just to cheap barbour international jackets condemn, to see cheap lengli eyes could not help quickly closed his mouth. Is what, rub your right to see the knife. A knife Pichu east, directly cheap barbour international jackets Kanxiang cheap neck, while his right leg kicked out, Adon loud screams, puffing blood fly out. barbour factory shop cheap landing instantly rushed already stunned other cheap barbour international jackets smashed.

Wei Chen said...

QF0716
moncler coats
prom dresses
cheap football shirts
hermes bags
nike free,nike free run,free running,free run,nike running
phil mcconkey jersey,odell beckham jr jersey,michael strahan jersey,chris snee jersey,larry donnell jersey,peyton hillis jersey,carl banks jersey,lawrence taylor jersey,phil mcconkey jersey,justin tuck jersey,michael boley jersey,chase blackburn jersey
swarovski uk
barcelona soccer jersey
cleveland cavaliers jersey
nike free
chelsea football shirts
camisetas futbol baratas
nike air max 2014
swarovski crystal
the north face clearance
kate spade outlet
manchester united football shirts
chanel handbags
chiefs jersey
arizona cardinals jerseys
monster beats
ysl outlet
stephen curry jersey
nike trainers uk
football shirts

Meiqing Xu said...

15910meiqing
instyler curling iron
abercrombie fitch,abercrombie and kent,abercrombie & fitch,abercrombie outlet,abercrombie kids
toms outlet
ralph lauren uk
air jordan 11
ghd straighteners
louis vuitton handbags
michael kors uk
oakley outlet
nike huarache
air force 1
celine outlet
ray ban glasses
uggs on sale
nike roshe run
ray ban sunglass
louis vuitton
louis vuitton handbags
mont blanc pens
michael kors outlet
adidas superstar
coach outlet
louis vuitton
oakley sunglasses cheap
ray ban glasses
oakley sunglasses
air jordans
louis vuitton handbags
jeremy scott shoes
louis vuitton handbags

السعيد عبدالحق said...


شركة تنظيف بالرياض
شركة نقل اثاث بالرياض
شركة تنظيف كنب بالرياض
شركة تنظيف مجالس بالرياض
شركة تنظيف سجاد بالرياض
شركة تنظيف منازل بالرياض
شركة كشف تسربات بالرياض
شركة كشف تسربات بالرياض شش
شركة رش شمال الرياض
شركة نقل اثاث خارج الرياض
تسليك بالرياض

Chjn Gfbjf said...



شركة تنظيف كنب بالرياض
شركة تنظيف مجالس بالرياض
شركة تنظيف سجاد بالرياض
شركة تنظيف منازل بالرياض
شركة كشف تسربات بالرياض
شركة كشف تسربات بالرياض شش
شركة رش شمال الرياض
شركة نقل اثاث خارج الرياض
تسليك بالرياض
شركة تنظيف بالرياض
شركة نقل اثاث بالرياض
شركة تنظيف خزانات 1
شركة تنظيف خزانات 2
شركة تنظيف خزانات 3
شركة تنظيف مكافحة حشرات بالرياض

ninest123 Ninest said...

ninest123 11.24
louboutin uk, nike outlet, louis vuitton handbags, michael kors outlet online, nike air max, ralph lauren polo, longchamp bags, replica watches, christian louboutin, uggs outlet, burberry factory outlet, tiffany jewelry, uggs on sale, louis vuitton outlet, michael kors handbags, burberry outlet, tory burch outlet, ray ban sunglasses, oakley sunglasses, louis vuitton outlet, longchamp outlet, oakley sunglasses, ray ban sunglasses, ray ban sunglasses, oakley sunglasses, gucci handbags, oakley sunglasses, cheap jordans, ralph lauren outlet, tiffany jewelry, louis vuitton, uggs outlet, replica watches, michael kors outlet, prada handbags, michael kors, prada outlet, uggs on sale, christian louboutin, nike air max, louis vuitton outlet online, louboutin shoes, uggs on sale, nike free, michael kors outlet online, michael kors outlet store, longchamp outlet, cheap oakley sunglasses

ninest123 Ninest said...

north face pas cher, ray ban uk, polo lacoste pas cher, nike air max, nike air max uk, vanessa bruno pas cher, nike roshe uk, nike roshe run pas cher, abercrombie and fitch UK, nike air force, michael kors, michael kors outlet online, polo ralph lauren uk, true religion outlet, lululemon outlet, new balance, timberland pas cher, louboutin pas cher, michael kors uk, nike tn pas cher, hogan sito ufficiale, hermes pas cher, nike blazer pas cher, nike free pas cher, vans pas cher, nike air max pas cher, ralph lauren pas cher, nike air max uk, abercrombie and fitch, lunette oakley pas cher, true religion outlet, true religion jeans, coach outlet, burberry pas cher, sac guess pas cher, converse, north face uk, nike trainers uk, nike free, true religion outlet, hollister uk, mulberry uk, coach outlet store online, coach purses, michael kors, lunette ray ban pas cher, longchamp pas cher, longchamp soldes, jordan pas cher

ninest123 Ninest said...

supra shoes, coach outlet, bottes ugg pas cher, moncler, converse shoes outlet, canada goose pas cher, canada goose uk, juicy couture outlet, juicy couture outlet, moncler pas cher, sac louis vuitton, links of london uk, swarovski jewelry, sac louis vuitton, ugg,uggs,uggs canada, toms shoes, canada goose jackets, karen millen uk, montre pas cher, lancel, canada goose, moncler, uggs outlet, michael kors outlet, moncler uk, ugg uk, barbour, thomas sabo uk, wedding dresses uk, ugg,ugg australia,ugg italia, canada goose outlet, doke & gabbana, barbour jackets uk, replica watches, ugg pas cher, louis vuitton uk, moncler outlet, pandora charms, swarovski uk, marc jacobs, louis vuitton, canada goose outlet, pandora jewelry, louis vuitton, canada goose jackets, moncler, pandora uk, moncler jackets, moncler, hollister, pandora jewelry, canada goose

ninest123 Ninest said...

abercrombie and fitch, nike roshe run, soccer shoes, oakley, wedding dresses, polo ralph lauren, nike air max, nike air max, vans scarpe, valentino shoes, vans outlet, herve leger, p90x workout, beats by dre, iphone 5s cases, soccer jerseys, hollister, ray ban, instyler ionic styler, iphone cases, bottega veneta, insanity workout, s6 cases, timberland boots, giuseppe zanotti, jimmy choo outlet, iphone 6s plus cases, iphone 6 cases, mcm handbags, converse, reebok outlet, babyliss pro, louboutin, lululemon outlet, chi flat iron, mont blanc, new balance shoes, iphone 6 plus cases, north face outlet, salvatore ferragamo, mac cosmetics, asics running shoes, ghd hair, north face outlet, hollister clothing, softball bats, nfl jerseys, hermes handbags, ipad cases, celine handbags, gucci, iphone 6s cases
ninest123 11.24

Cran Jane said...

Coach Outlet North Face Jackets Oakley Sunglasses Toms Outlet North Face Outlet Nike Outlet Nike Hoodies Tory Burch Flats Marc Jacobs Handbags Jimmy Choo Shoes Jimmy Choos
Burberry Belt Tory Burch Boots Louis Vuitton Belt Ferragamo Belt Marc Jacobs Handbags Lululemon Outlet Christian Louboutin Shoes True Religion Outlet Tommy Hilfiger Outlet
Michael Kors Outlet Coach Outlet Red Bottoms Kevin Durant Shoes New Balance Outlet Adidas Outlet Coach Outlet Online Stephen Curry Jersey

Eric Yao said...

Skechers Go Walk Adidas Yeezy Boost Adidas Yeezy Adidas NMD Coach Outlet North Face Outlet Ralph Lauren Outlet Puma SneakersPolo Outlet
Under Armour Outlet Under Armour Hoodies Herve Leger MCM Belt Nike Air Max Louboutin Heels Jordan Retro 11 Converse Outlet Nike Roshe Run UGGS Outlet North Face Outlet
Adidas Originals Ray Ban Lebron James Shoes Sac Longchamp Air Max Pas Cher Chaussures Louboutin Keds Shoes Asics Shoes Coach Outlet Salomon Shoes True Religion Outlet
New Balance Outlet Skechers Outlet Nike Outlet Adidas Outlet Red Bottom Shoes New Jordans Air Max 90 Coach Factory Outlet North Face Jackets North Face Outlet

linda paris said...

niche kacang bali

عرفان صادقي said...

بک لینک

بانک مقاله

دانلود آهنگ

تبادل لینک

ساخت وبلاگ

ابزاردهی

Malaysia Escorts said...

Pakistani Escorts

Malaysia Escorts said...

Pakistani Escorts Abey

Sky Host Pakistan said...

Leading web hosting comopany in Pakistan - Sky Host Pk

Malaysia Escorts said...

Vip Lahore Girls

Malaysia Escorts said...

Vip Karachi Girls

Malaysia Escorts said...

Vip Lahore Escorts

Hoài Nguyễn said...

Thị trường bất động sản đầu năm 2017 với sự xuất hiện của dự án eco dream nguyễn xiển. Chung cư eco dream là dự án căn hộ cao cấp với mức giá hợp lý, chung cu eco dream là cơ hội đầu tư sinh lời cho nhà đầu tư. Ngoài ra, chung cư Housinco grand tower cũng là dự án nổi bật với hơn 200 căn hộ đạt chuẩn 5 sao. Chung cư Vinhomes gallery là siêu dự án trung tâm quận Ba Đình, chung cư Vinata Towers là dự án đầu tiên được đầu tư bởi Nhật Bản. Chung cư eco green city chỉ còn hơn 100 căn hộ cuối cùng. Chung cư The legend sở hữu vị trí trung tâm quận Thanh xuân. Chung cư Tháp doanh nhân vị trí đắc địa quận Hà đông.

Malaysia Escorts said...

Vip Karachi Escorts

Malaysia Escorts said...

Escorts Girls in Lahore

Malaysia Escorts said...

Lahore Escorts Girls

Malaysia Escorts said...

Karachi Escorts Girls

Malaysia Escorts said...

http://www.dubaiescorts.xyz/

Jian Zhuo said...

coach outlet
mlb jerseys
michael kors outlet store
tory burch outlet online
adidas uk
hermes bags
adidas yeezy boost
ralph lauren outlet online
adidas nmd runner
beats wireless headphones
20170412yueqin

Jian Zhuo said...

coach outlet
mlb jerseys
michael kors outlet store
tory burch outlet online
adidas uk
hermes bags
adidas yeezy boost
ralph lauren outlet online
adidas nmd runner
beats wireless headphones
20170412yueqin

Malaysia Escorts said...

Vip Dubai Escorts Net

Malaysia Escorts said...

Dubai Life UAE

Malaysia Escorts said...

Vip Dubai Life

chenmeinv0 said...

cheap oakley sunglasses
oakley sunglasses
christian louboutin heels
oakley sunglasses outlet
coach outlet online
oakley vault
nike air max uk
oakley sunglasses cheap
nike air max
valentino heels
hzx20170418

Malaysia Escorts said...

Dubai Life

Malaysia Escorts said...

Vip Dubai Life

Malaysia Escorts said...

Vip Dubai Girls Life

Ma Xin said...

http://www.nikeing.com.tw/

huali10 Cai said...

michael kors outlet clearance
polo ralph lauren
kate spade uk
mont blanc pens
christian louboutin shoes
coach outlet
michael kors outlet online
cheap oakley sunglasses
coach outlet
hollister shirts
qqqqqing20170524

peyman shams said...

لایسنس میکروتیک
خرید لایسنس میکروتیک
کرک میکروتیک
لایسنس 6 میکروتیک
لایسنس 5 میکروتیک
لایسنس 4 میکروتیک
میکروتیک لایسنس
license mikrotik
license mikrotik iran
license میکروتیک
میکروتیک license
فروش لایسنس میکروتیک
لایسنس میکروتیک ایران
لایسنس میکروتیک نوران
کرک لایسنس میکروتیک
کرک mikrotik
لایسنس mikrotik
تهیه لایسنس میکروتیک
لایسنس ارزان میکروتیک
لایسنس لول6 میکروتیک
لایسنس لول5 میکروتیک
لایسنس لول4 میکروتیک
لایسنس لول 6 میکروتیک
لایسنس لول 5 میکروتیک
لایسنس لول 4 میکروتیک
license level 6 میکروتیک
license level 5 میکروتیک
license level 4 میکروتیک
لایسنس level 6 میکروتیک
لایسنس level 5 میکروتیک
لایسنس level 4 میکروتیک
خرید لایسنس 6 میکروتیک
خرید لایسنس 5 میکروتیک
خرید لایسنس 4 میکروتیک
لایسنس روتر میکروتیک
لایسنس های RouterOS میکروتیک
لایسنس سطح 4 میکروتیک
لایسنس سطح 5 میکروتیک
لایسنس سطح 6 میکروتیک
لایسنس روتربرد میکروتیک
لایسنس روتربورد میکروتیک
Mikrotik RouterOS Level 4
Mikrotik RouterOS Level 5
Mikrotik RouterOS Level 6
خرید اینترنتی لایسنس میکروتیک
خرید آنلاین لایسنس میکروتیک

peyman shams said...


لایسنس میکروتیک
خرید لایسنس میکروتیک
کرک میکروتیک
لایسنس 6 میکروتیک
لایسنس 5 میکروتیک
لایسنس 4 میکروتیک
میکروتیک لایسنس
license mikrotik
license mikrotik iran
license میکروتیک
میکروتیک license
فروش لایسنس میکروتیک
لایسنس میکروتیک ایران
لایسنس میکروتیک نوران
کرک لایسنس میکروتیک
کرک mikrotik
لایسنس mikrotik
تهیه لایسنس میکروتیک
لایسنس ارزان میکروتیک
لایسنس لول6 میکروتیک
لایسنس لول5 میکروتیک
لایسنس لول4 میکروتیک
لایسنس لول 6 میکروتیک
لایسنس لول 5 میکروتیک
لایسنس لول 4 میکروتیک
license level 6 میکروتیک
license level 5 میکروتیک
license level 4 میکروتیک
لایسنس level 6 میکروتیک
لایسنس level 5 میکروتیک




peyman shams said...

لایسنس level 4 میکروتیک
خرید لایسنس 6 میکروتیک
خرید لایسنس 5 میکروتیک
خرید لایسنس 4 میکروتیک
لایسنس روتر میکروتیک
لایسنس های RouterOS میکروتیک
لایسنس سطح 4 میکروتیک
لایسنس سطح 5 میکروتیک
لایسنس سطح 6 میکروتیک
لایسنس روتربرد میکروتیک
لایسنس روتربورد میکروتیک
Mikrotik RouterOS Level 4
Mikrotik RouterOS Level 5
Mikrotik RouterOS Level 6
خرید اینترنتی لایسنس میکروتیک
خرید آنلاین لایسنس میکروتیک

NITROCOM said...

The Nitrocom vendor portfolio is a strong and carefully selected collection of the world’s leading wireless, cloud & security innovators. Each vendor is individually outstanding whilst also able to work together to create a simple, yet sophisticated solution.
SIAE MICROELETTRONICA was founded in 1952. Now we are internationally renowned as a leading provider of the most innovative and best performing microwave radio and wireless network solutions. Our equipment enables millions of people in over 90 countries to communicate around the world every day. As an intrinsic element of modern network infrastructure, our customers demand the highest quality, value for money and innovative telecommunications products.
Cambium Networks offers a comprehensive portfolio of fixed reliable, scalable & high-speed wireless backhaul and access solutions.

Post a Comment

Search Web......