Well, I believe that you are not allowed to mix static and dynamic text
within a JSP, so something like

        alert("Error message: <bean:write name="msg"/>");

should fail. I read once that enclosing the dynamic text in single quotes
whould work (never tried it though). One solution that I do know is:

<snip>
<%
  String tempString="Error message: " + whateverBean.getWhatever();
%>

alert(<%= tempString %>);
</snip>

Its ugly, but it works. Anyone know of a more elegant solution? Note that
you need to get to the data contained in the bean you are writing from,
possibly with a request.getAtribute("attributeName");

Good luck,

Andreas


-----Ursprüngliche Nachricht-----
Von: Daniel [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 24. März 2004 13:53
An: Struts Users Mailing List
Betreff: html:javascript question


I want to put the msg inside a javasript alert (popup with error
message ),some one know how can I make it ???????

<font color="red">

<html:messages id="msg" message="true" bundle="geral">

<bean:write name="msg" /><br>

</html:messages>

</font>



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

Reply via email to