Re: Tomcat and Wap
I changed these two line to get it to work from my nokia. *%@ page contentType=text/vnd.wap.wml%* * String ss1=new String(readbyte).substring(0,charcount);* Need to print only the charaters read into the buffer. You will get an error if the file is zero length so you could do a test before String ss E.G. * if (charcount == -1) charcount=0; String ss1=new String(readbyte).substring(0,charcount); * You could also do other test on length of the file with File infile=new File(C:/TextFiles/ + filename + .txt); long strLen = infile.length(); Regards, Simon Galbayar wrote: 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 (charcountskipbyte) 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=backprev//do /p /card /wml -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: tomcat on a home machine???
You need a java jdk and tomcat. Have a look at this page for setup info on windows2000 and linux. http://www.onjava.com/pub/a/onjava/2001/03/29/tomcat.html Then goto http://localhost:8080/ once tomcat is running. Simon [EMAIL PROTECTED] wrote: I should add that I wanted to know if it is possible to install and use tomcat for test purposes. That is to develop and test programs at home and not make them available on the internet - not at least from my home machine. T:Irvine ps which faq did you mean - there seem to be so many. I'll A keep searching though. On Wed, 27 Jun 2001, Charan Kishore Singla wrote: yah you can, read faq file related to tomcat, all things would be clear. Thanks - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 1:38 PM Subject: tomcat on a home machine??? Hello I have linux installed at home and have only a modem connecting me to the internet through a local service provider. My questions are: Is it possible for me to install and use tomcat without a permenant connection. If it is possible what files would need to be configured to allow me to do so. What url would I need to call to access tomcat's homepage. Apologies if this question has been asked b4. T:Irvine
Re: Error in Startup Tomcat at Win2000
The important thing in the error text is the word bind. This means that one of your sockets is being used. On unix and win2000 you can do a netstat -a This will print out all you sockets incoming and outgoing. To get to the point you need to shutdown the program using this socket - I had the same problems with oracle 8.1.7 starting its apache http server. You can stop Oracle http from the start menu Oracle OraHome81 - Oracle HTTP Server - - Stop Http (C:\Oracle\Ora81\Apache\Apache\Apache.exe -k shutdown -d C:\oracle\ora81\Apache\Apache ) All the Best Regards Simon Qinhong Pan wrote: I am running Tomcat 3.2 and Win2000 Professional. Once startup tomcat, I got the following error message, 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /examples ) 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /admin ) Starting tomcat. Check logs/tomcat.log for error messages 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( ) 2001-06-10 04:12:17 - ContextManager: Adding context Ctx( /test ) 2001-06-10 04:12:18 - PoolTcpConnector: Starting HttpConnectionHandler on 8080 FATAL:java.net.BindException: Address in use: JVM_Bind java.net.BindException: Address in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:397) at java.net.ServerSocket.init(ServerSocket.java:170) at java.net.ServerSocket.init(ServerSocket.java:121) at org.apache.tomcat.net.DefaultServerSocketFactory.createSocket(Default ServerSocketFactory.java:97) at org.apache.tomcat.service.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoi nt.java:239) at org.apache.tomcat.service.PoolTcpConnector.start(PoolTcpConnector.jav a:188) at org.apache.tomcat.core.ContextManager.start(ContextManager.java:527) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:202) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235) Your help is greatly appreciated. Peter