Skip to main content

Implicit objects in JSP page

By default page, request, session and application objects are available to JSP pages. So you can access then using EL syntax.
And following table shows IMPLICIT objects available to EL.
       Implicit object            Description
1.     pageScope        Scoped variables from page scope
2.     requestScope     Scoped variables from request scope
3.     sessionScope     Scoped variables from session scope
4.     applicationScope Scoped variables from application scope
5.     param            Request parameters as strings
6.     paramValues      Request parameters as collections of strings
7.     header           HTTP request headers as strings
8.     headerValues     HTTP request headers as collections of strings
9.     initParam        Context-initialization parameters
10.    cookie           Cookie values
11.    pageContext      The JSP PageContext object for the current page
So session and sessionScope are same but differs in context they are used.More specifically session is object and sessionScope is map (key, value) of Attribute and its value.
  • If you say ${session.sessionAttr} it refers to session object available to JSP page.
  • If you say ${sessionScope.sessionAttr} it refers to IMPLICIT session object available to EL.
  • Or if you just say {attrName} it will search attrName in all scope from page to application scope.

Comments

Popular posts from this blog

Trip to narsipura Sri Vaidya Narayana murthy - Shimago for cancer treatment

Hi friends. I would like to share my experience about my trip to Shimago and meet Guru Narayana murthy who would treat for cancer, diabetics, kidney diseases. My brother was diagnosed with rectal cancer on October 2014. The news of cancer to a young boy of 26 years shook our whole family. But we are strong as he was getting treatment from world class care clinic in Cleveland - Cleveland clinic, Ohio, USA. As fate had other plans, his cancer came in January, 2017 back after an extensive surgery, chemotherapy and radiotherapy. The doctors made a decision to keep him in hospice care: support for advanced illness. They said that there is no more treatment and only to keep him comfortable as long as he lives, we lost our hopes and that is when we thought of giving a try to Ayurvedic medicine. We found Guruji narasipura narayana murthy. His medicine gave us hopes and I recently went to narsipura to get the medicine. I thought it would be best to give my share of experience in reaching the

Solution to "child margin affects parent" in CSS

The browser implementation is that when the parent has no content and the child requests for margin, the parent is brought down instead of child going down. The solution for these are listed below with their side effects. floats , You  have  to float elements border-top , This pushes the parent at least 1px downwards which should then be adjusted with introducing  -1px  margin to the parent element itself. This can create problems when parent already has  margin-top  in relative units. padding-top , same effect as using  border-top overflow: hidden , Can't be used when parent should display overflowing content, like a drop down menu overflow: auto , Introduces scrollbars for parent element that has (intentionally) overflowing content (like shadows or tool tip's triangle) See the Pen Relative with Margin by Manikanta ( @immnk ) on CodePen .

Redirection in javascript

How Page Re-direction works ? Example 1: This is very simple to do a page redirect using JavaScript at client side. To redirect your site visitors to a new page, you just need to add a line in your head section as follows: <head> <script type="text/javascript"> <!-- window.location="http://www.newlocation.com"; --> </script> </head> To understand it in better way you can  Try it yourself . Example 2: You can show an appropriate message to your site visitors before redirecting them to a new page. This would need a bit time delay to load a new page. Following is the simple example to implement the same: <head> <script type="text/javascript"> <!-- function Redirect() { window.location="http://www.newlocation.com"; } document.write("You will be redirected to main page in 10 sec."); setTimeout('Redirect()', 10000); //--> </script> </head> Here