Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

split(String) problem in my jsp  RSS feed

 
aypa genga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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>

---------------------------------------
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Java are you using?
Also what JSP compiler (make and version) are you using?
 
Arun Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use java 1.4/5/6 and try it out
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!