John,

The compiler is correct s2 = s1.getBytes; must be written as such:
                s2 = s1.getBytes();

If is a method call not a property.  I can see why this would happen coming
from the COM world.
_____________________________________________________
Nick DiFranco
Developer
EC Cubed, Inc.
1 Research Drive, Westboro MA 01581
Phone: (508) 616-7078
Email:  [EMAIL PROTECTED]


-----Original Message-----
From: Jeff Brown [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 22, 1999 11:06 AM
To: [EMAIL PROTECTED]
Subject: Casting strings returned by input elements...


I'm working with some COM objects that only accept bytes.  However, the data
I'm trying to send is in string form (sent by form input elements).  In ASP
this was not a problem since VBScript auto-casts everything.  Java's a bit
pickier and my knowledge of Java is shaky at best.  I've tried:

        <%       string s1, s2;
                 s1=request.getParameter("someString");
                   s2 = s1.getBytes;
        %>

This returns the error:  "Attempt to reference method getBytes in class
java.lang.string as an instance variable."

There's gotta be an easier way to do this :)

____________________
Jeffrey W. Brown
Test Engineer
Citr!x Systems, Inc.
PHONE: (954) 267-2846
EMAIL: jeff.brown @ citrix.com
____________________
The information contained in this message is confidential and may be
legally privileged. It is intended solely for the addressee. Access to
this message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of this message, or
any action or omission taken by you in reliance on it, is prohibited and
may be unlawful. Please immediately contact the sender if you have
received this message in error.



===========================================================================
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