springmvc视图,调用不了一个截取字符的方法
小孩快跑 2018-12-25 09:29:51 我写了一个截取字段的一个类CommUtil,里面封装了一个静态方法CutString,然后Controller控制器写了
ModelAndView mv = new ModelAndView();
mv.addObject("CommUtil", new CommUtil());
return mv;
然后视图调用CutString方法:${CommUtil.CutString(“测试字符”,2)}
但是运行的时候报错
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /WEB-INF/jsp/index.jsp(266,55) The function CutString must be used with a prefix when a default namespace is not specified
请问怎么样,我才能在视图调用我写的那CutString方法方法呢??