• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Populate a select with a list from servletcontext

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again:

I have a jsp code like this:



Where I populate a select from the a ServletContext attribute:




Sometimes, I found a message like "Caught an exception while evaluating expression '#application.types": java.lang.NullPointException"

I don't know what i am doing wrong (i copied the code from a struts 2 manual )

Any clue?

I also tried #application['types'], and still nothing.

Thanks.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked in an action (or servlet or whatever) to make sure it's there? I would have thought that would work.
 
Juan Acv
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have replaced #application with #attr, and it works. But I don't understand, reading struts 2 docs, #application should work.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I thought it would too (and I use it). Which version of S2 are you using?
 
Juan Acv
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2.1.8

I use appfuse framework.
reply
    Bookmark Topic Watch Topic
  • New Topic