well, you could try it this way:

 <script language="Javascript">

 function checkParam(cForm) {

        var firstname = document.user.firstName.value;
        var lastname = document.user.lastName.value;

        if (firstname == "") {

alert("<%out.print(rbMess.getString("PrenomManquant"));%>");
                  return false;

        } else if (lastname == "") {

                  alert("<%out.print(rbMess.getString("NomManquant"))%>");
                  return false;

        }

Geert 'Darling' Van Damme


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Vincent Louvel
> Sent: woensdag 8 december 1999 15:16
> To: [EMAIL PROTECTED]
> Subject: Carriage return added in the generated code
>
>
> Hi,
>
> I have a problem with the generated code by the Java Server Page. Each
> time the Jsp server replace a variable <%= variable %>, it adds a
> carriage return and a line feed (CRLF) just after. The consequences are
> annoying: I can't write a string in a alert box for example (see the
> example below), the browser doesn't accept the syntax.
>
> Thanks for your help.
>
>
> Example:
>
> ====================  Source code (page.jsp)  ===========================
>
> <%
>
>         ResourceBundle rb = accueil.getResourceBundleEntitle();
>         ResourceBundle rbMess = accueil.getResourceBundleMessage();
>
> ....
>
> %>
>
>
> <script language="Javascript">
>
> function checkParam(cForm) {
>
>        var firstname = document.user.firstName.value;
>        var lastname = document.user.lastName.value;
>
>
>        if (firstname == "") {
>                  alert("<%=rbMess.getString("PrenomManquant")%>");
>                  return false;
>
>        } else if (lastname == "") {
>
>                  alert("<%=rbMess.getString("NomManquant")%>");
>                  return false;
>
>        }
> ....
>
>
> =======================  Generated code  ================================
>
>
>
> <script language="Javascript">
>
> function checkParam(cForm) {
>
>        var firstname = document.user.firstName.value;
>        var lastname = document.user.lastName.value;
>
>        if (firstname == "") {
>
>               alert("Le pr�nom n'a pas �t� sp�cifi�   <-- ??? CRLF
> ");
>               return false;
>
>        } else if (lastname == "") {
>
>               alert("Le nom n'a pas �t� sp�cifi�      <-- ???  CRLF
> ");
>               return false;
>
>        }
>
> ...
>
> ------------------------------------------------------------------
> -----------
>
>
> Sincerly,
> Vincent
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to