Mannem:

Either I didn't read your previous emails more carefully or you didn't
mention it was from the business layer that you needed to display java
script. In any case, without knowing all the details of your application
it's really hard for me to understand what it is you need to accomplish. Can
you send me a more detailed email explaining the steps required to generate
your java script.

Typically the standard way of handling business logic errors in struts is to
store them using ActionErrors. From the example that ships with struts I
copied this piece of code from LogonForm.java:

ActionErrors errors = new ActionErrors();
        if ((username == null) || (username.length() < 1))
            errors.add("username", new
ActionError("error.username.required"));


I'm not sure if you'd be breaking any standards, but I see no reason to
store the actual javascript that displays the error in one of your keys in
your resource bundle. I would imagine you'd want to display an alert box.
However, since you are already inside the business layer, the more common
approach is to just store the error message in the key to then display in
your page.

HOpe this helps!!!


**********************************************
Juan Alvarado
Internet Developer -- Manduca Management
(786)552-0504
[EMAIL PROTECTED]
AOL Instant Messenger: [EMAIL PROTECTED]

-----Original Message-----
From: Mannem, Taati [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 4:10 PM
To: [EMAIL PROTECTED]
Subject: RE: javascript and struts1.0.2


Juan,
Pardon me for mailing to u but Juan, if I get an error from the business
layer and I have to show javascript alert how will I use the validator tag
to display the error.
Any examples with the code will be really helpful.

Regards,
Taati
> -----Original Message-----
> From: Juan Alvarado \(Struts List\) [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 3:22 PM
> To:   Struts Users Mailing List
> Subject:      RE: javascript and struts1.0.2
>
> You can use the validator with struts 1.02. It just needs to be configured
> differently.  Take a look at the documentation on the web site.
>
> **********************************************
> Juan Alvarado
> Internet Developer -- Manduca Management
> (786)552-0504
> [EMAIL PROTECTED]
> AOL Instant Messenger: [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Mannem, Taati [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 3:21 PM
> To: Struts Users Mailing List
> Subject: RE: javascript and struts1.0.2
>
>
> Thanks a lot
> But common validator is a part of struts1.1b right?It is stillin the beta
> version.How can I use that when it is nto stable yet?
>
> Regards,
> Taati
> > -----Original Message-----
> > From:       Juan Alvarado \(Struts List\)
> [SMTP:[EMAIL PROTECTED]]
> > Sent:       Monday, May 13, 2002 3:11 PM
> > To: Struts Users Mailing List
> > Subject:    RE: javascript and struts1.0.2
> >
> > Look into the validation framework!!!
> >
> > http://home.earthlink.net/~dwinterfeldt/index.html
> >
> > Good luck
> >
> > **********************************************
> > Juan Alvarado
> > Internet Developer -- Manduca Management
> > (786)552-0504
> > [EMAIL PROTECTED]
> > AOL Instant Messenger: [EMAIL PROTECTED]
> >
> > -----Original Message-----
> > From: Mannem, Taati [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 13, 2002 3:13 PM
> > To: [EMAIL PROTECTED]
> > Subject: javascript and struts1.0.2
> >
> >
> > Struts guys,
> >     A help and review required urgently.I am using struts1.0.2 and I
> > have to show the errors(validations ,ActionErrors) in the form of
> > javascript
> > alerts. I found  that struts 1.0.2 does not support javascript. I
> handled
> > this by writing the alerts in the applicationresources.properties and
> that
> > way I was within the framework and did not have to do much of extensive
> > coding. Is this approach correct or is there some other better way?
> > TIA
> > Regards,
> > Taati
> >
> >
> > --
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to