XHTML MP Lists

The <ul>, <ol> and <li> elements are used to create lists in XHTML MP.


To create an unordered list, use the <ul> element. Each list item in an unordered list begins with a bullet. The <li></li> tags are used to enclose every list item. This XHTML MP example demonstrates how to create an unordered list:



<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ul>
      <li>Part 1 XHTML MP Introduction</li>
      <li>Part 2 Development of Wireless Markup Languages</li>
      <li>Part 3 Advantages of XHTML MP</li>
      <li>Part 4 WML Features Lost in XHTML MP</li>
    </ul>
  </body>
</html>
















Sony Ericsson T610







Nokia Mobile Browser 4.0




To create an ordered list, use the <ol> element. An ordered list has list numbering. List items are enclosed within <li></li> tags. The following XHTML MP example demonstrates how to create an ordered list.


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol>
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>



















Sony Ericsson T610







Nokia Mobile Browser 4.0




You can make use of the start attribute of the <ol> element to specify the starting number of the sequence, like this:


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Table of Contents:</p>
    <ol start=”4″>
      <li>XHTML MP Introduction</li>
      <li>Development of Wireless Markup Languages</li>
      <li>Advantages of XHTML MP</li>
      <li>WML Features Lost in XHTML MP</li>
    </ol>
  </body>
</html>




The result of the above XHTML MP example in some WAP browsers is shown below:

















Sony Ericsson T610







Nokia Mobile Browser 4.0


With WAP CSS, you can have more precise control over the outlook of a list. For example, you can control the bullet shape of unordered lists and the list numbering of ordered lists (for example, changing the list numbering from “1, 2, 3…” to “i, ii, iii…”).

XHTML MP Preformatted Text

In XHTML MP, leading and trailing whitespaces of a paragraph is not displayed. Furthermore, two or more whitespaces in a paragraph are shown as one whitespace on the screen of mobile devices. This behavior is demonstrated in the following XHTML MP example.


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p> Hello, welcome
to
our
XHTML MP tutorial. </p>
  </body>
</html>












Sony Ericsson T610



Nokia Mobile Browser 4.0




To preserve the formatting of the text in XHTML MP, you have to use the <pre> element, like this example:


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <pre> Hello, welcome
to
our
XHTML MP tutorial. </pre>
  </body>
</html>















Sony Ericsson T610







Nokia Mobile Browser 4.0



Font Style in XHTML MP

You can use tags to change the font style of the text in XHTML MP. However, some WAP browsers only support a subset of these tags, even though these tags are defined by the XHTML MP specification. This is because the WAP browser can only make use of the fonts available on the mobile device. For example, if the italic font is not available, the italic style is not supported. Unsupported XHTML MP tags will be ignored by WAP browsers and will not cause any errors.



<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>Font Style</title>
  </head>

  <body>
    <p>
      <b>Bold</b><br/>
      <i>Italic</i><br/>
      <b><i>Bold italic</i></b><br/>
      <small>Small</small><br/>
      <big>Big</big><br/>
      <em>Emphasis</em><br/>
      <strong>Strong</strong>
    </p>
  </body>
</html>




The <b> and <i> tags means bold and italic respectively. The <small> tag reduces the text size. The <big> tag increases the text size. The <em> and <strong> styles are similar. The WAP browser will display text with emphasis (<em>) or strong (<strong>) style in some way that makes it more noticeable. The effect depends on the actual wireless device.


The following screenshots show the output of the above XHTML MP markup code in some WAP browsers. The result will be somewhat different on other mobile phone models.












Sony Ericsson T610



Nokia Mobile Browser 4.0




You can have more precise control over font formats with WAP CSS. For example, you can control the font family to be used or set a specific font size (e.g. 12pt) to some text.


The <u> tag of HTML does not exist in XHTML MP. So, if you want to underline some text, WAP CSS has to be used.

XHTML MP Headings

The elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6> are used to specify headings (level 1 to level 6) in an XHTML MP page. WAP browsers will try to display headings of different levels with different font sizes and styles. However, some WAP devices do not have so many sizes and styles of fonts and so headings of different levels may look the same on the screen.


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>Headings Test</title>
  </head>

  <body>
    <h1>Level 1 Heading</h1>
    <h2>Level 2 Heading</h2>
    <h3>Level 3 Heading</h3>
    <h4>Level 4 Heading</h4>
    <h5>Level 5 Heading</h5>
    <h6>Level 6 Heading</h6>
  </body>
