A
anikkar
this may seem like a stupid question, but i cant figure it out...
i have a simple JSP, in which I want to call a static method in another
class, but tomcat says it can't find the other class. The class I want
to call is no within a package, it is in the same directory as the jsp
file.
here is my jsp code:
<%@ page import="java.util.Enumeration"%>
<%@ page import="java.io.File"%>
<html>
<body>
<form action="unzip.jsp" method=post>
<SELECT NAME="File" SIZE=4>
<% File dir = new File("/myDir");
for(File tempFile : dir.listFiles()) { %>
<OPTION><%=tempFile%></OPTION>
<% } %>
</SELECT>
<INPUT TYPE=SUBMIT VALUE=Press>
</form>
<B>Form Content</B><BR>
<TABLE>
<% Enumeration parameters = request.getParameterNames();
String parameterName = (String)parameters.nextElement();
String parameterValue = request.getParameter(parameterName);
if(parameterValue.endsWith(".zip")) {
Utils.unzipFile(new File(parameterValue));
}
%>
</body>
</html>
thanks!
i have a simple JSP, in which I want to call a static method in another
class, but tomcat says it can't find the other class. The class I want
to call is no within a package, it is in the same directory as the jsp
file.
here is my jsp code:
<%@ page import="java.util.Enumeration"%>
<%@ page import="java.io.File"%>
<html>
<body>
<form action="unzip.jsp" method=post>
<SELECT NAME="File" SIZE=4>
<% File dir = new File("/myDir");
for(File tempFile : dir.listFiles()) { %>
<OPTION><%=tempFile%></OPTION>
<% } %>
</SELECT>
<INPUT TYPE=SUBMIT VALUE=Press>
</form>
<B>Form Content</B><BR>
<TABLE>
<% Enumeration parameters = request.getParameterNames();
String parameterName = (String)parameters.nextElement();
String parameterValue = request.getParameter(parameterName);
if(parameterValue.endsWith(".zip")) {
Utils.unzipFile(new File(parameterValue));
}
%>
</body>
</html>
thanks!