Hi Spike

Thanks a lot for your help!

The servlet container I use is HP bluestone because I am doing this portal 
for HP.  The SaCGI.exe is the gateway file and Demo.class is the application 
server instance name.

The homepage for my portal is in 
'http://localhost/cgi-bin/SaCGI.exe/Demo.class/jetspeed/portal'.  So I think 
I should use url 
'http://localhost/cgi-bin/SaCGI.exe/Demo.class/jetspeed/portal?action=FileUploadAction'.
 
  Is it?  Do you know any other jetspeed sources which extend Action class 
in org.apache.jetspeed.module package? I check those in my jetspeed, there 
are CreateNewUserAndConfirm, SendConfirmationEmail.class and so on.  The url 
they are using is like 
"http://localhost/cgi-bin/SaCGI.exe/Demo.class/jetspeed/portal/screen/Home/action/CreateNewUserAndConfirm";?
 
  How about yours?  Actually I tried to change the URL to 
"http://localhost/cgi-bin/SaCGI.exe/Demo.class/jetspeed/portal/screen/Home/action/UploadFileAction";,
 
but it still doesn't work.  Do you know what is wrong with it?

Regards
Yuxiong




>From: Spike Hains <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: RE: Multipart Form Submissions
>Date: Wed, 19 Sep 2001 07:50:11 -0400
>MIME-Version: 1.0
>Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id 
>MHotMailBD71D27300904004319E407D851407EF0; Wed, 19 Sep 2001 04:54:27 -0700
>Received: (qmail 61759 invoked by uid 500); 19 Sep 2001 11:50:43 -0000
>Received: (qmail 61743 invoked from network); 19 Sep 2001 11:50:43 -0000
>From jetspeed-user-return-2143-he_yi Wed, 19 Sep 2001 04:54:36 -0700
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>List-Post: <mailto:[EMAIL PROTECTED]>
>List-Help: <mailto:[EMAIL PROTECTED]>
>List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
>List-Subscribe: <mailto:[EMAIL PROTECTED]>
>Delivered-To: mailing list [EMAIL PROTECTED]
>Message-ID: 
><[EMAIL PROTECTED]>
>X-Mailer: Internet Mail Service (5.5.2650.21)
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>
>yi he,
>
>What servlet container are you using? Tomcat?
>
>Perhaps you could try copying the 'jetspeed' directory and all it's 
>contents
>to the webapps folder in Tomcat (assuming you are using Tomcat). The URL
>seems unusual in that you have a SaCGI.exe and Demo.class in the path.
>
>Any reason why you have this in the cgi-bin? I'm not certain, but I suspect
>this has something to do with the error you are receiving.
>
>~spike
>
>-----Original Message-----
>From: yi he [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, September 18, 2001 10:47 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Multipart Form Submissions
>
>
>Hi Spike and Scott
>
>I have tried the file upload class from you, but I can't get it working.
>The following is form and action file I use.
>Form file:
><FORM
>action='http://localhost/cgi-bin/SaCGI.exe/Demo.class/jetspeed/portal?action
>=FileUploadAction'
>METHOD='POST' ENCTYPE='multipart/form-data'
>name='browse_form'>
>     <BR>
>     Choose a file to upload please.
>     <BR><BR>
>     <INPUT TYPE=FILE NAME=file1>
>     <BR>
>       <INPUT type='submit' name='submit'value='Submit'>
></FORM>
>
>Action File:
>package org.apache.jetspeed.modules.actions;
>
>import org.apache.turbine.modules.actions.*;
>import org.apache.turbine.util.RunData;
>import org.apache.turbine.util.Log;
>import org.apache.turbine.modules.Action;
>import javax.servlet.http.*;
>import java.io.IOException;
>import org.apache.turbine.util.upload.FileItem;
>
>public class FileUploadAction extends Action
>{
>    public void doPerform(RunData data) throws Exception
>     {
>             FileItem file=data.getParameters().getFileItem("file1");
>             System.out.println ("Size of uploaded file from
>(FileItem)file.getSize(): " + file.getSize());
>     }
>}
>
>After I press submit button in the form, I got nothing returned.  The
>excetpion shown in console is like the following:
>[2001/09/19 10:33:13][0         ][E]: java.lang.ClassNotFoundException:
>Demo.jet
>speed.web_inf.templates.jsp.screens..html.error_sjsp
>[2001/09/19 10:33:13][0         ][E]:   at
>java.net.URLClassLoader$1.run(URLClas
>sLoader.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.lang.Exception.<init>(Exception.
>java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.lang.ClassNotFoundException.<ini
>t>(ClassNotFoundException.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.net.URLClassLoader$1.run(URLClas
>sLoader.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.security.AccessController.doPriv
>ileged(Native Method)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.net.URLClassLoader.findClass(URL
>ClassLoader.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.lang.ClassLoader.loadClass(Class
>Loader.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>java.lang.ClassLoader.loadClass(Class
>Loader.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>SaApi.servlet.SaServletUtils.setUpSer
>vlet(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>SaApi.servlet.SaServletUtils.getServl
>etInstance(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:13][0         ][E]:   at
>SaApi.servlet.SaServletRequestDispatc
>her.include(SaServletRequestDispatcher.java:226)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.turbine.services.jsp.Turbi
>neJspService.handleRequest(TurbineJspService.java:174)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.turbine.modules.screens.Ba
>seJspScreen.buildTemplate(BaseJspScreen.java:100)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.turbine.modules.screens.Te
>mplateScreen.doBuild(TemplateScreen.java:136)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.turbine.modules.Screen.bui
>ld(Screen.java:98)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.turbine.modules.ScreenLoad
>er.eval(ScreenLoader.java:129)
>[2001/09/19 10:33:13][0         ][E]:   at
>org.apache.jetspeed.services.jsp.tags
>.EcsScreenTag.doStartTag(EcsScreenTag.java:102)
>[2001/09/19 10:33:13][0         ][E]:   at
>Demo.jetspeed.web_inf.templates.jsp.s
>creens.ecs_sjsp._jspService(ecs_sjsp.java:115)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.jsp.SaJspServlet.servic
>e(SaJspServlet.java:133)
>[2001/09/19 10:33:14][0         ][E]:   at
>javax.servlet.http.HttpServlet.servic
>e(HttpServlet.java:865)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletUtils.serviceR
>equest(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletRequestDispatc
>her.include(SaServletRequestDispatcher.java:237)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.jsp.SaPageContext.inclu
>de(SaPageContext.java:279)
>[2001/09/19 10:33:14][0         ][E]:   at
>Demo.jetspeed.web_inf.templates.jsp.l
>ayouts.html.en.default_sjsp._jspService(default_sjsp.java:347)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.jsp.SaJspServlet.servic
>e(SaJspServlet.java:133)
>[2001/09/19 10:33:14][0         ][E]:   at
>javax.servlet.http.HttpServlet.servic
>e(HttpServlet.java:865)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletUtils.serviceR
>equest(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletRequestDispatc
>her.include(SaServletRequestDispatcher.java:237)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.services.jsp.Turbi
>neJspService.handleRequest(TurbineJspService.java:174)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.jetspeed.modules.layouts.J
>etspeedJspLayout.doBuild(JetspeedJspLayout.java:101)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.modules.Layout.bui
>ld(Layout.java:91)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.modules.LayoutLoad
>er.exec(LayoutLoader.java:122)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.modules.pages.Defa
>ultPage.doBuild(DefaultPage.java:171)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.modules.Page.build
>(Page.java:90)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.modules.PageLoader
>.exec(PageLoader.java:123)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.Turbine.handleExce
>ption(Turbine.java:560)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.Turbine.doGet(Turb
>ine.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>org.apache.turbine.Turbine.doPost(Tur
>bine.java:505)
>[2001/09/19 10:33:14][0         ][E]:   at
>javax.servlet.http.HttpServlet.servic
>e(HttpServlet.java:772)
>[2001/09/19 10:33:14][0         ][E]:   at
>javax.servlet.http.HttpServlet.servic
>e(HttpServlet.java:865)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletUtils.serviceR
>equest(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletUtils.processS
>ervletRequest(SaServletUtils.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletInvokerApp.SaP
>rocessInputStream(SaServletInvokerApp.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.servlet.SaServletInvokerApp.han
>dleClient(SaServletInvokerApp.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaApp.processRequest(SaApp.java
>, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaSamUbsContext.processActivato
>r(SaSamUbsContext.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaSamUbsContext.queueActivator(
>SaSamUbsContext.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaSamUbsContext.processActivato
>r(SaSamUbsContext.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaSamUbsContext.processRequest(
>SaSamUbsContext.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaSamUbsContext.execute(SaSamUb
>sContext.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>SaApi.SaThreadPool$Worker.run(SaThrea
>dPool.java, Compiled Code)
>[2001/09/19 10:33:14][0         ][E]:   at
>java.lang.Thread.run(Thread.java:479)
>
>
>Any help will be appreciated!
>
>Thanks All
>
>Regards
>Yuxiong
>
>
> >From: Spike Hains <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: [EMAIL PROTECTED]
> >Subject: RE: Multipart Form Submissions
> >Date: Mon, 17 Sep 2001 16:54:27 -0400
> >MIME-Version: 1.0
> >Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id
> >MHotMailBD6FAE94000C400431A0407D8514068A0; Mon, 17 Sep 2001 13:56:52 
>-0700
> >Received: (qmail 4524 invoked by uid 500); 17 Sep 2001 20:54:53 -0000
> >Received: (qmail 4502 invoked from network); 17 Sep 2001 20:54:53 -0000
> >From jetspeed-user-return-2127-he_yi Mon, 17 Sep 2001 13:58:11 -0700
> >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> >Precedence: bulk
> >List-Post: <mailto:[EMAIL PROTECTED]>
> >List-Help: <mailto:[EMAIL PROTECTED]>
> >List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> >List-Subscribe: <mailto:[EMAIL PROTECTED]>
> >Delivered-To: mailing list [EMAIL PROTECTED]
> >Message-ID:
> ><[EMAIL PROTECTED]>
> >X-Mailer: Internet Mail Service (5.5.2650.21)
> >X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> >
> >Scott,
> >
> >Thank you very much. It worked great (after some minor doctoring of
> >course).
> >
> >In the action handler class, I took out the part where you use the 
>O'Reilly
> >multipart form class and used the parameter parser that is part of the
> >rundata object (see below).  The FileItem class offers some handy methods
> >such as write() and getOutputStream().
> >
> >Calling the extended action class to handle the form submission was a 
>real
> >eye-opener.
> >
> >Here is the version I created (doesn't do anything but spit out the file
> >size to sys.out):
> >
> >===>
> >package org.apache.jetspeed.modules.actions;
> >
> >import org.apache.turbine.modules.actions.*;
> >import org.apache.turbine.util.RunData;
> >import org.apache.turbine.util.Log;
> >import org.apache.turbine.modules.Action;
> >import javax.servlet.http.*;
> >import java.io.IOException;
> >import org.apache.turbine.util.upload.FileItem;
> >
> >public class FileUploadAction extends Action
> >{
> >    public void doPerform(RunData data) throws Exception
> >     {
> >         FileItem file =
> >data.getParameters().getFileItem("uploadfilename");
> >         System.out.println ("Size of uploaded file from (FileItem)
> >file.getSize(): " + file.getSize());
> >     }
> >}
> >====>
> >
> >Thanks again,
> >~spike
> >
> >-----Original Message-----
> >From: Scott Williams [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, September 17, 2001 12:29 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Multipart Form Submissions
> >
> >
> >Spike,
> >
> >I just did what you are trying to do.   Here's the
> >HTML:
> >
> ><FORM
> >action='http://<%=host%>:<%=port%>/jetspeed/portal?action=SWFileMoverAction
>'
> >METHOD='POST' ENCTYPE='multipart/form-data'
> >name='browse_form'>
> >     <BR>
> >     Choose a file to upload.
> >     <BR><BR>
> >     <INPUT TYPE=FILE NAME=file1>
> >     <BR><INPUT type='submit' name='submit'
> >value='Submit'>
> ></FORM>
> >
> >
> >Here's the action that I created, SWFileMoverAction:
> >
> >package org.apache.jetspeed.modules.actions;
> >
> >import org.apache.turbine.modules.actions.*;
> >import org.apache.turbine.util.RunData;
> >import org.apache.turbine.util.Log;
> >import org.apache.turbine.modules.Action;
> >import com.sw.jetspeed.*;
> >import javax.servlet.http.*;
> >import java.io.IOException;
> >import com.oreilly.servlet.MultipartRequest;
> >
> >
> >/*
> >  * This method is the action for the FileMover
> >portlet.
> >  */
> >  public class SWFileMoverAction extends Action
> >{
> >
> >     private String parent = "";
> >
> >     public void doPerform(RunData data) throws
> >Exception
> >     {
> >         HttpServletRequest request = data.getRequest();
> >
> >
> >         //begin
> >             try {
> >                   MultipartRequest multi =
> >                     new MultipartRequest(request,
> >"C:\\jakarta-tomcat-3.3-m4\\webapps\\test\\Marketing",
> >10*1024*1024); // 10MB
> >
> >                 }
> >                 catch (IOException lEx) {
> >                   Log.error(lEx + "error reading or saving
> >file");
> >     }
> >}
> >
> >
> >
> >
> >The form is submitted to the action SWFileMoverAction.
> >  The action creates a MultipartRequest which takes the
> >arguments: request, location to upload file, and the
> >file size maximum.
> >
> >HTH,
> >
> >
> >
> >
> >
> >--- Spike Hains <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I am trying to write a jsp portlet that will allow
> > > jetspeed users to upload
> > > files and would like to know how to I access the
> > > file element of a
> > > multi-part form submission from a jsp portlet?
> > >
> > > On submission, I'm doing this in the jsp portlet
> > > page:
> > >
> > > <%
> > > ...
> > > RunData data =
> > >
> >(RunData)pageContext.getAttributeJspService.RUNDATA,PageContext.REQUEST_SCO
>P
> > > E);
> > > FileItem myfile =
> > > data.getParameters().getFileItem("uploadfilename");
> > > ...
> > > %>
> > >
> > > I check 'data' before I try and get the fileitem but
> > > it is null. Should this
> > > work? Is there a more appropriate way to handle file
> > > uploading in jsp
> > > portlets?
> > >
> > > Originally I was going to use O'Reilly's multipart
> > > form classes and was able
> > > to upload files in a jsp page OUTSIDE of the
> > > jetspeed application directory.
> > > When I would put the same jsp file in a portlet, the
> > > request object seemed
> > > empty.
> > >
> > > Any input, suggestions or direction is appreciated.
> > >
> > > Thanks all,
> > >
> > > ~spike
> > >
> > >
> >---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >__________________________________________________
> >Terrorist Attacks on U.S. - How can you help?
> >Donate cash, emergency relief information
> >http://dailynews.yahoo.com/fc/US/Emergency_Information/
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to