struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Brown <adrianjonbr...@yahoo.com.au>
Subject Re: want to have errors to be dispalyed in diffrent page
Date Mon, 02 Sep 2002 07:54:41 GMT
Hi Jenny,

In case no one else answered this, you need to put
some errors in your session before they can be
captured and displayed by the errorpage.jsp.

Try the following code in your action:

	ActionErrors errors = new ActionErrors();
    	errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.login"));
        saveErrors(request, errors);

And make sure there is a corresponding entry in your
ApplicationResources.properties file, such as:

error.login=There was a problem with our application
logging in. Please wait ten minutes and try again or
contact an Administrator.

Hope that helps.

Adrian


 --- Jenny <J_zhangca@yahoo.ca> wrote: > Aaron:
> 
> I figure out you must mean this- to change input
> attribute in
> struts-config.xml. I have done this. The following
> is part of my struts-config.xml file:
> 
> <action-mappings>
> 
>     <action   path="/login"
>               type="...LoginAction"
>               name="loginForm"
>               input="/errorspage.jsp"
>               scope="request">
>     .....
> 
>     </action>
> 
>   </action-mappings>
> 
> Note: I have input="/errorspage.jsp". It is point to
> errorpage, not login
> page. But in errorpage, I only get "Please correct
> the following errors
> before you proceed:", there is no specific error
> message showed, so user
> don't know which field is wrong. Does anyone know
> what could cause the
> problem?
> 
> Thanks.
> 
> Jenny
> ----- Original Message -----
> From: "Jenny" <J_zhangca@yahoo.ca>
> To: "Struts Users Mailing List"
> <struts-user@jakarta.apache.org>
> Sent: Thursday, August 29, 2002 5:42 PM
> Subject: Re: want to have errors to be dispalyed in
> diffrent page
> 
> 
> > Aaron:
> >
> > Thank you for your reply. But I am not sure I get
> what you mean. You said
> > "change the "input" attribute for your action to
> point to the page you
> want
> > your errors displayed on.". In my login.jsp page,
> I have:
> > ...
> > <html:text property="userName" />
> > ...
> > <html:password property="password"/>
> > ..
> >
> > How can change the "input" attribute to point to
> my errorpage.jsp. What do
> > you mean by "input attribute"? Could you explain
> in a little bit detail?
> >
> > Thank you very much
> >
> > Jenny
> >
> > ----- Original Message -----
> > From: "Aaron Oathout" <aaron@codejunkies.org>
> > To: "Struts Users Mailing List"
> <struts-user@jakarta.apache.org>
> > Sent: Saturday, August 31, 2002 5:26 PM
> > Subject: Re: want to have errors to be dispalyed
> in diffrent page
> >
> >
> > > Just a guess as I haven't tried this, but it
> would seem to me you could
> > > change the "input" attribute for your action to
> point to the page you
> want
> > > your errors displayed on. Anybody thats tried
> this care to confirm or
> > > correct my assumption?
> > >
> > > Aaron
> > >
> > > On Thu, 29 Aug 2002, Jenny wrote:
> > >
> > > > Dear friends:
> > > >
> > > > I am using struts to develope web application.
> I use <html:errors/> in
> > > > login.jsp, and I implemented validate(..)
> method in LoginActionForm
> > class.
> > > > If user enter invalid username or password in
> login page(login.jsp), I
> > want
> > > > the errors to be displayed in another
> page(errorpage.jsp), other than
> in
> > > > login page. Is there a way to fulfill this?
> Your help is appreciated.
> > > >
> > > > Thanks,
> > > >
> > > > Jenny
> > > >
> > > >
>
______________________________________________________________________
> > > > Post your ad for free now!
> http://personals.yahoo.ca
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> >
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
> >
>
______________________________________________________________________
> > Post your ad for free now!
> http://personals.yahoo.ca
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 
>
______________________________________________________________________
> 
> Post your free ad now! http://personals.yahoo.ca
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>  

http://mobile.yahoo.com.au - Yahoo! Messenger for SMS
- Now send & receive IMs on your mobile via SMS

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message