讄工作I间的项目编? 防止出现q
Window - Preferences - General - Workspace ?Text file encoding"选ؓ"Other" - "UTF-8" 改变现有目的编码的步骤: 叛_目属? 选择"Text file encoding"的编?br /> 讄其它文g的编?/strong> Window -> Preferences -> General -> Content Types 需要设|的文g讄~码, 最好统一设ؓUTF-8 讄? 如Javascript文g可正常显CZ?br /> 讄创徏JSP面?JSP的默认编码设为UTF-8 Window -> Preferences -> MyEclipse -> Files and Editors -> JSP ?Encoding"选ؓ"ISO10646/Unicode(UTF-8) L格式化JSP旉面中的空?/strong> Window -> Preferences -> MyEclipse -> HTML -> HTML Source N?Clear all blank lines" 增强Eclipse的自动代码提C功?/strong> 默认? 只有?."?Alt + /"才出C码提C功? 不够强大, 作小设|? 可将代码提示功能像VS的一h?br /> 1. Window -> Preferences -> Java -> Editor -> Content Assist 2. ?Auto Activation triggers for java"讄?.abc"(默认?."), ?Apply"应用 3. 导出目前的Eclipse配置文g: File -> Export -> General -> Perferences, 选择保存路径, 保存得到*.epf文g 4. 用文本编辑器打开刚才保存?.epf文g, 搜烦".abc", ?.abc"部分改ؓ ".abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(," (以上动提C的触发字符, Ҏ(gu)个h习惯讄), 保存此配|文?个h觉得不太好用Q容易出?/span>) 5. 导入此配|文? File -> import -> General -> Perferences, 导入修改后的配置文g. W一个选项为反应时?可设?00左右(默认200) 高亮cM同一引用的用位|?/strong> Window -> Perferences -> General - > Editors -> TextEditors -> Annotations 选择"Occurrences",勑ּ"Text as" -> "Highlighted"(块高??Squiggles"(虚线) Link with Editor 打开cd, 自动在包理器这里显C类的位|?/div> ![]() 取消Myeclipse的自动文仉?/strong>(卡傻的原? Windows –> Perferences –>Myeclipse –> Validation 保留manual(手动)部分Qbuild下只?classpath dependency Validator" 手动验证: 右键文g -> Myeclipse -> Run Validation 取消拼写错误?/strong> 我爱故意写错单词, 不需要系l帮我检?br /> Windows –> perferences –> General –> Editors-> Text Editors -> Spelling L"Enable spell checking"N?br /> 关闭不需要的启动?/strong> MyEclipse:
Windows –> Perferences–> General–> Startup and Shutdown 我只保留?br /> ![]() ![]() 序下来: 1, Tomcat6: 必备?.. 2, 内存监视? 可以查看Myeclipse的用内? 我喜Ƣ这工具(在菜单Myeclipse - Utilities - Show Heap Status打开) 3, JSP Debug工具, 其实我也没用q? 怕有一天用?.. 4, 文g创徏向导(个hl常用到) 5, 向后兼容的意思吧, 怕有一天会用到, 但其实很用, 可去?br /> 6, 透视? 应该可以L?.. 其实只用选择Tomcat6 关闭自动更新 1, Eclipse: Windows –> Perferences–> Install/Update -> Automatic Updates 不勾?Automatically find new updates and notify me" 2, Myeclipse: 1)Windows –> Perferences–> MyEclipse... -> Community Essentials &nb sp; 不勾?Search for new features at startup" 2)Windows –> Perferences–> MyEclipse... -> Maven4MyEclipse 不勾?Download repository index updates on startup" |
Cookie
Session
存储在客L
存储在服务器?/span>
两种cd
l 有声明周?/span>
l 无声明周?/span>
两种实现方式
l 依赖?font face="Times New Roman">cookie
l url重写
父\径不能访问子路径?font face="Times New Roman">cookie
同一?font face="Times New Roman">session的窗口共享一?/font>session
典型应用Q?/span>
l 3个月不用再登?/font>
l 购物车(http://www.china-pub.com/Q?/span>
典型应用Q?/span>
l 用户登陆
l 购物车也可以?font face="Times New Roman">session实现?#183;
不可?/span>
可靠
1.场合Q页面本w有中文的时?/span>
解决办法Q?br />
servletQ?/font>resp.setContentType("text/html;charset=gbk");
Jsp: <%@ page contentType="text/html;charset=gb2312"%>
注意Q一定要写在PrintWriter out = resp.getWriter();之前
2.场合Q解?font face="Times New Roman">get方式q问题Q?/font>
解决办法Q修?font face="Times New Roman">server.xml àURIEncoding="GBK"
3.场合Q?/span>解决post方式提交内容的ؕ?/font>
解决办法Q?/span>request.setCharacterEncoding("GBK");
注意Q?br />
一定要写在存取W一个参C?/span>
不要调用response.setCharacterEncoding("GBK");
4.场合Q?/span><jsp:param name="user" value="<%=s%>"/>Q?font face="Times New Roman">url地址包含中文参数
解决办法Q?/span><%request.setCharacterEncoding("GBK");%>