- 浏览: 145474 次
- 性别:
- 来自: 深圳
-
文章分类
- 全部博客 (88)
- struts (8)
- js (8)
- hibernate (11)
- spring (1)
- j2ee (1)
- ajax (1)
- oracle (21)
- mysql (4)
- tomcat (1)
- php (0)
- java设计模式 (0)
- jms (0)
- 感言 (1)
- linux (0)
- 算法 (1)
- velocity (2)
- python (0)
- prototype (2)
- axis (0)
- Test (4)
- java (5)
- 模板 (1)
- 服务器 (0)
- 移动互联网 (0)
- hadoop (0)
- impala (0)
- hive (0)
- hdfs (0)
- mongodb (0)
- storm (0)
- spark (0)
- flume (0)
- kafka (0)
- 管理知识 (9)
最新评论
-
cwftalus:
insert into 无法实现
Infobright入库 -
红级主:
问题是我就不知道sys的密码,进入其他的用户也改不了密码吧?
ORACLE 中更改用户密码的方法
出现此错误的原因是在用ajax进行数据验证是出现的错误,在执行mapping.findForward("add");之前,已经将相应结果返回客户端,由于重复提交response,
注释的部分引起的
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close();
response 相应在mapping.findForward("add");前就执行了,在执行mapping.findForward("add");是相当与有多个响应执行,将
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close(); 注释掉 就可以了,并在页面中出去所有的值进行验证。
出现这样的错误,具体的错误;
public ActionForward userIsExist(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
request.setCharacterEncoding("gb2312");
response.setContentType("text/xml;charset=GB2312");
response.setHeader("Cache-Control", "no-cache");
String account1 = (String) request.getParameter("account");
System.out.println("account1 = " + account1);
// ---
String msgStr="";
String user_id = request.getParameter("user_id");
if (user_id == null | user_id.length() <= 0) {
}
boolean isExist_ = false;
UserService ss = getManager("UserService ");
List list = ss.find("from User u where u.user_id=" + user_id);
if (list == null || list.size() <= 0) {
ActionMessages messages = new ActionMessages();
ActionMessage message = new ActionMessage(
"user.add.form.isnot.exist");
messages.add("isNotExist", message);
this.saveErrors(request, messages);
msgStr="此账号可以使用";
} else {
ActionMessages messages = new ActionMessages();
ActionMessage message = new ActionMessage(
"user.add.form.isnot.exist");
messages.add("isExist", message);
this.saveErrors(request, messages);
msgStr="数据库中存在此账号,请换另外一个账号";
}
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close();
return mapping.findForward("add");
}
response在forward()执行前已经返回 ,由于重复提交response,所以出现这样的错误
16:28:18,276 ERROR [action]:260 - Servlet.service() for servlet action threw exception
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.cn.bireport.common.CharacterEncodeFilter.doFilter(CharacterEncodeFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
注释的部分引起的
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close();
response 相应在mapping.findForward("add");前就执行了,在执行mapping.findForward("add");是相当与有多个响应执行,将
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close(); 注释掉 就可以了,并在页面中出去所有的值进行验证。
出现这样的错误,具体的错误;
public ActionForward userIsExist(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
request.setCharacterEncoding("gb2312");
response.setContentType("text/xml;charset=GB2312");
response.setHeader("Cache-Control", "no-cache");
String account1 = (String) request.getParameter("account");
System.out.println("account1 = " + account1);
// ---
String msgStr="";
String user_id = request.getParameter("user_id");
if (user_id == null | user_id.length() <= 0) {
}
boolean isExist_ = false;
UserService ss = getManager("UserService ");
List list = ss.find("from User u where u.user_id=" + user_id);
if (list == null || list.size() <= 0) {
ActionMessages messages = new ActionMessages();
ActionMessage message = new ActionMessage(
"user.add.form.isnot.exist");
messages.add("isNotExist", message);
this.saveErrors(request, messages);
msgStr="此账号可以使用";
} else {
ActionMessages messages = new ActionMessages();
ActionMessage message = new ActionMessage(
"user.add.form.isnot.exist");
messages.add("isExist", message);
this.saveErrors(request, messages);
msgStr="数据库中存在此账号,请换另外一个账号";
}
// response.getWriter()
// .println("<?xml version='1.0' encoding='GB2312' ?>");
// response.getWriter().println("<root>");
// response.getWriter().println("<content>");
// response.getWriter().print(msgStr);
// response.getWriter().println("</content>");
// response.getWriter().println("</root>");
//
// response.getWriter().close();
return mapping.findForward("add");
}
response在forward()执行前已经返回 ,由于重复提交response,所以出现这样的错误
16:28:18,276 ERROR [action]:260 - Servlet.service() for servlet action threw exception
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.cn.bireport.common.CharacterEncodeFilter.doFilter(CharacterEncodeFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
发表评论
-
org.apache.struts2.dispatcher.FilterDispatcher
2009-05-17 16:05 01.org.apache.struts2.dispatcher ... -
Struts中的styleId相当于id
2009-04-21 22:00 1080<html:text readonly="tr ... -
张孝祥专栏
2009-04-21 18:57 1414http://blog.csdn.net/zhangxiaox ... -
Struts Validator的使用
2009-04-21 15:53 749http://www.javaresearch.org/ar ... -
No form found under '..' in locale 'en_US'
2009-04-21 14:36 3201http://chrislee.iteye.com/categ ... -
org.apache.commons.beanutils.NestedNullException:
2009-04-17 21:52 021:50:10,359 ERROR [jsp]:711 - ... -
while loading persisted sessions: java.io.EOFExcep
2009-04-04 21:09 0错误描述:....while loading persiste ... -
tag bean:write must be empty, but is not
2009-03-31 10:39 2829在标签结束少了这个"/"结束符(或者< ... -
JSTL的问题
2009-03-25 12:38 0JSTL的问题(According to TLD or att ... -
struts1 logic标签的使用
2009-03-25 12:37 0struts1 logic标签的使用 struts标签使用举例 ... -
Eclipse无法自动编译出class文件
2009-03-23 09:56 0Eclipse无法自动编译出cla ... -
struts 异常:does not contain handler parameter name
2009-03-05 10:28 2920出现此异常的原因是 struts-config.xml 文件中 ... -
struts 异常
2009-03-04 15:30 907后台 Action中为 String id =request. ...
相关推荐
在Java的Web开发中,`java.lang.IllegalStateException: Cannot call sendError() after the response has been committed` 是一个常见的错误,通常发生在尝试在HTTP响应已经发送到客户端之后调用`sendError()`方法...
prerequisite patches in an unstable way, which has been updated to compute in a way that is compatible with "git patch-id --stable". * The "git log" command by default behaves as if the --mailmap ...
java.lang.IllegalStateException: Can't sendRedirect() after data has been committed to the client. ``` 解决办法是在进行任何输出之前先检查是否需要重定向。 #### 二、`response.setHeader("Location", "")`...
使用@SessionAttributes 和@ResponseBody 或者@RestController 注解配合使用时,可能会报 Cannot create a session after the response has been committed 错误。解决方法是在 return 之前自己创建 session。 本...
These dummy transactions get committed when everything is idle (after there has been some activity).
- 而`RequestDispatcher.forward(ServletRequest request, ServletResponse response)`则是在服务器端将请求转发到另一个资源,不改变当前URL。 7. **写入响应体** 通过`getOutputStream()`或`getWriter()`方法,...
Section=ResponseHeader Detail=CR 后面必须是 LF The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF 主体意思是微软没有容忍不符合RFC 822...
在探讨数据库事务隔离级别时,Read Committed(简称RC)是一个重要的概念。RC隔离级别意味着,当事务运行期间,如果别的事务对数据进行修改并且提交了,当前事务是可以读取到这些修改后的数据的。然而,这也导致了不...
【标题】"temboard-master_python_Committed_" 指向的是一个与 PostgreSQL 数据库管理和监控相关的项目,其中可能包含了使用 Python 编写的工具或模块。"Committed" 在这里很可能是指 PostgreSQL 的事务隔离级别之一...
在版本控制系统Subversion(简称svn)中,有四个关键词经常被使用:BASE、HEAD、COMMITTED和PREV,它们是用来追踪文件和目录在不同版本状态的关键。这些关键词对于理解和操作svn仓库至关重要,尤其是在进行协同开发...
Number of committers has been determined by going through CVS logs from January 1st, 2004 to December 31st, 2004 and contributors by going through the list of contributions and problem reports. ...
curl for windows10 x64 , version Version 7.56.1 (23 Oct 2017) Daniel Stenberg (23 Oct 2017) - RELEASE-NOTES: 7.56.1 ...- imap: if a FETCH response has no size, don't call write callback
### 效率证明:承诺数字位于特定区间 #### 摘要 本文介绍了一种新的高效证明方法,用于证明一个已经承诺的数字位于一个特定区间内。与以往的方法相比,该方法不仅更有效率(计算和传输的数据量较少),而且更为...
Response already committed. 的异常。解决方法是升级到 6.1.0.17 版本。 9. 修改 Websphere 的 JSP 编译 JDK 版本 修改 Websphere 的 JSP 编译 JDK 版本可以解决一些问题。修改方法是,找到发布之后的应用目录,...
“has been maintaining”表示从1983年开始并一直持续到现在的一个动作,符合题意,因此选项D为最佳答案。 ##### 例题3: - **原文**: He was lured into a crime he would not __________ have committed. - **...
Read Committed(读已提交)是常见的隔离级别之一,它确保一个事务只能看到其他已经提交的事务的结果,而忽略未提交的更改。在MySQL等关系型数据库管理系统中,Read Committed级别的实现依赖于一种称为ReadView的...
released the first version of the XtraGrid Suite, our focus has been to deliver ground-breaking new capabilities for Visual Studio .NET®. With XtraGrid Suite v2, you have at your disposal a ...
Returns a boolean indicating whether the named response header has already been set. contextDestroyed(ServletContextEvent) - Method in interface javax.servlet.ServletContextListener Notification ...
NEW *-在侧面菜单中添加了Committed源代码的链接,以便任何有兴趣的人都可以参与! 更新3.0.2-您现在可以选择将待办事项存储在本地存储或Chrome存储中-漏洞修复更新3.0.1-创建待办事项列表-添加待办事项的链接-...