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

Reply via email to