J2EE_FAQ

1、Servlet中的转字符response.setContentType(CONTENT_TYPE); 这句应该写在PrintWriter out = response.getWriter();之前,不然起不到设置编码的作用

2、在页面查询数据库遇到这样一个错误,websphere中的JSP页面打不开

日志:
[05-4-3 17:58:26:281 CST] 22ec8e5e WebGroup E SRVE0026E: [Servlet 错误]-[Class com/ibm/db2/jcc/SQLJLogWriter violates loader constraints: definition mismatch between parent and child loaders]:java.lang.LinkageError: Class com/ibm/db2/jcc/SQLJLogWriter violates loader constraints: definition mismatch between parent and child loaders

……………………

诊断:是classLoder中出现的问题,可能有两个相同类路径

网上搜到相同的错误例子
我在WEBSPHERE上安装好了一个程序,运行一段时间后发现我安装的程序下的所有的JSP页面都无法打开,均出现如下错误:
日志:
[7/4/03 22:40:13:130 CST] 6b3c0a0d WebGroup X SRVE0026E: [Servlet Error]-[JSP 1.1 Processor]: com.ibm.servlet.engine.webapp.WebAppErrorReport: Class javax/servlet/ServletConfig violates loader constraints: definition mismatch between parent and child loaders
at com.ibm.servlet.engine.webapp.WebAppDispatcherResponse.sendError(WebAppDispatcherResponse.java:93)
……………………

诊断:
Which version of websphere? If 4.0, upgrade to fp5, and use J2EE classloader mode, you can find information in fp5 readme. Or try not use Module visibility.

3、用struts开发开发时,提示找不到bean错误
JSP页面中的struts标签总会从request或者session中取对象,在这两者中都找不到,就会事实bean can not find错误,但是另外一种情况也会这么提示

JSP相关代码:

<logic:present name="previous">

<logic:iterate id="userUnit" name="listContent" offset="start" length="page">
………………
</logic:iterate>

日志:
[05-4-5 13:47:46:719 CST] 7fa97fe5 WebGroup E SRVE0026E: [Servlet 错误]-[Cannot find bean previous in any scope]:javax.servlet.jsp.JspException: Cannot find bean previous in any scope
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
at org.apache.struts.util.RequestUtils.computeParameters(RequestUtils.java:309)
at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:462)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353)
at org.apache.jsp._adminGroupAdminList._jspService(_adminGroupAdminList.java:435)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
……………………
分析:检查后发现request中肯定已经存在previous ,强制加入scope属性也没用,在困扰了半个小时后,终于发现JSP页面中没加入logic标签
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值