Q
quickcur
I am writing a jsp tag and inside the tag I read a file located on the
server. The jsp and the file are in the same directory. But the server
complains that the file can not be found.
Here is my directory
tomcat->webapp->myapp->myjsp.jsp
->myfile.txt
here is my jsp:
<mytaglib:myTag url="myfile.txt"/>
here is my jsptag
public class myTag extends TagSupport {
String url;
public int doStartTag(){
try{
FileInputStream = new FileInputStream(url));
}catch(IOException){
//this message is print out ...
}
}
public void setUrl(String url){
this.url = url;
}
}
server. The jsp and the file are in the same directory. But the server
complains that the file can not be found.
Here is my directory
tomcat->webapp->myapp->myjsp.jsp
->myfile.txt
here is my jsp:
<mytaglib:myTag url="myfile.txt"/>
here is my jsptag
public class myTag extends TagSupport {
String url;
public int doStartTag(){
try{
FileInputStream = new FileInputStream(url));
}catch(IOException){
//this message is print out ...
}
}
public void setUrl(String url){
this.url = url;
}
}