newbie JSP question



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!

.



Relevant Pages

  • Re: How to Load Properties File?
    ... I got it to work but only in a java file. ... for the JSP part i cant get it to do anything w/ the same code. ... I've spent like 2 days on this and I cant even figure out how load the ... If you still don't know how to load them, I recommend the tutorial at Sun's website: ...
    (comp.lang.java.programmer)
  • How create dynamic Actionforms in struts
    ... I created a jsp page in dynamic way,so i cant predict the number of text ... fields and and radio buttons ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Struts - I dont get it
    ... I can create a jsp which submits a form which is processed by an Action ... But I cant seem to do the next logical step. ... Please dont bother with replying if you are just to go say read the ... examples war or the Apache tutorial - it is not helpful. ...
    (comp.lang.java.programmer)
  • Re: Struts - I dont get it
    ... do you mean you can't dispaly data in the jsps? ... But I cant seem to do the next logical step. ... pass to the target jsp. ... examples war or the Apache tutorial - it is not helpful. ...
    (comp.lang.java.programmer)
  • trouble resolving a class with JSP
    ... 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 ...
    (comp.lang.java.programmer)