That's not how Java works. The .bin file is in the file system, and you need to make the servlet API call to get a 'real' pathname for it. There's no concept of 'current directory' of files next to jsp files in a webapp.
On Sun, Jun 12, 2011 at 4:03 PM, Amal Elmah <amalalthougha...@hotmail.com> wrote: > > I managed to download models from the website using different browser > when I tried to use models from my application I faced the problem that my > program does not recognize bin files so it gives me the following > error: > java.io.FileNotFoundException: en-token.bin (??????? ??? ?????? ?????? ??? > ????? ??????) > java.io.FileInputStream.open(Native Method) > java.io.FileInputStream.<init>(FileInputStream.java:120) > java.io.FileInputStream.<init>(FileInputStream.java:79) > org.apache.jsp.index_jsp._jspService(index_jsp.java:79) > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > The code I used is > > InputStream modelIn = new FileInputStream("en-token.bin"); > TokenizerModel model = new TokenizerModel(modelIn); > > I put en-token.bin file with the ****.jsp files I donot know what is the > problem? > > thanks guys, > Amal > > >