</html>




This is the result of the above XHTML MP example in some WAP browsers:
















Sony Ericsson T610







Nokia Mobile Browser 4.0


Comments in XHTML MP

Comments are placed inside <!– –> in XHTML MP. This is the same as HTML and WML 1.x. For example, the following lines are comments. WAP browsers ignore all comments.




<!– This is a comment in XHTML MP –>


<!– This is a multi-line
     comment –>




Line Breaking in XHTML MP


<br/> is the line breaking tag in XHTML MP, which is the same as that in HTML and WML 1.x. The following example demonstrates the usage of line breaks:



<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>Line Break</title>
  </head>

  <body>
    <p>
      Line 1<br/>
      Line 2<br/><br/>
      Line 3
    </p>
  </body>
</html>




The result should look like this in WAP browsers:












Sony Ericsson T610



Nokia Mobile Browser 4.0




XHTML MP Horizontal Rules


The <hr/> tag is used to add a horizontal rule to your XHTML MP page. Note that <hr/> should not be enclosed in the <p></p> tag pair.


The following example demonstrates the usage of horizontal rules in XHTML MP:


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>
      Table of Contents:<br/>
    </p>
    <hr/>
    <p>
      Part 1 XHTML MP Introduction<br/>
      Part 2 Development of Wireless Markup Languages<br/>
      Part 3 Advantages of XHTML MP<br/>
      Part 4 WML Features Lost in XHTML MP
    </p>
  </body>
</html>




The following screenshots show the result of the above XHTML MP example in some mobile phone browsers:













Sony Ericsson T610



Nokia Mobile Browser 4.0

XHTML MP Generic Metadata

You can specify some generic metadata for your XHTML MP file using the <meta/> tag. The <meta/> tag should be enclosed within the <head></head> tags. A WAP browser will just ignore the metadata if it does not understand the metadata’s meaning. You can specify metadata of any sort in an XHTML MP file without affecting the look of the page. For example, you may want to state the author name in your XHTML MP file but without displaying it on the screen.


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
    <meta name=”author” content=”Andrew”/>
  </head>

  <body>
    <p>Hello world. Welcome to our XHTML MP tutorial.</p>
  </body>
</html>


XHTML MP Document Structure


Hello World XHTML MP Example


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

  <body>
    <p>Hello world. Welcome to our XHTML MP tutorial.</p>
  </body>
</html>




This is what you will see in some mobile phone emulators:












Sony Ericsson T610



Nokia Mobile Browser 4.0




XHTML MP documents start with the prolog, which contains the XML declaration and DOCTYPE declaration.




<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”>




The prolog components are not XHTML MP elements and they should not be closed, i.e. you should not give them an end tag or finish them with />.


The rest of the document is the same as an ordinary HTML document, except that there should be no xmlns attribute for the <html> tag in HTML.


XHTML MP documents must contain the <html>, <head>, <title>, and <body> elements.

Syntax Rules of XHTML MP

XHTML MP is a subset of XHTML. The syntax rules of XHTML MP follow that of XHTML.


As mentioned before in this XHTML MP tutorial, XHTML is just a stricter and cleaner form of HTML. If you have already learned HTML, you can immediately start writing XHTML MP markup code by following the XHTML MP syntax rules below.






  1. Tags must be closed properly



  2. Tags and attributes must be in lowercase



  3. Value of attributes must be enclosed within quotation marks



  4. No attribute minimization is allowed



  5. Tags must be nested properly




XHTML MP Syntax Rule 1: Tags Must Be Closed Properly


All tags in XHTML MP must be closed properly. For example, the following code is not correct in XHTML MP since the </p> end tag is missing. (In case you do not know, the <p></p> tags are used to enclose a paragraph of text.)




<p>XHTML MP tutorial paragraph 1
<p>XHTML MP tutorial paragraph 2
<p>XHTML MP tutorial paragraph 3




This is correct in XHTML MP:




<p>XHTML MP tutorial paragraph 1</p>
<p>XHTML MP tutorial paragraph 2</p>
<p>XHTML MP tutorial paragraph 3</p>




