站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题求助:-lt;html:errors/-gt;错误

求助:-lt;html:errors/-gt;错误

摘要: 求助:错误


错误信息:
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /form/hello.jsp:14

11:
12:


13:
14:


15:
16:
17:



以下是hello.jsp代码
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


<head>
<bean:message key="hello.jsp.title"/>

</head>
<body bgcolor="white">










!


















</body>

以下是配置文件信息:
<?xml version="1.0" encoding="UTF-8"?>
struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">



<form-beans >
<form-bean name="helloForm" type="com.kook.struts.form.HelloForm" />

</form-beans>




attribute="helloForm"
input="/form/hello.jsp"
name="helloForm"
path="/hello"
scope="request"
validate="true"
type="com.kook.struts.action.HelloAction">








以下是helloForm的验证方法:
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if ((userName == null) || (userName.length() < 1))
{
errors.add("username", new ActionMessage("hello.no.username.error"));
}
return errors;
}

请高手帮忙,已经郁闷一个下午了~小弟在此拜谢了~


第四行不是那行
看看work目录下的文件


你的Struts版本是多少.


我用的是Struts1.1的


flyingdancing2005(游戏人生)

兄弟,不明白你说的意思啊,能具体点么?

我在线


将 errors.add("username", new ActionMessage("hello.no.username.error"));
改为 errors.add("username", new ActionError("hello.no.username.error"));
试试


谢谢楼上的弟兄们,用teddys() 的方法问题解决了.
不过新的问题又来了
errors.add("username", new ActionMessage("hello.no.username.error"));
与errors.add("username", new ActionError("hello.no.username.error"));
有什么分别??



↑返回目录
前一篇: jsp能不能单步调试呢?
后一篇: jfreechart难题,请高手解决!高分回馈