Javazoom's file upload bean

Hello,
I downloaded the javaZoom file upload bean and cant get the SimpleUpload.jsp to run.
Does anybody have any experience with this?
I dropped the 4 jar files under the WEB-INF/lib directory (like they said)
I then dropped the SimpleUpload.jsp into my webapp root (like they said)
I try to run the jsp and I get the following error:
java.lang.ClassNotFoundException: org.apache.jsp.SimpleUpload_jsp
The problem is in the declarations at the top of the page (I think).
<%@ page language="java" import="javazoom.upload.*,java.util.*" %>
<%@ page errorPage="ExceptionHandler.jsp" %>
<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
  <jsp:setProperty name="upBean" property="folderstore" value="d:/uploads" />
</jsp:useBean>I am sure that I need to change the class="javazoom.upload.UploadBean" but I cant figure out what I need to change it to.
If I use the war file to install the uploadBean It works fine. Unfortunately I need to incorporate it into an existing application.
When I use the war file(tomcat 4) I get a directory called webapps/uploadbean created. I need to use the bean(4 jar files) with my existing app under webapps/SAMNEW.
Any Ideas?
TIA!
*********************************************************Here is the full exception report if anyone wants to see it.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
     at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:500)
     at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:150)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:195)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
     at java.lang.Thread.run(Thread.java:534)
root cause
java.lang.ClassNotFoundException: org.apache.jsp.SimpleUpload_jsp
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:209)
     at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
     at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:497)
     at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:150)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:195)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
     at java.lang.Thread.run(Thread.java:534)

Change this : value="d:/uploads" ....
and put your correct path ...
Bye

