web.xml配置统一错误处理
errorPage:指定错误提示页面(转发技术)。值为一个路径。如果以"/"开头,表示绝对路径,/代表当前应用。
另一种配置错误页面的方式(非转发技术):修改web.xml,配置全局错误提示页面
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
另一种配置错误页面的方式(非转发技术):修改web.xml,配置全局错误提示页面
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
环境变量配置问题
HOME是安装目录
Path是bin的目录
CLASSPATH是lib的tools.jar目录
路径问题
相对路径:../ ./ 或直接写目录名开头
绝对路径:/开头
集合放map栈中,对象或属性放栈顶
测试是否在同一事务,只要在方法中写一个错误,看错误前面的内容有没保存,就知道了
删除的时候,如果获取不到删除参数,可能就是url不用写action
<s:a action="
pdManagerAction_deletePD.action?key=%{key}" >删除</ s:a>
cascade(默认为none),inverse(默认为false)
企业里,一般cascade不用配置,因为很少需要级联保存的情况
而inverse,多的一方保持默认(维护),一的一方设置inverse=true(不维护)即可
hibernate映射文件配置细节
<property name="approvetime" type="java.util.Date"></ property>
hibernate的映射文件,当属性为Date或Boolean类型时,不用指定长度
声明bean属性时,不能使用key做关键词,会与hibernate内部表属性有冲突,具体不详
private String processKey;
使用$.post()获取数据,查看错误在前台data打断点,因为错误数据都反馈到前台了
前台转发
<%
response.sendRedirect(request.getContextPath() + "/articleAction_listArticle.action");
%>
response.sendRedirect(request.getContextPath() + "/articleAction_listArticle.action");
%>
改变鼠标手
$("a").csss("cursor","pointer");
回到历史页面
<A HREF="javascript:history.back()">
<a href= "javascript:history.go(-1);" ><img src="${pageContext.request.contextPath} /images/goBack.png" /></a>
${ctx}
EL表达式
从四个隐含对象依次查找,看看有没有绑定 名字叫 ctx的属性,有就返回,没有就返回null
四大隐含对象按小---大范围:
pageContext 、request、session、application