struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ekoje ekoje" <joke...@gmail.com>
Subject Re: Mgnt Error message
Date Thu, 01 Mar 2007 15:31:46 GMT
Hi,

Thanks for your help but I found my mistake.

Ive had the parameter type="redirect" in the result (struts.xml):
<result name="error" type="redirect">/register/step1.jsp</result>

and since i removed it, it works
<result name="error" >/register/step1.jsp</result>

Rgs,
E

> Hi,
>
> I dont see
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
> in your jsp page, this may be the problem.
>
> Thanks,
>
> Nuwan.
>
>
> ----- Original Message -----
> From: "ekoje ekoje" <jokeout@gmail.com>
> To: "user" <user@struts.apache.org>
> Sent: Wednesday, February 28, 2007 12:04 PM
> Subject: Mgnt Error message
>
>
>> HI Guys,
>>
>> I tried to manage some custom error messages using ActionMessage and
>> ActionError. I set the text message in the Action and redirect to the
>> ERROR
>> result but I don't have any text displayed in the JSP when I use
>> actionmessage tag and actionerror tag.
>>
>> Did i miss something ? any configuration ?
>>
>> Please find my code,
>>
>> Action:
>>
>>
>> import javax.servlet.http.HttpServletRequest;
>>
>> import org.apache.struts2.interceptor.ServletRequestAware;
>>
>> import com.opensymphony.xwork2.ActionSupport;
>>
>> public class TestAction extends ActionSupport implements
>> ServletRequestAware
>> {
>>
>>    private static final long serialVersionUID = -7505437345373234225L;
>>
>>    private HttpServletRequest request;
>>
>>    public String execute(){
>>        addActionMessage("TESSSSSSSS");
>>        addActionError("SECONDDDDDDDDDDD");
>>        return ERROR;
>>    }
>>
>>    public void setServletRequest(HttpServletRequest httpServletRequest)
>> {
>>        this.request = httpServletRequest;
>>    }
>> }
>>
>>
>> JSP COde:
>>
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>>    pageEncoding="ISO-8859-1"%>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
>> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml">
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
>> />
>> </head>
>> <title>Insert title here</title>
>> </head>
>> <body>
>>    <h3>Error Message</h3>
>>
>>    <s:actionerror />
>>
>>    <h3>Error Message</h3>
>>    <s:fielderror />
>>
>>    <h3>Error Message</h3>
>>    <s:actionmessage />
>>
>> </body>
>> </html>
>>
>>
>> I will apreciate any help.
>>
>> Thanks,
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message