2018-01-05 10:02
@小松 最粗暴的方法:在其他编辑打开(正常的), 然后复制,再粘贴到你的IDEA中打开相应文件,把乱码的覆盖掉。。。
2018-01-05 09:20
@小松 这些代码生成的原理都是渲染文本,然后保存文本的时候,文件名为.java了而已, 所以你那个“不能生成”应该是生成到其他的位置去了, 你可以试试把生成的地址先写死,指定到某个文件夹下面,再看看。 因为如果是其他的错误如文件夹权限等, 那你的代码生成时早都报错了
2018-01-04 19:14
@小松 首先确认编辑器(eclipse)的文本文件编码格式是UTF-8,
其次确认项目的编码:
最后确认Tomcat的编码:URIEncoding="UTF-8"
修改tomcat服务器下的conf文件夹下的service.xml文件。
需要修改的地方1:
URIEncoding="UTF-8" port="8009" protocol="AJP/1.3" redirectPort="8443"/>
需要修改的地方2:URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
2017-12-26 15:17
@fmpoffice
总结一下几个常用的:
model.remove("attrs1","attrs2");// 删除 多个键, 适用与删除少量不要的值。底层使用的是 map的remove
model.keep("attrs1","attrs2");// 保留需要的键, 适用与删除大量不要的值。底层使用的是 新建一个map拷贝值
model.put(model);//拷贝,不能写入数据库,可拷贝所有的键值。 底层使用的是 map的putAll
model._setAttrs(model);//拷贝,能写入数据库,只能拷贝数据库的键值(如果有其他字段,会抛出ActiveRecordException)。底层使用的是for (Entry e : attrs.entrySet()) set(e.getKey(), e.getValue());
2017-12-22 13:45
你是想这样 ?
@Override
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
if ( target.indexOf('.') != -1 && target.contains("/files/") ) {
RenderManager.me().getRenderFactory().getFileRender(new File(target));
return;
}
next.handle(target, request, response, isHandled);
}