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":430,"date":"2014-05-28T10:39:19","date_gmt":"2014-05-28T10:39:19","guid":{"rendered":"http:\/\/tech.learnerandtutor.com\/?p=430"},"modified":"2014-05-28T10:39:19","modified_gmt":"2014-05-28T10:39:19","slug":"struts2-tutorial-part-5-namespaces","status":"publish","type":"post","link":"https:\/\/tech.learnerandtutor.com\/struts2-tutorial-part-5-namespaces\/","title":{"rendered":"Struts2 Tutorial Part 5 \u2013 Namespaces"},"content":{"rendered":"In this session we will discuss about Struts2 namespaces.Struts2 namespaces are the Namespaces of the URL accessed.<\/p>\n
For example if a user types types a URL\u00a0http:\/\/www.learnerandtutor.com\/struts2\/actions\/method.action<\/span>\u00a0 in that\u00a0\/struts2\/action<\/span>\u00a0 is namespace and\u00a0method.action<\/span>\u00a0 is the action name.<\/p>\nWhile naming a namespace we have to keep the below points in mind.<\/p>\n
\n- A namespace will be like “\/path1\/subpath”, “\/path2\/path3\/sub1”.<\/li>\n
- A namespace can also be root namespace. (i.e) namespace=”\/”. But it is exactly like normal namespace. The URL should match for it.<\/li>\n
- For example if the url is “www.learner.com\/rajesh.action” it will go to root namespace. If the url is “www.learner.com\/path1\/subpath” it will go to “\/path1\/subpath” namespace.<\/li>\n
- We can also create default namespace where we can put default actions. That means if the requested action is not found in any specific namespaces then the control will look for that action inside the default namespace. The default namespace syntax will be<\/li>\n<\/ul>\n
<package name=\"serveAll\" namespace=\"\" extends=\"struts-default\">\r\n .\r\n .\r\n .\r\n<\/package>\r\n<\/pre>\nOne useful example of this default is we can handle all the unknown requests with the the simple setup like below.<\/p>\n
<package name=\"serveAll\" namespace=\"\" extends=\"struts-default\">\r\n <action name=\"*\">\r\n <result>\/error.jsp<\/result>\r\n <\/action>\r\n<\/package><\/pre>\nWhat we done is, if any requested action is not found simply responding with error page instead of file not found error. That’s why we put the action name as *. So even if the user types an action name asdasdasd it will respond with error.jsp . Even we can use wild card characters also in action name. In later chapters we will work on wild char characters in action names.<\/p>\n","protected":false},"excerpt":{"rendered":"
In this session we will discuss about Struts2 namespaces.Struts2 namespaces are the Namespaces of the URL accessed. For example if a user types types a URL\u00a0http:\/\/www.learnerandtutor.com\/struts2\/actions\/method.action\u00a0 in that\u00a0\/struts2\/action\u00a0 is namespace and\u00a0method.action\u00a0 is the action name. While naming a namespace we … Continue reading →<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[27,3],"_links":{"self":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/430"}],"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=430"}],"version-history":[{"count":7,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":437,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/430\/revisions\/437"}],"wp:attachment":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}