Getting parameters from text and file input tag. .  canyou help me ?

Hello!
Is there anyway of getting parameters from an
text field input in a form like :
<form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >Actually I would like to insert the parameters and make the upload of an file
on the same form. It is something likethis :
Form.jsp
<form name="signinForm" method="post" action="uploadFile.jsp" enctype="multipart/form-data" >   
<input type="text" id="name" name="signinName" />
<input name="signinFile" id="fileUp" type="file" />   
<input type="submit" id="submit_btn" name="signinSubmit"/>uploadingFile.jsp
<%@ page import="java.io.*,javax.servlet.http.HttpServletRequest,javax.servlet.ServletInputStream" %>
<%@ page import="java.io.FileWriter,java.io.IOException" %>
<%
.//upload the file
String email = request.getParameter("signinName").trim(); //this line is bringing me an NullPointerException
%>Thanks in advance for any suggestion!!
All the best!

You cannot use the HttpServletRequest object to retrieve parameters from a multipart form. You'll have to use a package that can parse such a form. I suggest Apache commons FileUpload.
http://jakarta.apache.org/commons/fileupload/
Using this package you can get both the file upload and any other parameters.

Similar Messages

  • How to run a project which gets parameters from a batch file

    Hello all,
    I use to run a program, which gets parameters only by interactive mode, using a batch file as you can see below:
    # myprogram < batchfile.txt
    Now, I'm updating its code by SunStudioExpress IDE and I'd like to run it from the batchfile. I have noticed that the project properties window has the option run -> arguments, however this program doesn't accept arguments this way and for changing it, I'd have a hard job.
    Does someone know how to run this project and to get its parameters from batchfile?
    Regards,
    Glauber

    Ah, it appears that when you run the project, "<" is passed as one of the arguments and is not treated as input redirection.
    Sorry, it looks like it is not possible to do the redirection; and it looks like a bug to me. Could you please file it through bugs.sun.com? It shouldn't take long as the problem is evident now.

  • Cant get data from text file to print into Jtable

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest

    Here's a thread that loads a text file into a JTable:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=315172
    And my reply in this thread shows how you can use a text file as a simple database:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=342380

  • LoaderInfo get values from EMBED and OBject Tag (not FlashVars)

    hi
    i try get values from object and embed tags like bgColor and
    allowFullScreen
    but i cant find how i can it
    loaderInfo.parameters return only flashVars
    if some body know it please help
    thank you
    Sonettic Cinema
    Project

    <forward name="success" path="/jsp/success.jsp" redirect="true" />
    but when success.jsp page gets called its not displaying the username and usertype values on page.The request has been redirected to success.jsp(*redirect="true"*) and hence the attributes stored in request object will not be available in success.jsp. Use Session to store login user information instead.

  • When I get messages from Barnes and Noble, the text is blank. If I hit reply or forward, I can then see the content. This only happens with Barnes and Noble. Any suggestions on how to view the content?

    When I get messages from Barnes and Noble, the text is blank. If I hit reply or forward, I can then see the content. This only happens with Barnes and Noble. Any suggestions on how to view the content?

    I'm sorry, but your sister, unless she had already turned on the "Find my iPhone" feature and the person who took the phone has not disabled it, is out of luck. She should report the theft to local police authorities, including the serial number of her iPhone. While her experience is unfortunate, there are good reasons why Apple cannot do anything else about it.
    I hope she gets her phone back.
    Best of luck.

  • How to get result from another JSP file?

    I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).
    The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.
    How can I call other.jsp to get the result? Thanks a lot.

    Hi, I think I didn't describe the problem clearly
    enough. In fact, there is a JSP file, and if our
    database is currently connected, the JSP will return
    value 1, otherwise, it will return 0. My java program
    need to get that result, and then form an XML string,
    and send the string back to the client. I'm just
    wonder how can I write such a program to read result
    from JSP file. Thanks a lot.Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

  • I am having a big problem. I am not getting notifications from snapchat and only snapchat. I've made sure every notification setting was on and it just won't work. I have also restored my phone and deleted the app and re-downloaded it multiple times. Help

    I am having a big problem. I am not getting notifications from snapchat and only snapchat. I've made sure every notification setting was on and it just won't work. I have also restored my phone and deleted the app and re-downloaded it multiple times. It just wont give me my notifications. Help please.

    Go to Settings > Privacy > Location Services.
    Turn off SnapChat.
    Go to Settings > Notification Center
    Turn off SnapChat.
    Restart the device.
    Go to Settings > Privacy > Location Services.
    Turn on SnapChat.
    Go to Settings > Notification Center
    Turn on SnapChat.
    Test the issue.

  • Why am I all of a sudden getting all my text and email notifications in Spanish?  How do I change back to English?  Can't find in profile settings?!

    Why am I all of a sudden getting all my text and email notifications in Spanish?  How do I switch back to English?  I can't find that option in profile or notification settings . . .

        elliew,
    That's a great point! If all other messages and apps on your phone are in English, the preferred language may need to be updated on your account. If this is the case for any of our customers, just reach out to our customer support team at 800-922-0204 or http://vz.to/1vsIHJq .
    BrianP_VZW
    Follow Us on Twitter @VZWSupport

  • I have tried to change my User id which is an email address I no longer want to use. Now I am constantly getting requests from icloud and Apple ID for my password and cant get into my icloud account.

    I have tried to change my User id which is an email address I no longer want to use. Now I am constantly getting requests from icloud and Apple ID for my password and cant get into my icloud account.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone, then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • My daughter has an iPhone and some how we share an iCloud account and she's getting all my texts and contacts. I can't find where to uncheck her phone number on my phone account. Please help

    My daughter and I both  have an iPhone and some how we share an iCloud account and she's getting all my texts and contacts. I can't find where to uncheck her phone number on my phone account so she doesn't get all my texts and contacts. Please help

    Hi Shellyk,
    Go to Settings>Messages>Send & Receive and make sure that only your personal email addresses are listed under the individual phone number.Remove the "shared" iCloud email address.
    For the Contacts, if you are syncing them via iCloud and you both have the same iCloud account, you will both have the same Contact list.
    Cheers,
    GB

  • How to bulk import data into CQ5 from MySQL and file system

    Is there an easy way to bulk import data into CQ5 from MySQL and file system?  Some of the files are ~50MB each (instrument files).  There are a total of ~1,500 records spread over about 5 tables.
    Thanks

    What problem are you having writing it to a file?
    You can't use FORALL to write the data out to a file, you can only loop through the entries in the collection 1 by 1 and write them out to the file like that.
    FORALL can only be used for SQL statements.

  • I need to burn a cd from itunes. There is no burn option...at all. I've tried right-clicking and file command. Please help

    I need to burn a cd from itunes. There is no burn option...at all. I've tried right-clicking and file command. Please help

    I have Windows 7 on a Dell.  Open and play iTunes in the compatability mode and use Windows XP (service pack 2).  Disregard any messsages to disable the compability mode.  This has worked for me.  I have also reinstalled iTunes and played with burn speeds etc.  These ideas did not work.  Compatability mode works.

  • Ok so I got my iPod back from the Walmart care plan. My iPod broke so Walmart fixed it. But now I any sign into iMessage or FaceTime! And I really want to text and FaceTime.  So please help!! Thank you!!

    Ok so I got my iPod back from the Walmart care plan. My iPod broke so Walmart fixed it. But now I any sign into iMessage or FaceTime! And I really want to text and FaceTime.  So please help!! Thank you!! ☺

    Maybe:
    iOS: Troubleshooting FaceTime and iMessage activation
    iOS: Troubleshooting FaceTime
    iOS: Troubleshooting Messages
    It is not clear what "But now I any sign into iMessage or FaceTime! " means

  • I don't no much, but I can follow instructions. How can I get my rental movie from my iPhone to my iPad.... And I've rentented another movie, now I want to get it from pc to iPad....help be much appreciated...

    I don't know much, but I can follow instructions. How can I get my rental movie from my iPhone to my iPad.... And I've rented another movie, now I want to get it from pc to iPad....help be much appreciated...

    Did you rent the film directly on the iPhone ? I've never rented films, but from : http://support.apple.com/kb/HT1415 :
    You can move the rental between devices as many times as you wish during the rental period. However, the movie can only be played on one device at a time. If you rent a movie on an iPhone, iPad, iPod touch, or Apple TV, it is not transferable to any other device and you must watch it on that device.
    If you've rented a film on your computer's iTunes then you should be able to sync it to your iPad from your computer's iTunes via the Movies tab that shows on the right-hand side of iTunes when you've selected the iPad 'device' on its left-hand side

  • I have 2 computers (1 Pc and 1 MAC) and 1 Iphone.The I phone is synchronised with the PC. I want to synchronised it also with my MAC, without erasing all my music and files. Someone can help me to find the answer ?

    I have 2 computers (1 Pc and 1 MAC) and 1 Iphone.The I phone is synchronised with the PC. I want to synchronised it also with my MAC, without erasing all my music and files. Someone can help me to find the answer ?
    i have already try the copy/paste thing with the ID of the file "iTunes Music Library.xml" it didn't change a thing. each time I relaunched Itunes, the ID is the first I have in the MAC.
    I have more than 5 000 files of music. I don't want to recreate one by one all my playlits.
    Many thnaks for your answers.
    Constance

    You can sync iphone with one and only one computer at a time.  If you sync to another, it will erase the current content and replace with content form the new computer.  There is no way around this.
    Put everything on one computer and sync from there.
    BTW, you posted in the Home Share forum.  Your question seems to have nothing to do with home share.

Maybe you are looking for

  • OID connection error for partner application

    Hello All I have registered a partner application which run from Oracle application server OC4J and when i login via URL, I get following error below, any suggestions?. All parameters are correctly specified. AJPRequestHandler-ApplicationServerThread

  • Iweb website not showing up at all on any search engine

    Hello, I recently switched from Windows to a Mac (and its a big improvement, really pleased with it). As we run 2 tiny businesses, one of my first projects was to make 2 websites in iweb and publish them via ftp to the domains I purchased (both hoste

  • Excel File Format Problem while downloading in ALV Grid

    Hi All, My program gives an ALV Grid Output which contains the file download button , when I choose spread sheet as the file format , the actual data starts only from 4th line and the lines above it contain date, heading etc and the rest are blank. I

  • Authorizing

    I recently purchased a VGA adapter for my iPad 2, wishing to use it in my classroom to share some of my photographs and some purchased content. Everything is fine until I attempt to show a movie and am told that my display has not been authorized. Th

  • Cant read archived iPhoto library

    Hi I copied off my iPhoto library to another partition while reinstalling OSX tiger. I have now replaced the iphoto library on the freshly installed OSX but iphoto does not see it. The library was created by iPhoto 1.1.1 and it is 1.1.1 that I am usi