If it works, I'd say it's 'correct' enough. :)

I'm not sure how you're doing this, but why not just write a custom tag or
do a <logic:present> to check for an ActionErrors object to see if there are
errors.  If the tag evaluates to true, output your Javascript onload()
function, using <bean:message> tags to get the actual error message text(s)
and insert them into the window.alert().  This way you only store the error
message itself in the resource file, while the Javascript stays in your JSP
page.  I've used Struts tags to modify the output of Javascript similarly,
and it works fine.

Is this how you're currently doing it, and if not, is there a problem with
doing it this way?


peace,
Joe Barefoot


> -----Original Message-----
> From: Mannem, Taati [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 12: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]>

Reply via email to