I just skimmed over your email so I'm not sure if this will work for you, but I would use org.apache.struts2.interceptor.FileUploadInterceptor
That interceptor will populate the action with a File object. http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html On Tue, Jun 24, 2008 at 12:17 PM, Bhattacharya, Mousami <[EMAIL PROTECTED]> wrote: > Hi, > We have a web application (using struts 1.1) which works fine on Sun > application server. while migrating the application to weblogic 9.2, > this file upload issue is coming. > java.lang.ClassCastException: > org.apache.struts.upload.MultipartRequestWrapper > > The error occurs in the perform method of the > org.apache.struts.tiles.UrlController class, when its trying to call > requestDispatcher.include. > > I think the problem is that UrlController is not unwrapping the Request > from the MultipartRequestWrapper . RequestProcessor does something like > this > // Unwrap the multipart request, if there is one. > if (request instanceof MultipartRequestWrapper) { > request = ((MultipartRequestWrapper) request).getRequest(); > } > > When I change the UrlController (which is part of the struts1.1 jar ) to > add the above lines ,the fileupload works fine. Is this a bug in struts > 1.1 tiles , or has something to do with weblogic [ since the same code > without changes works in sun application server) > > stack trace : > java.lang.ClassCastException: > org.apache.struts.upload.MultipartRequestWrapper > at > weblogic.servlet.internal.ServletRequestImpl.getOriginalRequest(ServletR > equestImpl.java:1313) > at > weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatche > rImpl.java:328) > at org.apache.struts.tiles.UrlController.perform(UrlController.java:111) > at > org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Til > esRequestProcessor.java:243) > at > org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tiles > RequestProcessor.java:309) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: > 279) > at > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) > at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > > > -- Elliot
