• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to display ArrayList elements through applicationScope in JSP

 
Kun Hak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am filling two ArrayLists in ServletContextListener class as follows:



I have mapped this listener class in web.xml as well. Now, I want to iterate through the two ArrayLists (listcity and liststate) in a JSP using the implicit object applicationScope using JSTL

I tried to iterate it using the following code but somehow I am not able to do it



The Listener Class is working fine but the values are not getting displayed in JSP.

I am not able to figure out the problem
 
Rodion Gork
Ranch Hand
Posts: 47
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
applicatioScope

Have you tried to fix this typo?
 
Kun Hak
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rodion Gork wrote:
applicatioScope

Have you tried to fix this typo?


I tried fixing the typo(very silly of me). Now I am getting the first 2 values value of the first ArrayList

I wanted the output
as



I am getting




Please guide me
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, why are you mashing the two lists together into a single scoped variable? You use them separately, why the complication?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!