Similar Messages

  • File Upload Bean doesn't work

    I installed the file upload bean and made the path and classpath settings required, but the file is not uploaded to the server.
    Any idea? Does it work standalone, i mean, am i only call the cgi URL or I need to construct a form and put a field that represents the file upload bean?
    Another issue: I can't import java classes by the Oracle Forms 6i builder. Any suggestion?
    The forms version is 6i patchset 4 in a AIX 4.3.3 server machine.
    Thanks in advance.
    Caroline Holanda

    regarding Another issue: I can't import java classes by the Oracle Forms 6i builder. Any suggestion?
    search for the string "Failed to create JVM" in forms forum and you might get some info about this.

  • How to remove clear button on message file upload bean item?

    Dear Guru's.
                    How to remove clear button on message file upload bean item .
    Regards,
    Srinivas

    Hi Raghu,
    This is srinivas i am also facing this issue how u achieve this can u share me this is urgent for me .
    Regards,
    Srinivas

  • File upload demo / call_form / exit_form

    I have the file upload bean demo form working properly. Now I want to open the fileupload form as a modal window.
    However, if I call the fileupload form using call_form then the application hangs after uploading a file and then exiting the fileupload form.
    If I open the fileupload form using the open_form command then the exit_form works fine.
    Why won't call_form allow me to exit_form without hanging the application?

    If you install the 9i demos from OTN, they include the fileupload sample and the installation does all the setup for you including the classpath etc.

  • File Upload Pluggable Java Component / Java Bean

    Dear Colleague,
    I integrated the File Upload java bean into one of my Forms 9i forms. I also had it up and running (!!!), but after I rebooted the machine, I no longer receive the File Upload dialog window as I did originally. When I press the button which starts the File Upload, it never displays the window to select a file. My trigger is as follows:
    begin
         /* Initialize the Java Bean */
         FileUploader.init('DOCU_BLOCK.FILE_UPLOADER','LOAD_CALLBACK_TRIGGER');
         /* Make sure the file is compressed on upload */
         FileUploader.setCompressed(true);
         /* Do the load to the c:\rolic\RKMS_documents\ directory on the server */
         FileUploader.UploadFile (:PARAMETER.file_destination);
    /* Error Handling */
    exception
    when FileUploader.FileUploaderEx then
    message (FileUploader.GetError);
    end;
    I have the "uploadclient.jar" file in my folder: C:\oracle9iDS\forms90\java
    I list the "uploadclient.jar" file in the forms config file, formsweb.cfg as follows:
    archive_jini=f90all_jinit.jar, uploadclient.jar, RKMS_images.jar
    and I reference the uploadserver.jar in the default.env file as part of the CLASSPATH as follows:
    CLASSPATH=c:\oracle9iDS\jlib\debugger.jar;c:\oracle9iDS\jlib\ewt3.jar;c:\oracle9iDS\jlib\share.jar;c:\oracle9iDS\jlib\utj90.jar;C:\oracle9iDS\forms90\java\UploadServer.jar
    =========================================================
    - Why did this work before I rebooted and now no longer???
    - Any tips? Ideas?
    =========================================================
    The uploadclient.jar file also successfully loads as shown in the Java Console:
    Oracle JInitiator: Version 1.3.1.9
    Using JRE version 1.3.1.9 Java HotSpot(TM) Client VM
    User home directory = C:\Dokumente und Einstellungen\Randy
    Proxy Configuration: no proxy
    JAR cache enabled
    Location: C:\Dokumente und Einstellungen\Randy\Oracle Jar Cache
    Maximum size: 50 MB
    Compression level: 0
    Loading http://quantum:8888/forms90/java/f90all_jinit.jar from JAR cache
    Loading http://quantum:8888/forms90/java/uploadclient.jar from JAR cache
    Loading http://quantum:8888/forms90/java/RKMS_images.jar from JAR cache
    connectMode=HTTP, native.
    Forms Applet version is : 90290

    HI,
    I'm facing nearly same problem.
    When i press a button in my form to enable client to select image from there local computer, following code executes ( WHEN-BUTTON-PRESSED)
    declare
         exSetup EXCEPTION;
         hButton ITEM := Find_Item('UPLOAD.SELECT');
    begin
    if (:upload.output_dir is null) then
    MsgBox.Show(MsgBox.STOP_ALERT,FileUploader90,'Error: A output directory on the middle tier must be specified');      
    raise exSetup;
    end if;
    FileUploader.UploadFile(:UPLOAD.output_dir);
    /* (:UPLOAD is a control block and output directory is a text field char 1000 having initial property = D:\IMAGE) */
    exception
    When FileUploader.FileUploaderEx then
         MsgBox.Show(MsgBox.STOP_ALERT,FileUploader90,'Error During Upload: '||FileUploader.getError);      
    When exSetup then
    null;
    end;
    There is no compiliation error.
    Runtime error is " Error During Upload: Desitnation directory does not exists or is not writeable ".
    Infact destination directory D:\IMAGE exists and is readable/writable to any one ??
    Any Help possible

  • Java bean File Upload - Error-105101

    We were having earlier the same problem of 105100 error. As the solution, suggested earlier in the thread posted by Teguh Santoso, the classpath settings that was mentioned ealier was done, the certificate was imported in the client machine.
    At the web-browser-client machine, the "Select" button in the "fileupload" demo form is opening the FileDialog(that cleared the earlier problem). But on selecting a file in it, the error ORA-105101 is occuring for the WHEN-CUSTOM-ITEM-EVENT..... But both the progress bars, the one that is there for encoding of the seleced file, and the one that is there for the uploading gets displayed. On searching the "c:\temp" folder(folder where the file is intended to be uploaded to) of the application server, we see that the particular file has not been uploaded.
    The same thing is working alright when we do it in the 9iAS machine, when using the "Run on Web" option in the 6i-FormBuilder.
    What additional settings are to be done for using the file-upload utility through web-forms? Please help..
    Thank you
    Regards
    Ranjith.

    If you press KEY-LISTVAL in the Upload demo form it will message out the current classpath for you. If that fails as well it's because the basic Java Runtime classes cannot be found.
    The general things to have to watch in the setup (on the Application server) are:
    1) A Java 1.2.2+ runtime environment is available
    2) The /jre/bin/classic directory is in the O/S PATH for Windows, or the LD_LIBRARY_PATH for SOLARIS or the SHLIB_PATH for HP. This is so that Forms can locate the JVM.DLL (Windows) or libjvm.sl/so (UNIX)
    3) The CLASSPATH needs to contain the 1.2.2+ Java runtime jar file rt.jar. This is in the /jre/lib directory.
    4) The CLASSPATH should of course also contain the UploadServer.jar

  • Threading problem during File Upload with Apache faces upload tag

    First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
    1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
    2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
    3) Validates Input(Checks to see whether the User has input the correct file)
    4) Updates Backing Bean or Model to reflect the values.
    5) Renders response to user.
    I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
    <h:form id="uploadForm" enctype="multipart/form-data">
    <x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
    </h:form>
    In the backing bean
    private UploadedFile fileContents;
         public UploadedFile getFileContents() {
              return fileContents;
         public void setFileContents(UploadedFile fileContents) {
              System.out.println("File being uploaded...");
              this.fileContents = fileContents;
    Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
    In web.xml i am using like this
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>600m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>10m</param-value>
    </init-param>
         <init-param>
    <param-name>uploadRepositoryPath</param-name>
    <param-value>/uploadfolder/</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    The upload process is working perfectly fine.
    Now coming to the problem:
    Suppose one user is logging into the application & uploading say 400MB of files.
    Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
    The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
    I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
    Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.

    Dear friend,
    i am also trying to upload using the common file upload.
    when try to run the file error is coming
    can give some suggestion.
    can i use if concurrent user file upload at a time

  • Calendar & File Upload Components - Threadinar6

    Hi All,
    This is the sixth in the "Threadinar" series , please see Threadinar5 at
    http://swforum.sun.com/jive/thread.jspa?threadID=99473 for details
    In this Threadinar we will focus on the
    "Calendar" and "File Upload" Components
    Let us begin our discussion with the Calendar Component.
    Calendar Component
    You can drag the Calendar component "calendar component icon" from the Palette's Basic category to a page open in the Visual Designer to create an entry field with an integrated calendar pop-up to help the user pick dates for the field.
    You can also drop the calendar on a container component, like a table cell or group box.
    After dragging the component to the Visual Designer, you can work with the following useful properties of the Calendar Component:-
    General
    * id. Type: String
    The name of the Calendar component in the page bean and the JSP file.
    Appearance
    * columns. Type: int
    The number of character columns used to render the component. The default value is 20.
    * dateFormatPattern. Type: String
    The format of the date to be entered by the user. It is not usually necessary to set this property because a pattern is chosen automatically based on the locale.
    If you prefer to specify a date format, click the ellipsis button (...) to the right of the property and select a predefined date format from the property editor's list. You can also add your own formats. If you add a format, the values you can enter are limited to some combination of yyyy for the year, MM for the month, and dd for the day separated by separator characters. Typical separator characters are / (slash), . (period), and - (dash). For example, the following date formats are acceptable:
    o MM/dd/yyyy
    o yyyy.MM.dd
    o MM-dd-yyyy
    * dateFormatPatternHelp. Type: text
    Text that appears below the date entry field and shows the format pattern that the date entry field accepts. If you have not set the dateFormatPattern property, the help text is chosen automatically for you. If you have set the dateFormatPattern property, you should bind the dateFormatPatternHelp property to a localized string that matches the setting for each locale you want to support.
    * label. Type: String
    A label that appears next to the text entry field, typically describing what the user is supposed to enter.
    o Note: The label property is not as flexible as the Label component. You can use the Label component if you want more control over the label's appearance, such as positioning of the label relative to the component.
    * labelLevel. Type: int
    A number that affects the appearance of the label. 1 (Strong) is larger and bold. 2 (Medium), the default, is smaller and bold. 3 (Weak) is smaller and normal (not bold). This property takes effect only if the label property is set.
    * style. Type: String
    Cascading Style Sheet rules (CSS level 2) to be applied to the component. For example:
    position: absolute; left: 288px; top: 312px
    You can enter values directly or click the ellipsis (...) button to use the Style Editor.
    o Note: This property overrides any settings in the theme or the project CSS file for this component. If a style specified in this property does not appear to take effect, it is because an area of the component is obscured by a child component that has different style settings.
    For a list of CSS2 style attributes, see the web page at
    http://www.w3.org/TR/REC-CSS2/propidx.html
    * styleClass. Type: String
    A space-separated list of CSS2 style classes to be applied when the component is rendered. The style classes must be defined in the project's style sheet or in the theme's CSS file. If you click the ellipsis button (...), you see a list of all styles you can add to this property. For information on adding CSS classes and rules to the project's cascading style sheet, see CSS Editor.
    o Note: See the note above under the style property description for an explanation of why a class added to this property might appear to have no effect on the component.
    o Note: If you add a CSS style class from the current theme to your project CSS file and you redefine the style class, the change affects all components that use this style class. However, you can add your own style classes to the project CSS file that redefine the default style classes, and then when you add them to this property, the changes affect only this instance of this component.
    For the defaulttheme.jar CSS style classes for this component, see Calendar Component CSS Classes.
    Data
    * maxDate. Type: java.util.Date
    The last date that the user can select. The default value is four years from the date set in the minDate property, for a total span of five years.
    * minDate. Type: java.util.Date
    The earliest date that the user can select. The default value is the value of the selectedDate property, which defaults to the current date if that property is not set.
    * required. Type: boolean
    If selected, the user must enter a value for the calendar before the page can be submitted. If you add a Message component to the page and link its for property to this component, an error message will be displayed if the user tries to submit the page without entering a value.
    * selectedDate. Type: Date
    A java.util.Date object representing the calendar date selected by the user. If you right-click the component and choose Bind to Data, you can bind this property to a data provider or object that can process the user entered value on the server.
    When the component displays initially, if this property is not set, its value defaults to the current date. If you provide values for minDate and maxDate, you can also provide a value for this property that initially displays a date in that range.
    * validator. Type: MethodBinding
    Indicates the JavaServer Faces validator that is called when the value is submitted. A validator ensures that the correct value is entered by a user. Choose a validator from the drop-down list. If you choose (null), no validator is called. If you choose a validator, also select the required property to ensure that the validator is used. For descriptions of JavaServer Faces validators, see the list of topics at List of Validators.
    o Note: If you define your own validate method, for example, by right-clicking the component and choosing Edit Event Handler > validate, any value you might have set in this property is overridden.
    File Upload Component
    You can drag the File Upload component "file upload component icon" from the Palette's Basic category to the Visual Designer to create an entry field and a browse button that opens a file chooser dialog on the local system, enabling the user either to select a file or to type a file name into the entry field. When the page is submitted, a copy of the file's contents is sent to the web application.
    The component is similar to an HTML <input type="file"> element.
    * Note: This component is neither supported by nor available in portlet projects due to security reasons.
    * Note: The size of the component in the Visual Designer might not match the size of the component when it is rendered in a web browser, making the component appear to line up correctly in the Visual Designer, but not when the page is rendered in the user's web browser. Also, the rendering of this component can differ depending on the web browser. Be sure to test the component in the web browsers that you expect your users to use. For example, if you add a width setting to the style property that is smaller than the setting in the columns property, Internet Explorer observes only the width setting, while the Mozilla browser ignores it and sets the width according to the number of characters in the columns property.
    The File upload component uses a filter, a com.sun.rave.web.ui.util.UploadFilter object that is configured for you in the web application's deployment descriptor. The UploadFilter uses the Apache commons fileupload package. You might need to change these settings in the following two cases:
    * The server holds the uploaded file in memory unless it exceeds 4096 bytes; otherwise, the server holds the file contents in a temporary file. You can change this threshold by modifying the sizeThreshold parameter for the UploadFilter filter entry in the web application's web.xml file.
    * By default, the File Upload component can handle files up to one megabyte in size. You can change the maximum file size by modifying the maxSize parameter for the UploadFilter filter entry in the application's web.xml file.
    o
    A negative value for the maxSize parameter indicates that there is no file size limit. Setting the parameter to a negative value is not recommended for security reasons. For example, if you allow unlimited file sizes, a malicious user could mount a denial of service attack on your site by using extremely large files
    * To change the settings for the UploadFilter object in the web.xml file:
    1. In the Files window, expand project-name > web > WEB-INF.
    2. Double-click the web.xml node to open the file in the XML editor.
    3. Click the Filters toolbar button.
    4. In the UploadFilter section under Initialization Parameters, you can change the values for the maxSize and sizeThreshold parameters.
    The contents of the uploaded file, together with some information about it, are stored in an instance of com.sun.rave.web.ui.model.UploadedFile. By using this object, you can get the content of the file as a String or write the contents to disk, as well as get properties such as the name and the size of the file. In the interest of conserving memory, the contents and file data are only available during the HTTP request in which the file was uploaded. To access the contents of the uploaded file, bind the uploadedFile property to a bean property of type com.sun.rave.web.ui.model.UploadedFile. Have the setter or an action method process the file.
    The UploadedFile interface has methods for getting the name and size of the file, determining the file's MIME type (such as text/plain or image/jpeg), getting the file's contents as bytes or as a String, and writing the contents to disk. To learn more, in the Java editor, right-click on UploadedFile in a declaration statement and choose Show JavaDoc from the pop-up menu.
    * To set the component's properties, select the component and edit its properties in the File Upload Properties Window.
    * Right-click the component and choose one of the following pop-up menu items:
    o Edit validate Event Handler. Opens the Java Editor with the cursor positioned in the component's validate method so you can insert code to validate the value of the component.
    o Set Initial Focus. Gives this component focus when the user opens the page.
    o Auto-submit on Change. Causes the form to be automatically submitted if the value of the component changes. Sets the component's JavaScript onclick property to common_timeoutSubmitForm(this.form, 'component-id');. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
    A component configured to Auto-submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.
    o Bind to Data. Bind the component's text property to an object or to a data provider. For more information, see Bind to Data Dialog Box.
    o Property Bindings. Bind any of the component's properties to an object or data provider, such as the uploadedFile property to a bean property of type com.sun.rave.web.ui.model.UploadedFile.
    o Configure Virtual Forms. Enables you to add the component to a virtual form.
    For more details on using the "File Upload Component" Please see this tutorial
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/file_upload.html
    Please share your comments, experiences, additional information, questions, feedback, etc. on these components.
    ------------------------------------------------------------------------------- --------------------

    Of interest relating to file upload component to users : "Saving Uploaded Files Uploaded by the File Upload Component " Check the blog:
    http://blogs.sun.com/roller/page/divas

  • I am getting this error while file uploading

    Hi!
    I am getting this error while file uploading,I can't find any solution.
    SRVE0026E: [Servlet Error]-[org.apache.commons.fileupload.FileUpload: method setSizeMax(I)V not found]: javax.servlet.ServletException: org.apache.commons.fileupload.FileUpload: method setSizeMax(I)V not found
    at com.honeywell.sdm.base.controller.SDMActionServlet.service(SDMActionServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
    at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
    at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    Please help me.I have attached the bean,action ,jsp pages
    uploadInfo.jsp
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>
    <HEAD>
    <script>
    function submitting(){
    document.uploadForm.operation.value = "uploadOrgAdj";
    document.uploadForm.action = "/uploadRecAction.do";
    document.uploadForm.submit();
    </script>
    </HEAD>
    <body>
    <html:form action="/uploadRecAction" method="post" enctype="multipart/form-data">
    Select the .xls File to upload data
    <html:file property="fileName"></html:file>
    <html:hidden property="operation" value=""/>
    <html:button property="btn" value="Submit" onclick="submitting()"></html:button>
    </html:form>
    </body>
    </html:html>
    uploadAdjForm :
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.upload.FormFile;
    public class uploadAdjForm extends ActionForm{
    private FormFile fileName;
    * @return
    public FormFile getFileName() {
    System.out.println("getFileName"+fileName);
    return fileName;
    * @param string
    public void setFileName(FormFile string) {
    System.out.println("setileNmame"+string);
    fileName = string;
    Action:
    public class uploadFinancialAdjAction extends DispatchAction{
    public org.apache.struts.action.ActionForward uploadOrgAdj(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception {
    String sForward = "UploadInfo";
    HttpSession session = request.getSession();
    String sStartIndex = null;
    String sEndIndex = null;
    try
    uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
    System.out.println(UploadForm.getFileName().getContentType().toString());
    String file=UploadForm.getFileName().toString();
    uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
    ArrayList fileName = new ArrayList(); fileName = businessManager.getOrgAdjDetails(file);
    boolean isMultipart = FileUpload.isMultipartContent(request);
    if(isMultipart){
    // Create a new file upload handler
    DiskFileUpload upload = new DiskFileUpload();
    // Parse the request
    List items = upload.parseRequest(request);
    //Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();
    if (item.isFormField()) {
    //processFormField(item);
    if(item.getFieldName().equalsIgnoreCase("txtStartIndex")){
    sStartIndex = item.getString();
    else if(item.getFieldName().equalsIgnoreCase("txtEndIndex")){
    sEndIndex = item.getString();
    uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
    String file=UploadForm.getFileName().toString();
    uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
    ArrayList fileName = new ArrayList();
    fileName = businessManager.getOrgAdjDetails(file);
    }else{
    if(item.getName()!=null && !item.getName().toUpperCase().endsWith(".XLS")){
    throw new Exception("Please browse an excel file and Upload");
    session.setAttribute("fileItem",item);
    }//end of while
    session.setAttribute("startIndex",sStartIndex);
    session.setAttribute("endIndex",sEndIndex);
    request.setAttribute("FileUploadStatus","true");
    else{
    throw new Exception("Error:Form is not multipart");
    catch(Exception e)
    System.out.println(e);
    return mapping.findForward(sForward);
    }

    Plz answer for my question

  • Problem using File upload in portlets

    hello there
    I'm trying to use file upload component in one of my portlets. I searched a lot about a working component to be used in portlets since the standard one that comes with JSC doesn't work in portlets. I managed to get commons file upload and tomahawk to run in my portlet, but when I choose a file and try to get selected file's details it throughs a NullPointerException reporting that the file object is null.
    so please can anyone guide me to a working portlet example, I tried to find one but I couldn't. if that's hard to find, what should I do ?
    thank you in advance

    I added file upload component in JSF from portlets in Sun Java Portal server.
    Take a look...
    portlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
    version="1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
    <description>SFTB Anonymous Mail Portlet</description>
    <portlet-name>SFTBAnonymousMailPortlet</portlet-name>
    <display-name>SFTBAnonymousMailPortlet</display-name>
    <portlet-class>org.apache.portals.bridges.portletfilter.FilterPortlet</portlet-class>
    <init-param>
    <name>portlet-class</name>
    <value>com.sun.faces.portlet.FacesPortlet</value>
    </init-param>
    <!-- Filter for MyFaces Tomahawk extension. -->
    <init-param>
    <name>portlet-filters</name>
    <value>jp.sf.pal.tomahawk.filter.ExtensionsPortletFilter</value>
    </init-param>
    <init-param>
    <description>Portlet init page</description>
    <name>com.sun.faces.portlet.INIT_VIEW</name>
    <value>/jsp/index.jsp</value>
    </init-param>
    <supports>
    <mime-type>text/html</mime-type>
    <portlet-mode>VIEW</portlet-mode>
    <portlet-mode>EDIT</portlet-mode>
    <portlet-mode>HELP</portlet-mode>
    </supports>
    <portlet-info>
    <title>&#1054;&#1090;&#1087;&#1088;&#1072;&#1074;&#1082;&#1072; &#1087;&#1088;&#1077;&#1076;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1081;</title>
    <short-title>&#1054;&#1090;&#1087;&#1088;&#1072;&#1074;&#1082;&#1072; &#1087;&#1088;&#1077;&#1076;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1081;</short-title>
    </portlet-info>
    </portlet>
    </portlet-app>
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>SFTBAnonymousMailComment</display-name>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <!--
    Extensions filter from Apache MyFaces Tomahawk used for uploads files.
    -->
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    <description>Set the size limit for uploaded files.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    <description>Set the threshold size - files
    below this limit are stored in memory, files above
    this limit are stored on disk.
    Format: 10 - 10 bytes
    10k - 10 KB
    10m - 10 MB
    1g - 1 GB
    </description>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>FacesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>FacesServlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>
    Files in WEB-INF/lib
    commons-beanutils-1.7.0.jar
    commons-collections-3.2.jar
    commons-digester-1.8.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.2.jar
    commons-logging-1.1.1.jar
    faces-response-filter-0.2.jar
    jsf-api-1.1_02.jar
    jsf-impl-1.1_02.jar
    jsf-portlet-1.1.5.jar
    jstl-1.1.0-D13.jar
    log4j-1.2.9.jar
    portals-bridges-portletfilter-1.0.jar
    standard-1.1.0-D13.jar
    tomahawk-1.1.6.jar
    tomahawk-bridge-0.9.1.jar
    Files tomahawk-bridge-0.9.1.jar, faces-response-filter-0.2.jar may be found there http://sourceforge.jp/projects/pal/
    In JSF beans I'm using org.apache.myfaces.custom.fileupload.UploadedFile
    Hope this helps.
    Bests,
    Alex Magdenko

  • Getting error while file uploading in struts

    Hi!
    I am getting this error while file uploading,I can't find any solution.
    SRVE0026E: [Servlet Error]-[org.apache.commons.fileupload.FileUpload: method setSizeMax&#40;I&#41;V not found]: javax.servlet.ServletException: org.apache.commons.fileupload.FileUpload: method setSizeMax(I)V not found
         at com.honeywell.sdm.base.controller.SDMActionServlet.service(SDMActionServlet.java:75)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
         at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
    Please help me.I have attached the bean,action ,jsp pages
    uploadInfo.jsp
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html:html>
    <HEAD>
    <script>
    function submitting(){
    document.uploadForm.operation.value = "uploadOrgAdj";
    document.uploadForm.action = "/uploadRecAction.do";
    document.uploadForm.submit();
    </script>
    </HEAD>
    <body>
    <html:form action="/uploadRecAction" method="post" enctype="multipart/form-data">
    <b>Select the .xls File to upload data </b>
    <html:file property="fileName"></html:file>
    <html:hidden property="operation" value=""/>
    <html:button property="btn" value="Submit" onclick="submitting()"></html:button>
    </html:form>
    </body>
    </html:html>
    uploadAdjForm :
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.upload.FormFile;
    public class uploadAdjForm extends ActionForm{
         private FormFile fileName;
              * @return
              public FormFile getFileName() {
                   System.out.println("getFileName"+fileName);
                   return fileName;
              * @param string
              public void setFileName(FormFile string) {
                   System.out.println("setileNmame"+string);
                   fileName = string;
    Action:
    public class uploadFinancialAdjAction extends DispatchAction{     
         public org.apache.struts.action.ActionForward uploadOrgAdj(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception {
              String sForward = "UploadInfo";               
              HttpSession session = request.getSession();          
              String sStartIndex = null;
              String sEndIndex = null;
    try
         uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
         System.out.println(UploadForm.getFileName().getContentType().toString());
         String file=UploadForm.getFileName().toString();     
    uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
         ArrayList fileName = new ArrayList();                                   fileName = businessManager.getOrgAdjDetails(file);
              boolean isMultipart = FileUpload.isMultipartContent(request);
              if(isMultipart){
              // Create a new file upload handler
              DiskFileUpload upload = new DiskFileUpload();
              // Parse the request
              List items = upload.parseRequest(request);
              //Process the uploaded items
              Iterator iter = items.iterator();
              while (iter.hasNext()) {
                   FileItem item = (FileItem) iter.next();
                   if (item.isFormField()) {          
              //processFormField(item);
              if(item.getFieldName().equalsIgnoreCase("txtStartIndex")){          
                   sStartIndex = item.getString();          
              else if(item.getFieldName().equalsIgnoreCase("txtEndIndex")){
                             sEndIndex = item.getString();          
    uploadFinancialAdjForm UploadForm=(uploadFinancialAdjForm)form;
                             String file=UploadForm.getFileName().toString();               
              uploadFinancialAdjManager businessManager = new uploadFinancialAdjManager();
                             ArrayList fileName = new ArrayList();
                             fileName = businessManager.getOrgAdjDetails(file);
              }else{
                   if(item.getName()!=null && !item.getName().toUpperCase().endsWith(".XLS")){
              throw new Exception("Please browse an excel file and Upload");
              session.setAttribute("fileItem",item);
              }//end of while
              session.setAttribute("startIndex",sStartIndex);
              session.setAttribute("endIndex",sEndIndex);
              request.setAttribute("FileUploadStatus","true");
              else{
              throw new Exception("Error:Form is not multipart");
    catch(Exception e)
         System.out.println(e);
         return mapping.findForward(sForward);
    }

    ORA-06512: at "PREPRD.OIM_SP_RECONARCHIVAL", line 722
    ORA-00942: table or view does not exist
    ORA-01031: insufficient privileges
    (1) Check whether the OIM_SP_RECONARCHIVAL table or view exists or not...
    (2) If it exists, check whether the DEV_OIM user has enough privilege to view this table or not...
    If not, give it all privilege by login as sys as sysdba
    GRANT ALL PRIVILEGES TO DEV_OIM;
    COMMIT;

  • File Upload problem: JSF, IBM WPS and Portlet - Please HELP Vey Very Urgent

    I want to upload a file from the front end using JSF and Portlets deployed on IBM WebSphere Portal.
    I have used Apache's commons file upload functionality as the file upload provided in JSF doesnot work with portlets and the action event is not invoked If I keep enctype="multipart/form-data". So I included 3 forms in my Faces JSP file.
    1) h:form = For displyign error message on screen
    2) html:form = Include the enctype="multipart/form-data" and the input type file for uploading. And a submit button
    3) h:form: Here I have a command link which is remotely excuted on click of sumit button in my html form. This is to invoke the action event in the pagecode to get the bean value from the context.
    Now in the my doView method in the portlet, isMultipartContent(httpservletrequest) always returns null as the content type is text/html and not multipart. Onclick of the submit button in the the html form I am calling a javascript function which sets the __LINK_TARGET__ to the command link in the 3rd h:form which will call the page code.
    The problem here is action is invoked only when I return false from the above javascript else it will trigger for the first time and from second time onwards it will not invoke the action event in the pagecode method. Whent the javascript function returns false, the content type is always text/html. However if I return "true" from the javascript the content type is multipart/form-data, but the action is not triggered for the second time. So basically when the javascript functions returns true, for the first click everything works perfectly. When it returns false, the content type is text/html, but the action is invoked in the page code every time.
    Returning always true would solve my problem with the content type, but the action with the command link will not get invoked always as its some type of problem with h:commanLink :(.
    I guess I gave too much info. Heres my code stepby step.
    Can somebody please tell me , how I should also invoke the action in the page code and get the content type as "multipart/form-data" at the same time.
    1:
    ======================= Faces JSP File: BPSMacro.jsp ====================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="GENERATOR" content="IBM Software Development Platform">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="/WEB-INF/tld/j4j.tld" prefix="j4j"%>
    <%@taglib uri="/WEB-INF/tld/core.tld" prefix="core"%>
    <%@page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1" session="false"%>
    <portlet:defineObjects />
    <link rel="stylesheet" type="text/css"
         href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/stylesheet.css") %>'
         title="Style">
    <script type="text/javascript">
    function formSubmit() {
         var formName2 = document.getElementById("proxy_form_main_").title;
         var formName1 = document.getElementById("BPSMacroFormId").title;
         document.getElementById("__LINK_TARGET__").value = document.getElementById("proxy_HD_COMMAND_").title;
         document.getElementById(formName2).submit();
         return false;
    </script>
    <f:view>
         <hx:scriptCollector id="bpsMacroScriptCollector">
              <f:loadBundle var="bps" basename="bordereauprocessingsystem" />
              <table bgcolor="#FFF9C3">
                   <tr>
                        <td><h:form id="BPSMacroFormMain" styleClass="form">
                             <table class="tablemiddle" cellspacing="0" cellpadding="0">
                                  <tr>
                                       <td><h:messages layout="table" styleClass="errormessage"
                                                 id="ValidationErrorMsg" /> </td>
                                  </tr>
                             </table>
                             <j4j:idProxy id="proxy_form_main_0_" />
                        </h:form></td>
                   </tr>
                   <tr>
                        <td>
                        <form id="BPSMacroFormId" enctype="multipart/form-data">
                        <table bgcolor="#FFF9C3">
                             <tr>
                                  <td height="36" width="324">Worksheet <input type="file"
                                       name="upfile" /></td>
                             </tr>
                                  <tr>
                                       <td align="center" width="324"><input TYPE="submit"
                                       onclick="return formSubmit();" value="Upload">
                                  </td>
                             </tr>
                        </table>
                        </form>
                        </td>
                   </tr>
                   <tr>
                        <td>
                        <h:form id="BPSMacroFormMain2" styleClass="form">
                             <table cellspacing="2" cellpadding="2" class="tablemiddle">
                                  <tbody>
                                       <tr>
                                            <td colspan="2" align="center"><h:commandLink
                                                 styleClass="commandLink" id="lnkuserdelete"
                                                 action="#{pc_BPSMacro.doIdUpload1Action}">
                                                 <hx:graphicImageEx
                                                      styleClass="graphicImageEx" id="imgBtnCreateUser"
                                                      value="/theme/images/btnUpload.gif" style="border:0;cursor:pointer"></hx:graphicImageEx>
                                                 <j4j:idProxy id="proxy_HD_COMMAND_" />
                                            </h:commandLink></td>
                                            <h:inputHidden id="dtSize"
                                                 value="#{pc_BPSMacro.fileDetailsList.clicked}">
                                                 <j4j:idProxy id="proxy_clicked_" />
                                            </h:inputHidden>
                                       </tr>
                                  </tbody>
                             </table>
                             <j4j:idProxy id="proxy_form_main_" />
                        </h:form>
                   </td>
                   </tr>
              </table>
         </hx:scriptCollector>
    </f:view>
    ================== END: FACES JSP FILE: BPSMacro.jsp ========================
    2:
    =================== Action event in the Page Code: BPSMacro.java ============
    public String doIdUpload1Action() {
              System.out.println("PageCode");
              FacesContext context = FacesContext.getCurrentInstance();
              BPSMacroDetailsDataBean fileDetails = (BPSMacroDetailsDataBean)context.getApplication().createValueBinding("#{fileDetails}").getValue(context);
              BPSMacroListDataBean fileDetailsList = (BPSMacroListDataBean)context.getApplication().createValueBinding("#{fileDetailsList}").getValue(context);
              PortletSession sess = (PortletSession)context.getExternalContext().getSession(false);
              sess.setAttribute("BPS_MACRO_CONTEXT", context, PortletSession.APPLICATION_SCOPE);
              sess.setAttribute("BPS_MACRO_FILE_DETAILS", fileDetails, PortletSession.APPLICATION_SCOPE);
              sess.setAttribute("BPS_MACRO_FILE_LIST", fileDetailsList, PortletSession.APPLICATION_SCOPE);
              HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
              boolean isMultipart = ServletFileUpload.isMultipartContent(request);
              request.getContentType();
              return "gotoBPSMacro";
    ============== END Of Page Code Action event ==============================
    3:
    ============== doView() Portlet method ================================
    public void doView(RenderRequest arg0, RenderResponse arg1)
         throws PortletException, IOException {
              String METHOD_NAME = "doView(RenderRequest arg0, RenderResponse arg1)";
              Logger.debug(this.getClass(), METHOD_NAME, "Entering BPSMacroPortlet");
              FacesContext context = FacesContext.getCurrentInstance();      
              PortletSession sess1 = arg0.getPortletSession(true);
              BPSMacroDetailsDataBean fileDetails = new BPSMacroDetailsDataBean();
              BPSMacroListDataBean fileDetailsList = new BPSMacroListDataBean();
              context = (FacesContext)sess1.getAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
              if(context != null){
                   fileDetails = (BPSMacroDetailsDataBean)sess1.getAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
                   fileDetailsList = (BPSMacroListDataBean)sess1.getAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
              HttpServletRequest servletRequest = (HttpServletRequest)arg0;
              PortletRequest pReq = (PortletRequest)arg0;
              HttpServletResponse servletResponse= (HttpServletResponse)arg1;
              System.out.println("\n\n Content Type" + servletRequest.getContentType());
              try{
                   if(context != null){
              boolean isFileMultipart = ServletFileUpload.isMultipartContent(servletRequest);
              System.out.println("\nFILE TO BE UPLOADED IS MULTIPART ? " + isFileMultipart);
              if(isFileMultipart){
                   FileItemFactory factory = new DiskFileItemFactory();
                   ServletFileUpload upload = new ServletFileUpload(factory);
                   List items = upload.parseRequest(servletRequest);
                   Iterator iterator = items.iterator();
                   while (iterator.hasNext()) {
                        FileItem item = (FileItem) iterator.next();
                        InputStream iStream = item.getInputStream();
                        ByteArrayOutputStream ByteArrayOS = new ByteArrayOutputStream();
                        int sizeofFile =(int) item.getSize();
                        byte buffer[] = new byte[sizeofFile];
                        int bytesRead = 0;
                        while( (bytesRead = iStream.read(buffer, 0, sizeofFile)) != -1 )
                             ByteArrayOS.write( buffer, 0, bytesRead );
                        String data = new String( ByteArrayOS.toByteArray() );
                        int k = 0;
                        //Check if the file is Refund or Premium
                        int dynamicArraySize = 0;// = st2.countTokens() * 9;
                        dynamicArraySize = st2.countTokens() * 9;
                        if (!item.isFormField() ){
                             File cfile=new File(item.getName());
                             String fileName = "";
                             String separator = "\\";
                             int pos = item.getName().lastIndexOf(separator);
                             int pos2 = item.getName().lastIndexOf(".");
                             if(pos2>-1){
                                  fileName =item.getName().substring(pos+1, pos2);
                             }else{
                                  fileName =item.getName().substring(pos+1);
                             File fileToBeUploaded=new File("C:\\Sal\\BPS MACRO\\FileTransfer\\Desti", fileName);
                             item.write(fileToBeUploaded);
                             validate.displaySuccessMessage(context);
              }catch(Exception e){System.out.println(e);
              Logger.debug(this.getClass(), METHOD_NAME, "Leaving BPSMacroPortlet");
              super.doView(arg0, arg1);
    ==== END: doView method in the portle class. ================================
    Thanks.

    one more question. Is there a way where I can submit two forms ?
    Thats is submit 2nd form only when the first form is submitted.
    I tried this it works.
    function formSubmit(){
    document.form1.submit();
    alert();
    document.form2.submit();
    But If I dont put an alert(basically it disables the parent page) in between, only the second form is submitted.
    If I put a delay of say 3 seconds in between then it will throw a SOCKET CLOSED error in the code triggered due to first form submit.
    Thus disabling the paresnt page for a few seconds is reolving my problem.
    Any ideas ?
    Well Basically when the Alert pop's up the parent page "STALLS" and thus the form2 does not submit till I click on OK, Is there a way I can stall the browser/Parent JSP page using JAVA SCRIPT ??
    Edited by: hector on Oct 9, 2007 11:09 AM
    Edited by: hector on Oct 9, 2007 2:12 PM

  • File Upload PJC questions

    File Upload PJC
    I have installed the File Upload PJC demo & got it working.
    We are using Forms 6i patch 8 with servlet configuration, iAS 1.0.2.2.1 on Win 2000, Oracle 8.173
    We want to upload/download files to the server & save them as BFILES in the database. I think I am on the right track but have some questions:
    What do I have to change in the PJC to increase the memory so I can upload a file > 4 MB? We will be uploading some large files. I'd also like to ability to select multiple files to upload. I don't know much about Java programming but will learn if this is the best way to accomplish this.
    I want to upgrade to Forms patch 12. I understand that it uses Jinitiator 1.3 & that it will popup a dialog when it sees a new signed Jar file & will automatically import the certificate if the user decides to trust it - but I read on the Technet forum there is a bug 2483719 - does this work with patch 12?
    We also want to use the Native JVM for IE (when it will work with XP - is this patch 13?). What do we have to change if we create a signed CAB file?
    We also need the reverse to download a file to the client - WITHOUT using web.show_document - since this does not always prompt you with a save dialog box & tries to open the file in the browser.
    Any ideas will be helpful - thanks.
    [email protected]

    Laura,
    these are many questions in one post and I try to answer it as good as I can
    We want to upload/download files to the server & save them as BFILES in the database. I think I am on the right track but have some questions:
    What do I have to change in the PJC to increase the memory so I can upload a file > 4 MB? We will be uploading some large files.
    As far as I know there is no restriction to the size of the file uploaded to the server. There exist a recommendation of to which size this bean has been tested. Due to the implementation of the Bean there are defined chunk sizes for the data passed, but this does not limit the size of a downloaded file.
    I'd also like to ability to select multiple files to upload. I don't know much about Java programming but will learn if this is the best way to accomplish this.
    Actually you will have to change the code then. First you need to set a porperty on the file dialog allowing the selection of multiple files. Next you will have to handle multiple files in the bean code. Yes, without Java you will not get there.
    want to upgrade to Forms patch 12. I understand that it uses Jinitiator 1.3 & that it will popup a dialog when it sees a new signed Jar file & will automatically import the
    certificate if the user decides to trust it - but I read on the Technet forum there is a bug 2483719 - does this work with patch 12?
    The problem is that you use a different (custom) signature for the upload bean, after modifying it, that requires the user to first grant it permissions. The bug means that this currently cannot be handled with Jinitiator 1.3.x. The work around is explained in a Whitepaper on OTN about signing Java Bean in Forms (Forms9i collateral section). There is no dependency to teh Forms patch you use, but to Jinitiator. So yes, teh work around will work there.
    We also want to use the Native JVM for IE (when it will work with XP - is this patch 13?).
    Possibly. That's the target patch.
    What do we have to change if we create a signed CAB file?
    You'll have to use the Microsoft SDK and refer to their documentation on how to create and use signed cab files. Shoudl be no big difference though.
    We also need the reverse to download a file to the client - WITHOUT using web.show_document - since this does not always prompt you with a save dialog box & tries to
    open the file in the browser.
    This is a problems with files that the Browser has a MIME type map for. If you download a file with the .gif extension, then this is a known MIME type configured in the HTTP Server. Therefore the Browser recognizes that the downloaded stream is a gif file and tries to render it. You can work around it by making sure that the downloaded file extension is not knwon by the HTTP server (Mime type application/word).
    Frank

  • File upload with non-ascii name

    I'm designing a system that includes file-uploads. My problem is that any non-ascii chars in the filename are encoded strangely when saved. &auml; is encoded to a&#778; etc.
    I use Tomcat with the -Dfile.encoding="UTF-8" in the Catalina file. I get the same result despite method; my own implementation, apache commons or Javazoom's uploadBean. All the JSP charset parameters are set.
    Any ideas?

    Hi amitads,
    I'm sure u've used Java enough. Also, u must have learned about the \ (backslash) escape character ?
    So, if u want to include a string like a single quote, u can write \' and for a double quote u can write \".
    Try this ... I'm sure it will help.
    Keep me posted.
    Cheers !!
    Sherbir.

  • File Upload Problem in JSF

    Hi all,
    I have a problem in file upload. I have a file upload third party component which uploads the file with the filter action depending on the url. My requirement is to trace the uploaded filename for addressing it with the database record. So I need the filename in my backing bean to store it in the database. Ho can i get the filename from view page to backing bean. Any Ideas and help please.
    Many thanx,
    vijaycanaan

    Mr BalusC,
    Yes Iam talking about a custom made upload component. The fileupload tutorials u send are good but my requirement is not meeting them. Among my requirements one is mutilple file uploads in the single view page. This is possible at present with my custom upload componet. Only if the problem gets solved. Any way once again please think on my problem and give your solution on it.
    Here is my problem:
    The problem is I have to access the components from view page which this kind of requirement possible in jsp by request parsing which results the key value pairs of the form components. This same thing/way I should get in backing bean from JSF view page.
    The solution I want may like as follows.
    Note this code is incorrect and wrong but for to understand my requirement.
    someobject.getComponentIdValue("clientID"); which returns a string value as d:\images\Tutle.jpg
    The clientID is upload file component' Id . In the request it may be the key associated with value as file complete path. By this kind of way my upload filter is able to get the orignal file. Ok i need this in my  backing bean to get the orignal filename to insert into the database. Please for this give the solution or reply.many thanx,
    vijaycanaan.

Maybe you are looking for