Some tags in XHTML MP do not come in pairs since there is no content to be enclosed. One example is the <br> tag that is used for line breaking. To close such tags, you put a “/” at the end of the tag before “>”. For example, the closed version of <br> is <br/>.


The following markup code is not correct in XHTML MP since the <br> tag is not self-closed.




Line break<br>




This is correct in XHTML MP:




Line break<br/>




Note that to make the XHTML MP markup code compatible with some older web browsers on the PC, you have to leave a space before />, like this:




Line break<br />




XHTML MP Syntax Rule 2: Tags and Attributes Must Be in Lowercase


XHTML MP markup code is case-sensitive. All tags and attributes in XHTML MP must be in lowercase. The following markup code is not correct in XHTML MP since tags (<P></P>) and attributes (ID) are in uppercase.




<P ID=”p1″>XHTML MP tutorial paragraph 1</P>
<P ID=”p2″>XHTML MP tutorial paragraph 2</P>
<P ID=”p3″>XHTML MP tutorial paragraph 3</P>




The following markup code is correct in XHTML MP.




<p id=”p1″>XHTML MP tutorial paragraph 1</p>
<p id=”p2″>XHTML MP tutorial paragraph 2</p>
<p id=”p3″>XHTML MP tutorial paragraph 3</p>




XHTML MP Syntax Rule 3: Value of Attributes Must Be Enclosed within Quotation Marks


Value of attributes must be enclosed within quotation marks in XHTML MP. You can either use single quotes or double quotes. The following markup code is incorrect in XHTML MP.




<p id=p1>XHTML MP tutorial paragraph 1</p>
<p id=p2>XHTML MP tutorial paragraph 2</p>
<p id=p3>XHTML MP tutorial paragraph 3</p>




This is correct in XHTML MP:




<p id=“p1”>XHTML MP tutorial paragraph 1</p>
<p id=“p2”>XHTML MP tutorial paragraph 2</p>
<p id=“p3”>XHTML MP tutorial paragraph 3</p>




You can also use single quotes to enclose attribute values.




<p id=‘p1’>XHTML MP tutorial paragraph 1</p>
<p id=‘p2’>XHTML MP tutorial paragraph 2</p>
<p id=‘p3’>XHTML MP tutorial paragraph 3</p>




XHTML MP Syntax Rule 4: No Attribute Minimization is Allowed


For some attributes, there is only one possible value. In HTML, you can leave out the attribute value in such cases. This is called attribute minimization. For example, in the following markup code, we define a check box that is initially in the checked state. As the checked attribute can only take the “checked” value, you can omit the “checked” value in HTML. The web browser knows that the value of the checked attribute must be “checked”.




<input type=”checkbox” checked />




However, attribute minimization is not allowed in XHTML MP. The above markup code is incorrect in XHTML MP. To correct it, you must write the attribute-value pair in full, like this:




<input type=”checkbox” checked=”checked” />




Below is another example. The following markup code defines a selection list with three options: “XHTML MP Tutorial Part 1”, “XHTML MP Tutorial Part 2” and “XHTML MP Tutorial Part 3”. The multiple attribute is used to enable multiple item selection in the selection list, and the selected attribute is used to select the “XHTML MP Tutorial Part 2” option initially.




<select multiple>
  <option>XHTML MP Tutorial Part 1</option>
  <option selected>XHTML MP Tutorial Part 2</option>
  <option>XHTML MP Tutorial Part 3</option>
</select>




The above markup code is correct in HTML but not in XHTML MP. To correct it, you need to write the attribute-value pair in full, like this:




<select multiple=”multiple”>
  <option>XHTML MP Tutorial Part 1</option>
  <option selected=”selected”>XHTML MP Tutorial Part 2</option>
  <option>XHTML MP Tutorial Part 3</option>
</select>




XHTML MP Syntax Rule 5: Tags Must Be Nested Properly



Tags must be nested properly in XHTML MP. Tag overlapping is not allowed. The following markup code is wrong in XHTML MP since the tags overlap. (<b></b> and <i></i> tags are used to change the text style to bold and italic respectively.)




<p><b>XHTML MP tutorial paragraph 1</p></b>
<i><p>XHTML MP tutorial paragraph 2</i></p>
<p><b><i>XHTML MP tutorial paragraph 3</p></i></b>




