WartookMan
Technical User
I'm having some problems getting the following code to compile. I'm trying to create a File Upload portlet for use with a JSR 168 Portal Server (WebSphere 5.1 to be exact).
I have downloaded the 1.1-dev build from the Jakarta website, and installed that in my WEB-INF/lib directory. My code is (stripped considerably) as follows:
I am receiving the following message:
What have I done wrong... I'm assuming plenty of people have got this working in the past since the libraries are over 2 years old and it's a fundamental thing to do with servlets. Please note that this is for a Portlet though so the request method is slightly different.
Any assistance would be greatly appreciated.
Senior IBM Lotus Workplace Web Content Management (LWWCM) / Aptrix Specialist & Web Developer
w: w: e: Pete.Raleigh(at)lclimited.co.uk
I have downloaded the 1.1-dev build from the Jakarta website, and installed that in my WEB-INF/lib directory. My code is (stripped considerably) as follows:
Code:
...
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.portlet.PortletFileUpload;
...
public void processAction(... )
...
PortletFileUpload upload = new PortletFileUpload();
List fileItems = (List)upload.parseRequest(request);
Iterator itr = fileItems.iterator();
while ( itr.hasNext() )
{
FileItem fi = (FileItem)itr.next();
if(!fi.isFormField())
{
serverresponse += "NAME: " + fi.getName() + "<br>";
serverresponse += "SIZE: " + fi.getSize() + "<br>";
serverresponse += fi.getOutputStream().toString() + "<br>";
} else {
serverresponse += "Field = " + fi.getFieldName() + "<br>";
}
}
...
Code:
com\lcltd\raleigh\jsr168\WCMTools.java:198: cannot access javax.servlet.http.HttpServletRequest
file javax\servlet\http\HttpServletRequest.class not found
List fileItems = (List)upload.parseRequest(request);
^
1 error
What have I done wrong... I'm assuming plenty of people have got this working in the past since the libraries are over 2 years old and it's a fundamental thing to do with servlets. Please note that this is for a Portlet though so the request method is slightly different.
Any assistance would be greatly appreciated.
Senior IBM Lotus Workplace Web Content Management (LWWCM) / Aptrix Specialist & Web Developer
w: w: e: Pete.Raleigh(at)lclimited.co.uk