incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harry Metske" <harry.met...@gmail.com>
Subject Re: Upload Question
Date Wed, 08 Oct 2008 15:51:57 GMT
my previous answer was a bit too much in a hurry....

first your compile, Eclipse tells you there is no method getHttpRequest for
a wiki context, that is strange, looking at the source it does have it :

........
    /**
     *  If the request did originate from a HTTP request,
     *  then the HTTP request can be fetched here.  However, it the request
     *  did NOT originate from a HTTP request, then this method will
     *  return null, and YOU SHOULD CHECK FOR IT!
     *
     *  @return Null, if no HTTP request was done.
     *  @since 2.0.13.
     */
    public HttpServletRequest getHttpRequest()
    {
        return m_request;
    }
.......

and if you can't compile it, I shouldn't even try to run it.
Maybe you can reply the complete source of your plugin ?

regards,
Harry

2008/10/8 Benedikt Mohrmann <mohrmann@mail.upb.de>

> Hi,
>
> thanks for your answer- I already had a look at commons fileupload.
> But the problem is, when I use:
>
> HttpServletRequest request = context.getHttpRequest();
>
> JSPWiki tells me
>
> HttpServletRequest cannot be resolved to a type
>   The type javax.servlet.http.HttpServletRequest cannot be resolved.
>
> In addition I am implementing my plugin in Eclipse and it tells me that
> there is no method getHttpRequest for a wiki context.
>
> Best regards
> Benedikt
>
>
>
>
> Harry Metske schrieb:
>
>  Benedikt,
>>
>> in your plugin you have access to the HttpServletRequest (
>> HttpServletRequest request = context.getHttpRequest(); ) .
>> Once you have this, I think you can use many samples/tools to handle the
>> uploaded file, but maybe the best one is commons fileupload (
>> http://commons.apache.org/fileupload/using.html), this binary jar is
>> already
>> in the JSPWiki distribution.
>>
>> regards,
>> Harry
>>
>> 2008/10/7 Benedikt Mohrmann <mohrmann@mail.upb.de>
>>
>>
>>
>>> Hi,
>>>
>>> my intention is to upload a file via JSPWiki, but not as an attachment.
>>>
>>> I am trying to upload a file, thus I created a form containing a file
>>> chooser and a submitbutton.
>>> The goal is, that the input file is transferred to the server and then
>>> handled by a plugin I wrote.
>>>
>>> The plugin just puts the file as a Serializable into a database (which
>>> already works, when I read a file from my harddisk).
>>> But I am not yet not able to transfer the content of the file as a stream
>>> or something like that.
>>>
>>> Any experiences how this could work?
>>>
>>> Best regards
>>> Benedikt
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
met vriendelijke groet,
Harry Metske
Telnr. +31-548-512395
Mobile +31-6-51898081

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message