Hallo,
was ist falsch an Code?
ich habe folgendes
in my/package/Resource.properties:
errors.header=<b>
errors.nic=darf nicht LEER sein
errors.footer=</b>
in web.xml:
<servlet>
...
<init-param>
<param-name>application</param-name>
<param-value>my.package.Resource</param-value>
</init-param>
...
</servlet>
in NewUserForm:
...
public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (nic.equals("")) {
errors.add("nic", new ActionError("errors.nic"));
}
return errors;
}
...
und in ausgabe.jsp
<body>
<html:errors/><br/>
...
</body>
Also wenn in den Textfeld nichts eingegeben wird, soll ich die Meldung "darf nicht LEER sein" bekommen, oder? Ich bekomme aber
HTTP Status 500 - No input attribute for mapping path /newuser
--------------------------------------------------------------------------------
type Status report
message No input attribute for mapping path /newuser
description The server encountered an internal error (No input attribute for mapping path /newuser) that prevented it from fulfilling this request.
--------------------------------------------------------------------------------
Apache Tomcat/4.1.30
Was ist falsch?
was ist falsch an Code?
ich habe folgendes
in my/package/Resource.properties:
errors.header=<b>
errors.nic=darf nicht LEER sein
errors.footer=</b>
in web.xml:
<servlet>
...
<init-param>
<param-name>application</param-name>
<param-value>my.package.Resource</param-value>
</init-param>
...
</servlet>
in NewUserForm:
...
public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (nic.equals("")) {
errors.add("nic", new ActionError("errors.nic"));
}
return errors;
}
...
und in ausgabe.jsp
<body>
<html:errors/><br/>
...
</body>
Also wenn in den Textfeld nichts eingegeben wird, soll ich die Meldung "darf nicht LEER sein" bekommen, oder? Ich bekomme aber
HTTP Status 500 - No input attribute for mapping path /newuser
--------------------------------------------------------------------------------
type Status report
message No input attribute for mapping path /newuser
description The server encountered an internal error (No input attribute for mapping path /newuser) that prevented it from fulfilling this request.
--------------------------------------------------------------------------------
Apache Tomcat/4.1.30
Was ist falsch?
Comment