The following code is correct in XHTML MP. The tags are nested properly.




<p><b>XHTML MP tutorial paragraph 1</b></p>
<p><i>XHTML MP tutorial paragraph 2</i></p>
<p><b><i>XHTML MP tutorial paragraph 3</i></b></p>

XHTML MP MIME Types and File Extension

MIME Types


The following three MIME types can be used for XHTML MP documents:




  1. application/vnd.wap.xhtml+xml



  2. application/xhtml+xml



  3. text/html



The MIME type specified by the Open Mobile Alliance [OMA] for XHTML MP documents is “application/vnd.wap.xhtml+xml”. This MIME type is required for some WAP browsers (for example, some Nokia Series 60 browsers) to display XHTML MP documents correctly.


Another choice is the “application/xhtml+xml” MIME type. It is the MIME type for XHTML Family document types.


The “text/html” MIME type is also a possible choice. It is the MIME type of HTML documents. Using “text/html” for XHTML MP documents has the benefit that your XHTML MP pages will be viewable on ordinary web browsers without any problems. (Some web browsers like IE 6 do not show documents with MIME types “application/vnd.wap.xhtml+xml” or “application/xhtml+xml” but will bring up a dialog box to let you open the file in an external program or choose a location to save the file.) The drawback is that the user agent will not treat your XHTML MP pages as XML documents, which means the user agent may not complain even if the markup code does not follow strictly the XML rules.


Choosing MIME Types Dynamically


Another option is to detect the MIME types that can be handled by a user agent and choose the MIME type dynamically. For example, if your server finds out that a certain user agent can handle the “application/vnd.wap.xhtml+xml” MIME type, then all your XHTML MP documents will be delivered as “application/vnd.wap.xhtml+xml” to this user agent.


To choose the MIME type dynamically, you need to write a few lines of code using a server-side scripting language (e.g. ASP, JSP, Perl, PHP). The pseudo-code is shown below:




  1. Obtain the accept header value of the HTTP request received. The accept header contains all MIME types that can be handled by the client user agent that sends the request.



  2. If the accept header value contains “application/vnd.wap.xhtml+xml”, set the MIME type of the XHTML MP document to “application/vnd.wap.xhtml+xml”.
    Else if the accept header value contains “application/xhtml+xml”, set the MIME type of the XHTML MP document to “application/xhtml+xml”.
    Else set the MIME type of the XHTML MP document to “text/html”.


The following example demonstrates how to use JSP to write the code. If you use a server-side technology other than JSP, the code will be slightly different but the idea is the same.




<%
String acceptHeader = request.getHeader(“accept”);

if (acceptHeader.indexOf(“application/vnd.wap.xhtml+xml”) != -1)
  response.setContentType(“application/vnd.wap.xhtml+xml”);
else if (acceptHeader.indexOf(“application/xhtml+xml”) != -1)
  response.setContentType(“application/xhtml+xml”);
else
  response.setContentType(“text/html”);
%>




Here are some descriptions of the above JSP code:


1. The accept header value is obtained from the HTTP request. It is then stored in the variable acceptHeader.




String acceptHeader = request.getHeader(“accept”);




2. After that, the variable acceptHeader is checked to see if it contains the words “application/vnd.wap.xhtml+xml” or “application/xhtml+xml”. The indexOf(String str) method of the String object returns the index of the first occurrence of the str substring. If str is not found, -1 is returned by the indexOf(String str) method. In other words, if str is found, the return value will not be -1.




if (acceptHeader.indexOf(“application/vnd.wap.xhtml+xml”) != -1)

else if (acceptHeader.indexOf(“application/xhtml+xml”) != -1)




3. The method


response.setContentType(…);


is used to set the MIME type of a document.




The following example illustrates how to use the JSP code in an actual XHTML MP document. What you need to do is very simple — Just copy and paste the JSP code into the XHTML MP document and use “.jsp” as the file extension. (The XHTML MP markup in this example will be discussed in detail in the following sections.)


 


<?xml version=”1.0″?>
<!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “
http://www.wapforum.org/DTD/xhtml-mobile10.dtd“>


