my jsp is: I can't find any error. but WAP browser have Page Cannot be
displayed error.

<%@ page contentType="text/vnd.wap.wml;charset=ISO-8859-1"%>
<%response.setHeader("Cache-Control","no-cache");%>
<%@ page import="java.io.*"%>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml";>

<wml>
<card id="main" title="is">
<p>
<%
 String pagenum=request.getParameter("page");
 String filename=request.getParameter("f");
 if (pagenum==null) pagenum="1";
 int skipbyte=500;
  byte[] readbyte=new byte[skipbyte];
  boolean isEnd=false;
  try
  {
   FileInputStream in=new
FileInputStream("C:\\TextFiles\\"+filename+".txt");
   in.skip(skipbyte*(Integer.parseInt(pagenum)-1));
   int charcount=in.read(readbyte);
   if (charcount<skipbyte) isEnd=true;
   in.close();
   String ss1=new String(readbyte);
    out.println(ss1);
   out.flush();
  }
  catch(FileNotFoundException e)
  {
       out.println("File Not Found");
  }
  catch(IOException e)
  {
       out.println("IO error");
  }
%>
<%
 String linkstr="";

linkstr=(isEnd)?Integer.toString(Integer.parseInt(pagenum)-1):Integer.toStri
ng(Integer.parseInt(pagenum)+1);
%>
 </p>
 <p>
 <a
href="ReadFileWml.jsp?page=<%=linkstr%>&amp;f=<%=filename%>"><%=(isEnd)?"Bac
k":"Next"%></a></p>
<p>
<do type="prev" label="back"><prev/></do>
</p>
</card>
</wml>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to