Ramkumar Rao

Greenhorn
+ Follow
since Jun 03, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramkumar Rao

Thanks for your reply. I tried using <%@ import %> tag and still the result is same.

Also after using the import tag and updating the timestamp of the main_template.jsp page, I had a check at the generate servlet class file and it contains the modified HTML data. But the same is not been reflected in the pages.

I tried clearing off the cache, cookies and other things. But none of it worked, it looks like caching issue in server side. Any suggestions to overcome this is well appreciated
15 years ago
JSP
Currently I am developing a online shop which helps in user buying different products.

I have a main template which is common to all the pages. This template includes header, footer, main contents dynamically at run time based on conditions.

The header and footer files are stored as html files and sometimes their contents will be updated dynamically by other programs.

I expect the changes to header and footer to be reflected in the pages whenever its been changed, but its not happening currently. I've to restart the application everytime to make the new changes appear in the pages.

Can someone explain this behaviour and is there any workaround to this problem ?
15 years ago
JSP
Hi Raja,

You have the answer for your question. requestScope is not an instance of HttpServletRequest, rather its an implicit Map object provided by EL. So it can be used to get the attributes value from the request scope. We have to use pageContext implicit object to get the request object in EL.

Whereas, the request implicit object given by JSP is an instance of HttpServletRequest and can be used to access all the methods in the ServletRequest interface.
Question 3:

I guess you are bit confused with the [] operator syntax in EL. The [] operator works by evaluating the innermost operations first. But the dot operator expects the right hand operator to be a bean property or Map key. So in this case, the map attribute don't have any key named "map", so its wrong.

Question 4:

Using an integer without quotes inside [] operator works correctly for List and Arrays. In case of Map and Beans, without quotes means, container tries to find the named attribute. In this case container tries to find the attribute named "2" and it fails.