I have a program in j2me that get strings and data from an wml/asp page.
Using this code:
HttpConnection con = (HttpConnection) Connector.open(
"http://localhost:"+port+"/MobileWebWIthConnection/ShowCourseinsemester.aspx?StudentId="+ID+"&Year="+Year+"&Semester="+Semester);
DataInputStream in = new DataInputStrea(con.openInputStream());
int len = (int) con.getLength();
byte[] info = new byte[len];
in.readFully(info);
result = new String(info);
switchDisplayable(null, getStudentCourses());
stringItem2.setText(result);
When my j2me application try to read and store the data from this page:
"http://localhost:"+port+"/MobileWebWIthConnection/ShowCourseinsemester.aspx?StudentId="+ID+"&Year="+Year+"&Semester="+Semester
the text which is placed in the string called (result) is nothing similar to expected figure below:
It’s taking the content without formatting as below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<wml>
<card>
<p><b>Student Name :</b> Arin Rizk </p>
<p><b>Student ID</b> : 20111</p>
<p>first Semester ,2011</p>
1 - Course Name : DDD | Credits Number : 3 | Mark : 70 </br> 2 - Course Name : EEE | Credits Number : 3 | Mark : 65 </br> 3 - Course Name : EEE | Credits Number : 3 | Mark : 65 </br> 4 - Course Name : EEE | Credits Number : 3 | Mark : 90 </br>
</card>
</wml>
so when I assigned this text to the StringItem it’s showing as below in the fig.
stringItem2.setText(result);

How can get my j2me to view the strings as the original formatted page?

I solved it , it was a little bit tricky specially that in j2me there is no (split method) .
so simply I created one.
I decleared it
and then I applied it and display the results in a list
and the results were as wanted ( in rows ) without the full source code from the wml page.