JSF File Upload in WebSphere 8.5 -


I am working on JSF 2.2 application where we have to upload some .csv files via web page. When we deploy on Tomcat, it works fine, but for some reason it is not working with the webspreader. For the example given below, I am trying to work:

index.html

   & Lt; / H: form & gt; & Lt; H: Output Label & gt; JSF implementation: # {fileUploadManagedBean.jsfimplementation} & lt; / H: Output Label & gt; & Lt; Br / & gt; & Lt; H: Output Label & gt; JSF version: # {fileUploadManagedBean.jsfVersion} & lt; / H: Output Label & gt; & Lt; / Ui: defined & gt; & Lt; ui: defined name = "footer" & gt; Footer & lt; / UI: defined & gt; & Lt; / ui: Composition & gt; & Lt; / Html & gt;   

And here is my backing bean, FileUploadManagedBean.java

  package com.mycomp.test; Import javax.faces.application.FacesMessage; Import javax.faces.bean.ManagedBean; Import javax.faces.bean.SessionScoped; Import javax.faces.context.FacesContext; Import javax.servlet.http.Part; Import org.apache.log4j.Logger; @Menniesben @ SessionsSpaced Folk Class file UPDLLGnenGebien {Public Static Logger Logger = Logger.Get Loger (File User Managed by Class); Private portion file; // public string upload uploaded file () {logger.info ("start bulk upload ..."); Logger.debug ("content-type:" + file.getContentType ()); Logger.debug ("filename:" + file.getName ()); Logger.debug ("size:" + file.getSize ()); Facial faces face face; FaceComment Messages (empty, new face messages (FacesMessage.SEVERITY_INFO, "uploaded", "uploaded")); Return tap; } Public Part GetFile () {Return File; } Public Zero Set File (Part File) {this.file = file; } Go to Public String getJsf Implementation () {FacesContext.class.getPackage (). GetImplementationTitle (); } Public string getJsfVersion () {return FacesContext.class.getPackage (). GetImplementationVersion (); When I open the page, it prints "Moziera" and "JSF 2.2", so I know that the backing bean is being reached and JSF 2.2 is being used, but when I click on "upload" If I do, Java is never called and there is no entry in the webspore log; The page just refreshes when I send the HTTP packet (from the browser's side), I see the file being sent in the post request, and then I get a 200 OK response.  

Any thoughts? After days of debugging and trying options, we have found that any service that is trying to read Web Sphere 8.5.5 is required.

Multipart data to add a multi-layout configuration to your definition in WebX file or use @MultipartConfig annotation for. It appears that JSF 2.2 servlet was not implementing it properly, since we have our web Added multipart-config element to XML file, everything worked fine on websphere.

I'm not sure why our code initially worked on Tomcat, but not in Websphere; I suspect that either the use of JSF 2.2 construction is faulty, or tomcat is just a little more forgiving, and we do not need to understand clearly.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -