Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

S2- How to use Constants in s:select tag

Jiang, Jane (NIH/NCI) [C]

2007-08-08

Replies:

Hi,

I am having trouble using my constants class in my jsp.

I defined a service for lookup list of values for my select box. This
in my jsp works fine

<s:select name="type" value="myVO.type"
list="%{lookupService.getList('type')}" listKey="id" listValue="type" />

But when I tried to change the list="%{lookupService.getList('type')}"
to
list="%{lookupService.getList(MyConstants.Type)}"

I got this error:

The requested list key '{%lookupService.getList(MyConstants.Type)}'
could not be resolved as a collection/array/map/enumberation/iterator
type.

I did import the constants class in the jsp. What is the right syntax
for this?

Many thanks for your help,

Jane

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.