网页端传中文 出现乱码 怎么解决呢
@IocBean
@At("/cate")
@Fail("http:500")
public class CategoryModule {
@Inject
public CategoryService categoryService;
@At
@Ok("raw")
public String add(@Param("name") String name,
@Param("pId") int pId) throws UnsupportedEncodingException {
Category cate = new Category();
String uName = URLEncoder.encode(name, "UTF-8");
cate.setCate_name(uName);
cate.setCate_parentid(pId);
categoryService.addCate(cate);
return null;
}
}