Problem in getting the parameters from teh form html with upload file

I have used the jspsmartupload package:
the html file:
<HTML>
<BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 5</H1>
<HR>
<form METHOD="POST" ACTION="sample5.jsp"
NAME="PW" ENCTYPE="multipart/form-data">
<table CELLSPACING="0" CELLPADDING="3" BORDER="1" WIDTH="474">
<!-- FILE -->
<!-- TEXT -->
<tr>
<td width="150">
<div align="left">
<p><small><font face="Verdana">Text :  </font></small>
</div>
</td>
<td width="324"><small><font face="Verdana">
<input TYPE="TEXT" name="myText" value="">
<br>
</font></small></td>
</tr>
<!-- TEXTAREA -->
<tr>
<td width="150">
<div align="left">
<p><small><font face="Verdana">Text Area :  </font></small>
</div>
</td>
<td width="324"><small><font face="Verdana">
<textarea name="myTextArea" rows="4" value=""></textarea>
<br>
</font></small></td>
</tr>
<!-- PASSWORD -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">PassWord :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<input TYPE="PASSWORD" name="myPASSWORD" value="">
<br>
</font></small></td>
</tr>
<!-- HIDDEN -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">Hidden :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<input TYPE="hidden" name="myHidden" value="hidden">
<br>
</font></small></td>
</tr>
<tr>
<td><small><font face="Verdana">Select a first file : 
</font></small></td>
<td><small><font face="Verdana">
<input type="file" name="FILE1">
</font></small></td>
</tr>
<tr>
<td><small><font face="Verdana">Select a second file : </font></small></td>
<td><small><font face="Verdana">
<input type="file" name="FILE2">
</font></small></td>
</tr>
<!-- CHECKBOX -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">CheckBox :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<input TYPE="CHECKBOX" name="myCheckBox" value="Value 1">
Value 1<br>
<input TYPE="CHECKBOX" name="myCheckBox" value="Value 2">
Value 2<br>
<input TYPE="CHECKBOX" name="myCheckBox" value="Value 3">
Value 3<br>
</font></small></td>
</tr>
<!-- RADIO -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">Radio :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<input TYPE="radio" name="radio" value="Value 1">
Value 1<br>
<input TYPE="radio" name="radio" value="Value 2">
Value 2<br>
<input TYPE="radio" name="radio" value="Value 3">
Value 3<br>
</font></small></td>
</tr>
<!-- SELECT -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">Simple Select :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<SELECT name="mySimpleSelect" >
<OPTION value="Value 1">Value 1</OPTION>
<OPTION value="Value 2">Value 2</OPTION>
<OPTION value="Value 3">Value 3</OPTION>
</SELECT>
<br>
</font></small></td>
</tr>
<!-- SELECT MULTIPLE -->
<tr>
<td>
<div align="left">
<p><small><font face="Verdana">Multiple Select :  </font></small>
</div>
</td>
<td><small><font face="Verdana">
<SELECT multiple name="myMultSelect" >
<OPTION value="Value 1">Value 1</OPTION>
<OPTION value="Value 2">Value 2</OPTION>
<OPTION value="Value 3">Value 3</OPTION>
</SELECT>
<br>
</font></small></td>
</tr>
<!-- SUBMIT -->
<tr>
<td colspan="2" width="474">
<div align="center">
<center>
<p><small><font face="Verdana">
<input
TYPE="Submit">
</font></small>
</center>
</div>
</td>
</tr>
</table>
</form>
</BODY>
</HTML>
the jsp file :
<%@page language="java" import="com.jspsmart.upload.*"%>
<%@page import="java.util.*"%>
<jsp:useBean id="myUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<HTML>
<BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 5</H1>
<HR>
<%
     // Initialization
     myUpload.initialize(pageContext);
     // Upload
     myUpload.upload();          
     // Files
     out.println("<BR><STRONG>Display information about Files</STRONG><BR>");
     out.println("Number of files = " + myUpload.getFiles().getCount() + "<BR>");
     //out.println("Total size (bytes) = " + myUpload.getFiles().getSize() +"<BR>");
     for (int i=0;i<myUpload.getFiles().getCount();i++){
          out.print(myUpload.getFiles().getFile(i).getFieldName());
          if (!myUpload.getFiles().getFile(i).isMissing())
               out.print(" = " + myUpload.getFiles().getFile(i).getFileName() + " (" + myUpload.getFiles().getFile(i).getSize() + ")");
               myUpload.getFiles().getFile(i).saveAs("/upload/" + myUpload.getFiles().getFile(i).getFileName());
          else
               out.print(" = vide");          
          out.println("<BR>");
     // Request
     out.println("<BR><BR><STRONG>Display information about Requests</STRONG><BR>");
     // Retreive Requests' names
     java.util.Enumeration e = myUpload.getRequest().getParameterNames();
     // Retreive parameters
     while (e.hasMoreElements()) {
          String key = (String)e.nextElement();
          String[] values = myUpload.getRequest().getParameterValues(key);               
          // Browse the current parameter values
          for(int i = 0; i < values.length; i++) {
          out.print(key + " = ");
          out.print(values[i] + "<BR>");
%>
</BODY>
</HTML>
The result shown is:
jspSmartUpload : Sample 5
Display information about Files
Number of files = 2
FILE1 = path.txt (240)
FILE2 = WS_FTP.LOG (146)
Display information about Requests
radio = Value 2
mySimpleSelect = Value 1
myTextArea = test
myPASSWORD =
myMultSelect = Value 3
myHidden = hidden
myText = test
myCheckBox = Value 1
myCheckBox = Value 2
myCheckBox = Value 3
I would like to know if i want to get back the parameters from the form ,
is that i must use Enumeration.
Because i have tried request.getParameter() to get the value of radio button, textbox, checkbox and select menu, but it get the null values.
Also, the function of Enumeration does not get the values of parameter in sequence as html form. e.g.In the html file, the first parameters should be textbox,but it displays the radio button's values first.
How to solve the problem .
Thanks

This sounds like a bug in the smart upload code. I have used this stuff before, but it's probably an older version, so maybe they broke something. Enumerations aren't usually guaranteed to keep things in any particular order. I would say for now, make a method to take the enumeration and a param name to find the value. And write to the JSPSmart people.

Similar Messages

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • Get the parameters from the URL

    Hi all,
    In my applet I need to know the parameters that are in the URL. But I don't know how to do this.
    I started with this:
    String URL=getDocumentBase().toString();So URL has the full url, like: http://127.0.0.1./test.html?Testparam1=hello
    What I could think of is to use :
    int i = URL.getindexof("?Testparam1");
    String value =URL.substring(i);But that is not very handy when using more parameters.
    Is there an other way to get the parameters from the URL?

    You could use a regex or a StringTokenizer, but I'll bet there's a library somewhere that'll do it for you. Probably something in Apache Jakarta Commons. As far as I know there's nothing in the standard library that'll fully parse query strings for you, although you can use java.net.URLDecoder to decode the url-encoding (the %xx encoding).
    If you don't want to find a specialized library, then probably a regular expression is the easiest approach.

  • Get the month from a date column with the calculated column

    I am trying to get the month from a date field with the help of calculated column. However I get this syntax error whenever I want to submit the formula:
    Error 
    The formula contains a syntax error or is not supported. 
    the default language of our site is German and [datum, von] is a date field.

    Hi,
    I have created two columns
    Current MM-YY
    Calculated (calculation based on other columns)
    Today
    Date and Time
    Current MM-YY is calculated value with formula as
    =TEXT(Today,"mmmm")
    But the output shows as December instead of May.
    I have tried =TEXT([Datum, von];"mmmm") but no help.
    I am trying to populated the column automatically with current month..ex: if its May the field should show May, next month it should show June an so on.
    Any kind help is grateful.
    Regards,
    Pradeep

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • I keep getting the message: "what should firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    I keep getting the message: "what should Firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    cor-el,
    Thanks for your prompt reply. However, the sources you gave do not seem to apply exactly to my situation. I have attached some screenshots that show what the dialogue box looks like for a pdf download, and what my settings in the Apps panel of Options are. You will note in the first screenshot that I have checked the box to handle this file type automatically; however, the next time I try to download a file of that type, the same dialogue box appears looking exactly like the one shown, so checking the "automatic" option appears to do nothing. The files to be downloaded from my Gmail messages are not generic or altered file types - they are shown as pdf, doc, docx, etc. So while your intent was good, your post did not help. Thanks anyway.

  • How to get HttpServletRequest parameters from two forms in a JSP

    I have this JSP with two forms calling the same servlet. Problem is, when I use a submit button in the second form, I am unable to retrieve the request parameters from the form through the servlet. I am wondering if anybody could give me some info on how to get the request parameters from the second form. I tried to see all the parameter names in the request by calling request.getParameterNames(). But the parameters in the second form are not even seen in the request although I am clicking the submit button in this form!

    First, two forms works fine in one jsp so no need to argue about that.
    Second, did you put the form actions and type ("multipart/formdata " ?) explicit in every form header ? Did you supply different form names ?
    Try to call the submit function through javascript - document.forms[0].submit() for your first, and document.forms[1].submit() for your second form...
    Did you forget to close the form tag by chance ?

  • Custom authorization provider for WL7 problem (not getting all parameters from ContextHandler)

    I'm implementing a custom authorization provider for WebLogic 7.
    In my Access Decision isAccessAllowed method I need to check values of
    the parameters passed to an EJB method. Now, if an EJB method I have
    two parameters of the same type, for example int, when I get
    ContextElement array from ContextHandler and iterate through it to get
    names and values of the parameters I get the same value (value of the
    first int parameter) from both ContextElement's.
    Here is the code:
    String [] names = ch.getNames();
    for (int i = 0; i < names.length; i++)
    String name = names;
    System.out.println("name = " + name);//here it gets array of
    Strings, which contains two parameter names: "int","int",
    which are the types of EJB method parameters
    ContextElement[] ces= ch.getValues(names);
    for (int j = 0; j < ces.length; j++)
         ContextElement ce = ces[j];
         System.out.println(ce.getName()+ " = " + ce.getValue());
    //here if the value of the first int was 2 and the second 0,
    it would get 2 from both ContextElements (each of ContextElements will
    have name "int"
    If I try this with method parameters of different types, for example
    int with value 2 and long with value 0, then this code work fine -
    first ContextEleement has name int and value 2 and the second has name
    long and value 0.
    Thanks,
    -Oleg Kozlov.

    I'm implementing a custom authorization provider for WebLogic 7.
    In my Access Decision isAccessAllowed method I need to check values of
    the parameters passed to an EJB method. Now, if an EJB method I have
    two parameters of the same type, for example int, when I get
    ContextElement array from ContextHandler and iterate through it to get
    names and values of the parameters I get the same value (value of the
    first int parameter) from both ContextElement's.
    Here is the code:
    String [] names = ch.getNames();
    for (int i = 0; i < names.length; i++)
    String name = names;
    System.out.println("name = " + name);//here it gets array of
    Strings, which contains two parameter names: "int","int",
    which are the types of EJB method parameters
    ContextElement[] ces= ch.getValues(names);
    for (int j = 0; j < ces.length; j++)
         ContextElement ce = ces[j];
         System.out.println(ce.getName()+ " = " + ce.getValue());
    //here if the value of the first int was 2 and the second 0,
    it would get 2 from both ContextElements (each of ContextElements will
    have name "int"
    If I try this with method parameters of different types, for example
    int with value 2 and long with value 0, then this code work fine -
    first ContextEleement has name int and value 2 and the second has name
    long and value 0.
    Thanks,
    -Oleg Kozlov.

  • Having problem to get the value from radio button

    i am doing my double module project for my degree course and i am also a newbie in JSP. Hope there is someone can help me to solve this problem. Now, i set the value of a radio button to "don't smoke", "smoke lightly", and "smoke heavily". Then i use request.getParameter ("smoking behavior") to get the value selected by the user, but the result is only "don't" or "smoke", which the character after spacing will be not be retrieved. I dun know how to solve it, so can any expert here help me to solve this problem? Thanks for helping.

    Why do you have to use whitespace. If your radio button group is name smokingBehavior - no whitespace, wouldn't it just make sence to have values of don't, lightly and heavily. This would solve the problem easily. If your teacher is being a pain in the a&!, and requires you to use whitespace for your naming variables I guess you could insert %20 between the two words and unescape the value on the server side. This seems like a lot of unnecessary work and a silly solution - good luck!

  • Problem in getting the data from a cache in hibernate

    I am storing data inside a cache. When i am geeting the data from a cache its showing null.
    How can i retrieve the data from a cache.
    I am using EHCache

    Hi ,
    You have done one mistake while setting the input parameters for BAPI..Do the following steps for setting input to BAPI
    Bapi_Goodsmvt_Getitems_Input input = new Bapi_Goodsmvt_Getitems_Input();
    wdContext.nodeBapi_Goodsmvt_Getitems_Input().bind(input);
    Bapi2017_Gm_Material_Ra input1 = new Bapi2017_Gm_Material_Ra();
    wdContext.nodeBapi2017_Gm_Material_Ra().bind(input1);
    Bapi2017_Gm_Move_Type_Ra input2 = new Bapi2017_Gm_Move_Type_Ra();
    wdContext.nodeBapi2017_Gm_Move_Type_Ra().bind(input2);
    Bapi2017_Gm_Plant_Ra input3 = new Bapi2017_Gm_Plant_Ra();
    wdContext.nodeBapi2017_Gm_Plant_Ra().bind(input3);
    Bapi2017_Gm_Spec_Stock_Ra input4 = new Bapi2017_Gm_Spec_Stock_Ra();
    wdContext.nodeBapi2017_Gm_Spec_Stock_Ra().bind(input4);
    input1.setSign("I");
    input1.setOption("EQ");
    input1.setLow("1857");
    input2.setSign("I");
    input2.setOption("EQ");
    input2.setLow("M110");
    input3.setSign("I");
    input3.setOption("EQ");
    input3.setLow("309");
    input4.setSign("I");
    input4.setOption("EQ");
    input4.setLow("W");
    wdThis.wdGetWdsdgoodsmvmtcustController().execute_BAPI_GOODSMOVEMENT_GETITEMS();
    Finally inavidate your output node like
    wdContext.node<output node name>.invalidate();
    also put your code inside try catch to display any exception if any
    Regards,
    Amit Bagati

  • Problem while running the report from a form

    Hi,
    I am able to call a report from forms9i using run_report_object. This report just has a boilertext within it. I did this just to check the functionality of run_report_object built-in. This worked perfectly.
    But when I am trying to call a report based on emp table from the form, it gives me error saying that it cannot run the report.
    Can anyone please help me.
    Thanks
    Narain

    Hi Ino Laurensse ,
    Thanks for the response.
    The error code and message is as follows
    frm-41214 Unable to run report.
    I am able to call from forms9i a report with some boilertext but not a report accessing the database. Thro' out I have never changed the username.
    The following are the changes I made
    In the rwservlet.properties
    I specified the
    reportserver name = repsrv ( I created it and started from the services)
    singlesignon = no
    I am able to run the report which is accessing the emp table from the report builder with the same user as the one which I am using in forms, but, the same I am not able to call from forms.
    thanks
    Narain

  • Get the Common from Two Internal Tables with same structure

    Hi ,
    I need to get the Common data from Two Internal Tables with same structure with using the looping method.
    For e.g.
    I have two internal table say ITAB1 and ITAB2.
    ITAB1 has values A,B,C,D,E,F
    ITAB2 has values A,H,B,Y,O
    Output at runtime should be : A,B

    Hi mohit,
    1. If u want to compare all fields,
       for matching purpose,
       then we can do like this.
    2.
    report abc.
    data : a like t001 occurs 0 with header line.
    data : b like t001 occurs 0 with header line.
    loop at a.
      LOOP AT B.
        IF A = B.
          WRITE :/ 'SAME'.
        ENDIF.
      endloop.
    ENDLOOP.
    regards,
    amit m.

  • Problems while getting the Datasource from a Utill class

    Hi all,
    I faced a problem when following below instructions.
    http://dev.day.com/content/kb/home/cq5/Development/HowToConfigureSlingDatasource.html
    It would not return from the getDataSource(dataSourceName); call. No exceptions.
    public DataSource getDataSource(String dataSourceName) {
            DataSource dataSource = null;
            try {
             log.info("Reaches here ! ");
                dataSource = (DataSource) dataSourceService
                        .getDataSource(dataSourceName);
            log.info("Never Reaches here ! ");
            } catch (DataSourceNotFoundException e) {
                log.error("Unable to find datasource {}.", dataSourceName, e);
            return dataSource;
    I can connect to db directly from post.POST.jsp so DB is correctly mapped.
    I had to remove below annotation since while compiling the bundle, it says that it is deprecated.
         @scr.component immediate="true" metatype="no"
    Log is as follows...
    com.day.cqwebsite.impl.DatasourceUtilImpl -------------------------------------------- Using DataSourcePool service lookup to get connection pool mynewdsname
    26.09.2012 17:49:30.197 *INFO* [0:0:0:0:0:0:0:1 [1348661970143] POST /content/mywebsite_cq/en/toolbar/login.html HTTP/1.1] com.day.cqwebsite.impl.DatasourceUtilImpl Reaches here !
    26.09.2012 17:50:17.770 *INFO* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.impl.AgentManagerImpl Processing job for agent publish
    26.09.2012 17:50:17.770 *INFO* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish Sending POST request to http://localhost:4503/bin/receive?sling:authRequestLogin=1
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish Error while sending request: java.net.ConnectException: Connection refused: connect
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish Replication (ACTIVATE) of /etc/designs/mywebsite/images not successful: java.net.ConnectException: Connection refused: connect Conversation follows
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish ------------------------------------------------
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish Sending message to localhost:4503
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish >> POST /bin/receive HTTP/1.0
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish >> Action: Activate
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish >> Path: /etc/designs/mywebsite/images
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish >> Handle: /etc/designs/mywebsite/images
    26.09.2012 17:50:18.983 *ERROR* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish >> ...spooling 744 bytes...
    26.09.2012 17:50:18.983 *INFO* [pool-6-thread-32-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.impl.AgentManagerImpl Job for agent publish processed in 1213ms. Failed.
    Any help will be great !
    Tx

    Could you please use [1], verify & confirm. If does not work let me know cq version & jdbc jar you are using.
    [1]
    import org.apache.felix.scr.annotations.Component;
    import org.apache.felix.scr.annotations.Properties;
    import org.apache.felix.scr.annotations.Property;
    import org.apache.felix.scr.annotations.Service;
    @Component(immediate = true)
    @Service(value = DatasourceUtil.class)
    @Properties({
            @Property(name = "service.description", value = "Data Source lookup example"),
            @Property(name = "service.vendor", value = "Day Management AG")

  • How to Place the report in the WEB from Parameter Form

    Hello folks,
    We are using report 9i.
    From the one our form we are going call the report and get
    the parameter from Parameter form and generate the PDF format of report and show it in the WEB browser.
    Tried with option DesType "Cache" and Desformat "PDF" in the parameter form. It generates but does not show anything anywhere.
    But the following way it works. By calling from Browser directly and pass the parameter.
    /reports/rwservlet?report=Weekly_Status_3.rdf&userid=user/pass&destype=cache&desformat=pdf
    I would like to goto Parameter form, accept the values and generate pdf report and place it in the browser automatically.
    Suggestions please..
    Thanks,
    Senthil

    have paramform=yes added to your url, it will work.
    /reports/rwservlet?report=Weekly_Status_3.rdf&userid=user/pass&destype=cache&desformat=pdf&paramform=yes
    ideally all these can be set in a report server's config file cgicmd.dat.
    venkat

  • How to get the values from a html form embedded in a swing container

    Hi all,
    I am developing an application in which i have to read a html file and display it in a swing container.That task i made it with the help of a tool.But now i want to get the values from that page.ie when the submit button is clicked all the values of that form should be retrived by a servlet/standalone application.I don't know how to proceed further.Any help in this regard will be very greatful
    Thanks in advance,
    Prakash

    By parsing the HTML.

Maybe you are looking for