recently, I rent a tomcat host and I upload my jsp website to the host.
only one thing that doesn't work is uploading page.
I am not sure the uploading is work or not, but I can't even create a file or folder in my host.
I create a simple jsp that create a direct.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%@page import="java.io.*" %>
</head>
<body>
<%
java.io.File file = new File("/path/to/my/user/folder/t.txt");
if(!file.getParentFile().exists())
{
try{
if(file.mkdirs()){
out.println("yes");
}else{
out.println("no");
}
}catch(Exception e){
out.println(e.getMessage());
}
}
if(file.mkdir()){
out.println("yes");
}else{
out.println("no");
}
out.println(file.getAbsolutePath());
String path = request.getContextPath();
String basePath = request.getScheme()+"://>/"+request.getServerName()+":"+request.getServerPort()+path+"/";
out.println(basePath);
%>
</body>
</html>
it returns "no" which means I can't even create a folder or file.
it's my first time to do things in web host.
usually I run my website in my computer as a server.
therefore, I don't really know if I need to set anything up in order to create a file in the host.
Thanks

New Topic/Question
Reply



MultiQuote


|