javaweb乱码处理
String str = new String(request.getParameter(“参数名”).getBytes(“iso-8859-1”), “utf-8”);
如果需要上述代码才能获取到正常的编码,可能是本地与服务器上的Tomcat配置不一样导致的,修改server.xml的 URIEncoding=”UTF-8″
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"/>
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8"/>
http://www.shelwee.com/html/archives/67333.html
javaWeb cannot be resolved to a type
如果出现这个bug,它说明类找不到,如果代码没有报错,编译通过,bug任然出现,此时你可以clean工程,在运行。
http://bbs.csdn.net/topics/390437625
centos wifi
dmesg | grep firmware(看看有没有来自无线网卡的固件请求)
iw:
iw dev(查找无线网卡口)
iw wls1 link(查看wls1网口无线网络连接情况)
iw wls1 scan | grep SSID(查看wls1网口可连接的wifi)
ip:
ip link set wls1 up(将无线网口wls1开启)
ip link show wls1(显示无线网口wls1连接情况)
ip addr show wls1(显示分配的ip地址,特别适用于查看是否成功地通过dhcp自动获取了ip地址)
wpa_supplican:
wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase "ssid" "psk") (连接无线网ssid,密码psk)
dhclient:
dhclient wls1(为wls1分配ip地址)
http://blog.csdn.net/czmchen/article/details/46389289
centos java Web重新部署上传的文件会被删除问题
修改/tomcat/conf/web.xml
<Context path="/attachment" docBase="F:\attachment" debug="0" reloadable="fasle" privilege="true" />
比如我将F盘的attachment文件夹作为上传文件存放目录,可以通过localhost/attachment去访问里面的内容
http://bbs.csdn.net/topics/360088800?page=1#post-392844688
http://www.iteye.com/problems/99461
eclipse mac系统控制台乱码问题
http://blog.csdn.net/lqclh502/article/details/34532751
window -> Preference -> myeclipse -> servers -> tomcat -> tomcat7.0 -> JDK
optional java VM arguments :加入 -Dfile.encoding=GBK
其他乱码问题:
http://www.aiuxian.com/article/p-1943196.html
http://gogo1217.iteye.com/blog/1850899
http://bbs.csdn.net/topics/390378289?page=1