Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /home2/learnera/public_html/tech/wp-includes/wp-db.php on line 760

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /home2/learnera/public_html/tech/wp-includes/wp-db.php on line 760

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /home2/learnera/public_html/tech/wp-includes/wp-db.php on line 760

Deprecated: Creation of dynamic property WPtouchProFour::$settings_object is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/wptouch/core/class-wptouch-pro.php on line 82

Deprecated: Automatic conversion of false to array is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/wptouch/core/admin-load.php on line 70

Deprecated: Creation of dynamic property WP_Block_Type::$skip_inner_blocks is deprecated in /home2/learnera/public_html/tech/wp-includes/class-wp-block-type.php on line 391

Deprecated: Creation of dynamic property WP_Block_Type::$skip_inner_blocks is deprecated in /home2/learnera/public_html/tech/wp-includes/class-wp-block-type.php on line 391

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_classic_block is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 347

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 349

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block_side is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 350

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$panels_block is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 351

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$used_block_buttons is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 354

Deprecated: Creation of dynamic property YARPP::$is_custom_template is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Core.php on line 56

Deprecated: Creation of dynamic property YARPP::$db_options is deprecated in /home2/learnera/public_html/tech/wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Core.php on line 69

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /home2/learnera/public_html/tech/wp-includes/class-wp-term-query.php on line 1118

Deprecated: Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Cookie/Jar.php on line 63

Deprecated: Return type of Requests_Cookie_Jar::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Cookie/Jar.php on line 73

Deprecated: Return type of Requests_Cookie_Jar::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Cookie/Jar.php on line 89

Deprecated: Return type of Requests_Cookie_Jar::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Cookie/Jar.php on line 102

Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Cookie/Jar.php on line 111

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82

Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home2/learnera/public_html/tech/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723

Warning: Cannot modify header information - headers already sent by (output started at /home2/learnera/public_html/tech/wp-includes/wp-db.php:760) in /home2/learnera/public_html/tech/wp-includes/rest-api/class-wp-rest-server.php on line 1723
{"id":5,"date":"2014-05-09T04:10:22","date_gmt":"2014-05-09T04:10:22","guid":{"rendered":"http:\/\/tech.learnerandtutor.com\/?p=5"},"modified":"2014-05-25T03:17:17","modified_gmt":"2014-05-25T03:17:17","slug":"struts2-tutorial-session-1-introduction","status":"publish","type":"post","link":"https:\/\/tech.learnerandtutor.com\/struts2-tutorial-session-1-introduction\/","title":{"rendered":"Struts2 Tutorial Part 1 – Introduction"},"content":{"rendered":"

Struts2<\/b> is a modern framework to develop java based web application. It follows the MVC architecture. If we are aware of jsp\/servlet then Struts2 can be easily learned.<\/p>\n

Why Struts 2?<\/h6>\n

We have several methodologies to develop web application. Then why Struts2?\u00a0Below are the key reasons.<\/p>\n

Minimal code<\/h5>\n

If we setup the Struts 2 environment most of the activities like login verification, authorization flow, pre and post activities will be take care by the framework. We can only concentrate on the real work. (Will learn later in detail)<\/p>\n

Compatible with other technologies<\/h5>\n

Easy to integrate with other technologies like Spring. (Will learn later in detail)<\/p>\n

Purely Java based (POJO objects)<\/h5>\n

Any java object can be a struts2 class. If we aware of java that is enough to use this framework. (Will learn later in detail)<\/p>\n

Custom Stuts2 UI tags<\/h5>\n

\u2013\u00a0Struts2 provides huge set of custom tags. By using the framework custom tags we can rapidly minimize the code. (Will learn later in detail)
\n<\/p>\n

AJAX Support<\/h5>\n

Stuts2 has inbuilt ajax support. It can be simply used from struts2 custom tag. (Will learn later in detail)<\/p>\n

Struts2\u00a0also has other benefits. \u00a0But in the starting level the above points are enough to understand the usefulness of this framework.<\/p>\n

Struts2 against normal jsp\/servlet<\/h6>\n

If you aware of servlet the flow of the application will be controlled by the web.xml file where all the configuration settings will be given. This xml file will be responsible to make sure the user s logged in before accessing particular resource by adding filters.<\/p>\n

But Struts2 will provide all these necessary settings by default. The only thing is we have to just write the implementation logic. (When we develop our first Hello World application we will see in detail).<\/p>\n

Struts2 Flow<\/h6>\n

Before understanding the flow we should know the below terms first.<\/p>\n

Actions:<\/h6>\n

Actions are java methods in real, where the real logic will be present.<\/p>\n

Interceptors:<\/h6>\n

Interceptors are the one of the key points in Struts2 framework. In real it is also a java class. The roles of Interceptors are controlling the workflow as well as pre and post processing activities. (Will know details in the Interceptor chapter)<\/p>\n

Value Stack:<\/h6>\n

Where the variable will be stored and retrieved.\"Struts2-Architecture\"<\/a><\/p>\n

Even the above flow looks messy it is simple to understand. Al the requests received will be go to the interceptors we defined before running the actual code. Once the interceptors code executed they will go to the actual code. Finally the control will go to the interceptor in reverse order before sending the response back to the client.<\/p>\n

To understand the flow in simple see the image below.
\n
\"struts-2-request-cycle\"<\/a><\/p>\n

With this we will complete the introduction to Struts2. While developing the first Hello World application we will see the flow and other options in detail.<\/p>\n","protected":false},"excerpt":{"rendered":"

Struts2 is a modern framework to develop java based web application. It follows the MVC architecture. If we are aware of jsp\/servlet then Struts2 can be easily learned. Why Struts 2? We have several methodologies to develop web application. Then … Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":6,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[3],"_links":{"self":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":32,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":382,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/5\/revisions\/382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/media\/6"}],"wp:attachment":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}