mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-20 17:56:21 +08:00
修复集合类型无法获取全部值问题
This commit is contained in:
@@ -94,7 +94,7 @@ public class ExpressionUtils {
|
||||
|
||||
if ("spel".equalsIgnoreCase(language) && !var.contains("#")) {
|
||||
try {
|
||||
Object fast = BeanUtilsBean2.getInstance().getProperty(vars, var);
|
||||
Object fast = BeanUtilsBean2.getInstance().getPropertyUtils().getProperty(vars, var);
|
||||
if (fast != null) {
|
||||
return fast.toString();
|
||||
}
|
||||
|
||||
@@ -4,11 +4,18 @@ import com.alibaba.fastjson.JSON;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
|
||||
public class ExpressionUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testArray() {
|
||||
String expression = ExpressionUtils.analytical("test-${array}", Collections.singletonMap("array", Arrays.asList(1,2,3)), "spel");
|
||||
|
||||
Assert.assertEquals(expression,"test-[1, 2, 3]");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
Reference in New Issue
Block a user