<html xmlns=”http://www.w3.org/1999/xhtml“>
  <head>
    <title>XHTML MP Tutorial</title>
  </head>


  <body>
    <p>Hello world. Welcome to our XHTML MP tutorial.</p>
  </body>
</html>
<%
String acceptHeader = request.getHeader(“accept”);


if (acceptHeader.indexOf(“application/vnd.wap.xhtml+xml”) != -1)
  response.setContentType(“application/vnd.wap.xhtml+xml”);
else if (acceptHeader.indexOf(“application/xhtml+xml”) != -1)
  response.setContentType(“application/xhtml+xml”);
else
  response.setContentType(“text/html”);
%>


File Extension


The file extensions of static XHTML MP documents are “.xhtml”, “.html” and “.htm” typically. You can use other file extensions you like, as long as the MIME type associated with the file extension is set correctly at your WAP server’s configuration file. If you are going to use a server-side technology such as ASP, JSP, Perl, PHP or SSI (Server Side Includes) to add content to XHTML MP documents dynamically, you may need to change the file extension of your XHTML MP documents to that used by the server-side technology. For example, the typical file extension used by PHP is “.php”, while that used by SSI is “.shtml”.

Connection reset by peer:jvm_recv in socket






am programming in Jbuilder7 and weblogic 7. I created a jdbc datasource of a postgres database. In the ejb, I lookup the jndi and get connection to execute a query to get some data and return the ArrayList of data. I also created a servlet to lookup the ejb and get the ArrayList. It always work fine after I restart computer that the server is running. But if I leave it 4 or 5 hours, in the server window, it always appear error in the ejb function “executequery” after I lookup the jndi, get connection and createstatement. The error is:

An I/O error occured while reading from backend – Exception: java.net.S
ocketException: Connection reset by peer: JVM_recv in socket input stream read
Stack Trace:

java.net.SocketException: Connection reset by peer: JVM_recv in socket input str
eam read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:85)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
at org.postgresql.PG_Stream.ReceiveChar(PG_Stream.java:141)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:68)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
at weblogic.jdbc.pool.Statement.executeQuery(Statement.java:863)
at weblogic.jdbc.rmi.internal.StatementImpl.executeQuery(StatementImpl.j
ava:81)
at weblogic.jdbc.rmi.SerialStatement.executeQuery(SerialStatement.java:8
3)
at com.panda.ejb.categorydatamanager.CategoryBean.GetCategory(CategoryBe
an.java:88)
at com.panda.ejb.categorydatamanager.CategoryBean_9ra2ge_EOImpl.GetCateg
ory(CategoryBean_9ra2ge_EOImpl.java:201)
at com.panda.ejb.categorydatamanager.CategoryBean_9ra2ge_EOImpl_WLSkel.i
nvoke(Unknown Source)

Please help me. I have not any ideas about it. Thanks.

 

 

RE:Connection reset by peer:jvm_recv in socket


Hi!

Do you have a firewall in the network between the application and database server? Maybe this error is due to the closing of the connection by the firewall (timeout after inactivation).

I am having the same problem, but it had never happened before after 3 years of production use of a connection pooling framework. In fact, the database and application servers are separated by the Internet…

I am trying to find a way to check for a link-failure event in Java.

You should also watch topic “ORACLE driver: timeout => Connection reset by peer: socket write error ?”

 

RE:

from http://java.sun.com/features/2002/08/j2se-network.html

Connection Reset by Peer :

One of the issues that developers frequently run into is the Connection reset by peer exception:

Exception in thread “main” java.net.SocketException:
Connection reset by peer: JVM_recv in socket input stream read.

This basically means that a network error occurred while the client was receiving data from the server. But what is really happening is that the server actually accepts the connection, processes the request, and sends a reply to the client. However, when the server closes the socket, the client believes that the connection has been terminated abnormally because the socket implementation sends a TCP reset segment telling the client to throw away the data and report an error.

Sometimes, this problem is caused by not properly closing the input/output streams and the socket connection. Make sure you close the input/output streams and socket connection properly. If everything is closed properly, however, and the problem persists, you can work around it by adding Thread.sleep(1000) before closing the streams and the socket. This technique, however, is not reliable and may not work on all systems.

 

RE:


Try to have a look at this similar topic, expecially at answer 1.
http://forum.java.sun.com/thread.jsp?forum=48&thread=424393

Bye