aspose file tools*
The moose likes Struts and the fly likes Caught an exception while evaluating expression '....size()==0' against value stack Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Caught an exception while evaluating expression Watch "Caught an exception while evaluating expression New topic
Author

Caught an exception while evaluating expression '....size()==0' against value stack

Josep M Serrainat
Greenhorn

Joined: Sep 14, 2010
Posts: 16
Hi
I get this message when render a collection. "Caught an exception while evaluating expression 'contacts.size()==0' against value stack
java.lang.NullPointerException: target is null for method size"

The jsp is:


The method in action is:



The contacts is a collection of contact's of selected user. For verify the content of collection contacts, before return success, I add a simple iterator in method and printing in console all objects the collection, and this goes fine.
In action I have setter/getter of contact


In struts.xml i have this action specification



that I am making bad,
thanks for everything
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

hi josep...

you can use Jstl function ..to retrive Collection size..



For this to work You need to include JSTL namespace


Good luck!!
A small leak can sink a Gigantic ship.>
Josep M Serrainat
Greenhorn

Joined: Sep 14, 2010
Posts: 16
Hi Raza, thanks
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

have fun joseph.....('')
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Caught an exception while evaluating expression '....size()==0' against value stack