我正在尝试从我的 jsp 访问常量接口,但它显示以下错误。
Caused by: tag 'select', field 'list', name 'title':
The requested list key 'Constants.TITLE'
could not be resolved as a collection/array/map/enumeration/iterator type.
Example: people or people.{name} - [unknown location]
我的界面
public interface Constants {
public List<String> TITLE = Arrays.asList("Mr","Mrs","Ms","Miss");
// public String[] TITLE = {"MR","MRs"}; << does not work as well
//public static final String[] TITLE = {"MR","MRs"}; << does not work as well
}
我的 Jsp 代码
...
<%@page import="com.myconstants.Constants" %>
<head>
</head>
<body>
<s:form>
<s:select label="title" name="title" list="Constants.TITLE" value=" "/>
</s:form>
....