Hello again:

I have a jsp code like this:

 
<div>
   <s:select name="type" list="#application.types" label="Tipo contenido:"
/>
<div>


Where I populate a select from the a ServletContext attribute:


public class UserDataListener implements HttpSessionAttributeListener,
ServletContextListener  {

        ...

        public void contextInitialized(ServletContextEvent sce) {

                ServletContext servletContext = sce.getServletContext();  
                types = new ArrayList(3);
                types.add(Constants.UNO);
                types.add(Constants.DOS);
                types.add(Constants.TRES);
                servletContext.setAttribute("types", types);

       }

      ...
}



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 
:confused: )

Any clue?

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

Thanks.
-- 
View this message in context: 
http://appfuse.547863.n4.nabble.com/Populate-a-select-with-a-list-from-servletcontext-tp2222242p2222242.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to