• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

split(String) problem in my jsp

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
-------problem----
Hi

error : split(String) is undefined for the type String

this is the compiler error i am getting.

I had java.io.*,java.util.*,java.lang.* imported in the jsp.

Can anybody help me out.

-----------
----code --------------------


<tr><td>Subject of Issue <select name="selName">
<%
try{
//String theBR;
String txtValue = "";
File fin=new File("D:/TestData/data.txt");
FileReader fr=new FileReader(fin);
BufferedReader br=new BufferedReader(fr);
String theBR=br.readLine();
String[] theSplit=theBR.split(",");
for(int i=0;i<theSplit.length;i++)
{
%>
<option value="<%=theSplit[i]%>" selected><%=theSplit[i]%></option>
<%
out.write(" - "+theSplit[i]); }}
catch(Exception Ex)
{System.out.println("exception in getting connection"+Ex.getMessage()); }
%>
</select>

---------------------------------------
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"aypa j2ee",
Please check your private messages.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of Java are you using?
Also what JSP compiler (make and version) are you using?
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use java 1.4/5/6 and try it out
 
We noticed he had no friends. So we gave him this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic