You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthias Wessendorf <ma...@matthias-wessendorf.de> on 2004/02/17 15:28:41 UTC
RE:
hi daniel
use this:
<struts-html:messages id="error" property="foo">
<struts-bean:write name="error"/>
</struts-html:messages>
cheers,
-----Original Message-----
From: Daniel [mailto:daniel@top-it.com.br]
Sent: Tuesday, February 17, 2004 3:30 PM
To: Struts Users Mailing List
Subject: <html:errors />
I'm using ActionMessages class and ActionMessage for "manipulate" my
errors and show it in the <html:errors /> at jsp file but the message
don't show , I was using the ActionErrors and ActionError and was ok, no
problems. How can I make to solve it.
cheers
Daniel S.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE:
Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
hi daniel
watch here for action.execute();
http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsDeprecatedActionError
s
mine was for ActionForm
there i add Message to an ErrorS-Object
and the code was from my form-page
greetings
-----Original Message-----
From: Daniel [mailto:daniel@top-it.com.br]
Sent: Tuesday, February 17, 2004 4:03 PM
To: Struts Users Mailing List
Subject: Re: <html:errors />
Sorry, but still dosn't work can you help-me ???
my source code is:
in execute method:
ActionMessages messages = new ActionMessages();
HttpSession session = (HttpSession)request.getSession();
try{
LoginBO loginBO = new LoginBO("conexao");
loginBO.eUsuarioValido(usuario,senha);
}catch(Exception e){
ActionMessage message = new ActionMessage(e.getMessage());
messages.add(Globals.ERROR_KEY,message);
}
if(!messages.isEmpty()){
saveMessages(request,messages);
return (new ActionForward(mapping.getInput()));
}else
return mapping.findForward("success");
}
###########################################################
in my jsp page:
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<meta name = "Generator" content = "Easy Struts Xslt generator for
Eclipse (http://easystruts.sf.net).">
<title> <bean:message key="logon.efetuar.logon" /></title>
</head>
<body>
<html:messages id="error" property="foo">
<bean:write name="error" />
</html:messages>
<html:form action="logon">
senha : <html:password property="senha"/><html:errors
property="senha"/></br>
usuario : <html:text property="usuario"/><html:errors
property="usuario"/></br>
<html:submit/><html:cancel/>
</html:form>
<body>
</html>
thanks
Daniel S.
----- Original Message -----
From: "Matthias Wessendorf" <ma...@matthias-wessendorf.de>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 11:28 AM
Subject: RE: <html:errors />
> hi daniel
>
> use this:
> <struts-html:messages id="error" property="foo">
> <struts-bean:write name="error"/>
>
> </struts-html:messages>
>
> cheers,
>
> -----Original Message-----
> From: Daniel [mailto:daniel@top-it.com.br]
> Sent: Tuesday, February 17, 2004 3:30 PM
> To: Struts Users Mailing List
> Subject: <html:errors />
>
>
> I'm using ActionMessages class and ActionMessage for "manipulate" my
> errors and show it in the <html:errors /> at jsp file but the message
> don't show , I was using the ActionErrors and ActionError and was ok,
> no problems. How can I make to solve it.
>
> cheers
> Daniel S.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re:
Posted by Daniel <da...@top-it.com.br>.
Sorry, but still dosn't work can you help-me ???
my source code is:
in execute method:
ActionMessages messages = new ActionMessages();
HttpSession session = (HttpSession)request.getSession();
try{
LoginBO loginBO = new LoginBO("conexao");
loginBO.eUsuarioValido(usuario,senha);
}catch(Exception e){
ActionMessage message = new ActionMessage(e.getMessage());
messages.add(Globals.ERROR_KEY,message);
}
if(!messages.isEmpty()){
saveMessages(request,messages);
return (new ActionForward(mapping.getInput()));
}else
return mapping.findForward("success");
}
###########################################################
in my jsp page:
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<meta name = "Generator" content = "Easy Struts Xslt generator for Eclipse
(http://easystruts.sf.net).">
<title> <bean:message key="logon.efetuar.logon" /></title>
</head>
<body>
<html:messages id="error" property="foo">
<bean:write name="error" />
</html:messages>
<html:form action="logon">
senha : <html:password property="senha"/><html:errors
property="senha"/></br>
usuario : <html:text property="usuario"/><html:errors
property="usuario"/></br>
<html:submit/><html:cancel/>
</html:form>
<body>
</html>
thanks
Daniel S.
----- Original Message -----
From: "Matthias Wessendorf" <ma...@matthias-wessendorf.de>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Tuesday, February 17, 2004 11:28 AM
Subject: RE: <html:errors />
> hi daniel
>
> use this:
> <struts-html:messages id="error" property="foo">
> <struts-bean:write name="error"/>
>
> </struts-html:messages>
>
> cheers,
>
> -----Original Message-----
> From: Daniel [mailto:daniel@top-it.com.br]
> Sent: Tuesday, February 17, 2004 3:30 PM
> To: Struts Users Mailing List
> Subject: <html:errors />
>
>
> I'm using ActionMessages class and ActionMessage for "manipulate" my
> errors and show it in the <html:errors /> at jsp file but the message
> don't show , I was using the ActionErrors and ActionError and was ok, no
> problems. How can I make to solve it.
>
> cheers
> Daniel S.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org