Hi, yes, you can do this . but be careful what will be the output from the jsp. Foe example, the following code can be used to generate a javascript(validating for the browser) from jsp. Regards, Partha <script language=javascript> var defaulttext1="<input size=5 type=text name=txtIntRate onBlur=\"validateCharge(this.value,this);\""; var defaulttext2=" id=txtIntRate value=<%if(sz.trim().equalsIgnoreCase("XXX"))
{out.print("20.5"); } else {out.print("10.0"); } %>>"; if(document.all) document.write(defaulttext1+"onclick=\"fn1();\""+defaulttext2); else document.write(defaulttext1+" onclick=\"return fn1();\" "+defaulttext2); </script> -----Original Message----- From: M. Simms [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 9:51 AM To: [EMAIL PROTECTED] Subject: Re: JSP inside Javascript Yeah, but doesn't the QUOTING requirements become a mess..... single, double, singles within doubles, escaped doubles.... omigosh, code within code is ALWAYS a mess ! Anyone have a solution ? > -----Original Message----- > From: A mailing list about Java Server Pages specification and reference > [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Yee > Sent: Monday, December 09, 2002 12:22 AM > To: [EMAIL PROTECTED] > Subject: Re: JSP inside Javascript > > > Yes you can. You need to remember, however, that the JSP > expression will be > evaluated on the server before the page is rendered at the client. The JSP > expression should output valid JavaScript. > > Regards, > > Richard > > At 10:11 PM 12/8/2002 -0500, you wrote: > >Can we have JSP expression inside javascript? I have javascript which is > >generating tree structure but I want to have JSP expression > inside the tree. > >If anybody knows how to put this I will appreciate if somebody forward me > >example or link. > >Thanx > >Amit > > > >================================================================= > ========== > >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > >JSP-INTEREST". > >For digest: mailto [EMAIL PROTECTED] with body: "set > JSP-INTEREST DIGEST". > >Some relevant FAQs on JSP/Servlets can be found at: > > > > http://archives.java.sun.com/jsp-interest.html > > http://java.sun.com/products/jsp/faq.html > > http://www.esperanto.org.nz/jsp/jspfaq.jsp > > http://www.jguru.com/faq/index.jsp > > http://www.jspinsider.com > > ================================================================== > ========= > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set > JSP-INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://archives.java.sun.com/jsp-interest.html > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.jsp > http://www.jguru.com/faq/index.jsp > http://www.jspinsider.com > =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com