Code Comments
Programming Forum and web based access to our favorite programming groups.Hi there, I began doing some JSP and trying out something. One of the first things I learned was what the error-Site of Tomcat 5 looks like... My problem: The following code is reported to have an error: <snip> cannot resolve symbol symbol : method length (java.lang.String) location: class org.apache.jsp.test.test.test_jsp output = length(test); ^ <snap> The code is: <%! String test; int output; %> <% test = "foo"; output = length(test); %> <html> <head> <title>Test</title> </head> <body> Test!<br> <br> <%= output %><br> <br> </body> </html> Any ideas? Do I have to import/include classes? Which ones? How? Thanks for your help!
Post Follow-up to this messageudo.f@gmx.net (Spocht) writes: > output = length(test); Java is an object-oriented languiage; this means that methods don't exist on their own, but as part of objects or classes. You don't call a function on a structure like you would in C, you use a method associated with the object: output = test.length();
Post Follow-up to this messageOn 23 Sep 2004 01:17:58 -0700, udo.f@gmx.net (Spocht) wrote: >Hi there, > >I began doing some JSP and trying out something. One of the first >things I learned was what the error-Site of Tomcat 5 looks like... My >problem: The following code is reported to have an error: > ><snip> >cannot resolve symbol >symbol : method length (java.lang.String) >location: class org.apache.jsp.test.test.test_jsp >output = length(test); > ^ ><snap> > >The code is: > ><%! >String test; >int output; >%> ><% >test = "foo"; >output = length(test); try output = test.length(); >%> ><html> ><head> ><title>Test</title> ></head> ><body> >Test!<br> ><br> ><%= output %><br> ><br> ></body> ></html> > >Any ideas? Do I have to import/include classes? Which ones? How? > >Thanks for your help! -- now with more cowbell
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.