cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <>
Subject Re: file path after transfer in cxf
Date Tue, 16 Dec 2008 10:11:13 GMT
You can get it in your jaxws application like this :
@Resource WebServiceContext context;

HttpServletRequest request = (HttpServletRequest)context.getMessageContext()

Cheers, Sergey

----- Original Message ----- 
From: "Gill Bates" <>
To: <>
Sent: Tuesday, December 16, 2008 12:06 AM
Subject: file path after transfer in cxf

> Hi all,
> I've recently implement a method transfer byte[] through webservice  
> and then write it to the file at my server side.
> But then here comes the problem.
> If it's in web controller action, I could use  
> request.getSession().getServletContext().getRealPath() to get the path  
> of webroot.
> But in cxf there's no such request object.
> What if I want to transfer the file to WebRoot/upload directory?
> I tried something like MyClass.class.getResources("/").getPath() to  
> get the path of current class , and then append some strings to get  
> the real path of WebRoot/upload, but it looks different in different  
> web containers.
> Anyone has an better idea?
> Yours
> Yanchuan Li

View raw message