Problem in submiting form data in multipal frames

Hello,
I have a html with two frames. I have a situation in
with I want to submit data from frame2 on some action
in frame1. Problem is I am trying to submit data of
frame2 with out selecting any button of href in that
jsp so how can I handle the submit request in
ViewBean?
Thanks
-Mayur

First check what sort of button you are using. It should be of "submit" type.
Check the URL to witch URL it is submitting i.e. Action property in <FORM> tag.
Make sure for the URLs in the client i.e HTML ex: href, action, and so on use the thumb rule of prefixing "<%=request.getContextPath()%>/" in your JSP or in servlet add it in the java code.
This should solve the relative URL reference problem.
Hope this helps.
Cheers.

Similar Messages

  • IE11 can't post form data to specific frame or window dialog opened via window.open()

    Hello,
    Form POST targeting to specific frame or dialog popped up via window.open() no longer works in IE11.
    It worked fine in IE10 and all previous versions of IE.
    Please see screenshot attached with simple test that reproduces this problem.
    Direct Link to screenshot:
    http://173.231.98.44/cgi/TestFolder/IE_11_widow_frame_targeting_BUG.jpg
    Direct link to simple test page demonstrating this problem:
    http://173.231.98.44/cgi/TestFolder/page2.asp
    Note: IE11 doesn't report any errors, doesn't complain about anything, even when debugged via F12 developer tools. The only thing it complained initially was missing doc type declaration on top of page, but even after adding doc type definition, problem still
    persists, makes no difference.
    I tested this on fresh install of Windows 2012R2 while testing our web application with the new IE11.
    I believe doing this on Windows 8.1 with IE11 will result in same bug/problem.
    Our web application uses a technique whereby it launches a popup window via call to window.open(), passing blank URL and specifying a name for the new window. It then does a from post targeting the name of new dialog.
    In IE11 this functionality has been broken and no longer works.
    Problem is that IE11, instead of posting form to the newly created dialog, it launches a new instance of IE and then loads the requested form in this new instance of IE, while the dialog launched via window.open() remains on screen and is empty. If user repeats
    launching same form post request (via button click for example), IE 11 keeps creating new empty dialogs and new IE instance for every form post executed. This totally breaks our application because we use many so called "wizards" that encapsulate
    specific functionality in separate web page launched in a popup window.
    Another related problem is that if a dialog is launched with window.open(), the java script code in the dialog can not target the parent frame that opened the dialog anymore. In our application, when a dialog is closed, it typically needs to trigger a refresh
    of a specific frame within the parent window (again targeted by name) to reflect saved/updated info that user entered in the popup dialog. The result is that we can't refresh the parent frame after the pop up dialog closes. Instead, IE11 launches
    a new instance of IE (not just a tab, but a whole new instance) and loads the parent frame in it.
    The problem seems to be caused by broken frame name targeting mechanism in IE11.
    Note that we force IE to compatibility mode 5, but even without specifying any compatibility, the problem remains.
    Typical java script to reproduce this is:
    <input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog">
    function Popup(f){
        window.open("","MyNewDialogName","width=200,height=150");
        f.action = "page3.asp";
        f.target = "MyNewDialogName";
        f.submit();
    Expected: IE11 should correctly post form to and load targeted page in the newly popped up dialog, without opening new IE instance and new tab. Repeatedly posting form to existing popup window should reuse that window, not keep on launching more popup windows
    and then more IE instances.
    Steps to reproduce the problem (include URL if applicable):
    URL with sample page: http://173.231.98.44/cgi/TestFolder/page2.asp
    1) Create page1.htm: <html><body>display "I'm in a popup window now ..."</body></html>
    2) Create page2.htm with a button and onclick() event calling function to open dialog, and do form POST targeting new dialog calling page1.htm, like below.
    <input type="button" onClick="Popup(this.form);" name="btn2" value="Popup Dialog"> function Popup(f){
        window.open("","MyNewDialogName","width=200,height=150");
        f.action = "page1.asp";
        f.target = "MyNewDialogName";
        f.submit();
    3) Open IE11, navigate to page2.htm, click the "Popup Dialog" dialog button. IE 11 will popup the new dialog, but then it will also launch new instance of IE11 and display the page1.htm in it, instead of in the popup dialog.
    Has anyone else encountered this problem?
    Any insight or help is appreciated.
    Regards
    Peter

    the default action of <input type="button" is submit. Note also that the default type of <button> elements is 'submit' also.
    add a return false to the onclick inline event handler (which constructs the form submit attribues) to cancel the default form.submit behavior.
    form elements have a target value with which you can specify the name window into which you want the form to open in.
    <form action="process.aspx" target="popup">
    you can use the window.open method with a query uri to achieve the same outcome.
    window.open('process.aspx?s=search+term&amp;foo=bar','popup',{features})
    the outcomes of all scripted windows are affected by
    your IE Popup blocker and tabbed browsing settings
    which in turn is affected by your IE Security zone settings (for popup blocking handling)
    and the settings of any third-party popup blocker you may have installed and enabled... it may not necessarily be visible on your browser toolbar.
    The first step in troubleshooting web browser issues is to test in no-addons mode.
    Use the Developer Tool to find out what documentMode the test page is opening in on your system. On Modal/Modeless popup windows use the f12 key to display the Developer tool positioned on the contentWindow.
    Use File>Properties to find out what IE Security zone it maps to... there is a security setting to prevent navigation into zones of lower integrity.
    Rob^_^

  • Problem submitting form data to FTP server

    Hi
    Sorry for the newbie question, and sorry if this has been covered elsewhere--I wasn't sure what to search for!
    I've created a form that I will disseminate to a large group of people. After filling the form, I'd like them to be able to hit a submit button that sends the data (or the entire form, whichever is most effective) to an FTP server that will store the data so I can import it into a .response file and eventually export to Excel.
    The web team at my university has set up an FTP server that has login credentials for a dropbox and different credentials to manage files in that dropbox. When you visit the sites in firefox, it asks you for a login.
    I've created the submit button on the form, and I followed the steps included in the LC Designer help. I've tried all four "submit as" options. My FTP site address is in the "Submit to URL:" box (as ftp://xx.server.edu, where xx and server are the location provided to me by the web team). When save it, open it in Acrobat, and insert test data into the form and press submit, however, nothing happens. I get no login dialogue, and no files appear in the dropbox.
    The server people don't think it's an issue on their end, as I can access the FTPs through a browser, so clearly I'm doing something wrong with the design of the form or the setup of the Submit button.
    Any help is greatly appreciated!
    Cheers

    Acrobat/Reader does not support the FTP protocol. You could submit via HTTP to an interneadiary program and have that do the FTP submission on your behalf. Or that pragram could write the data file to the file system (assuming it is on the same physical hardware).
    Paul

  • Forwarding JSP page through requestdispatcher problem in submiting form

    Hello everyone,
    I am very much new to servlet.
    My problem is somewhat this....
    when i am forwarding one JSP page by requestdispather , there is no problem.But after that when i am trying to submit one html form written inside the jsp page , the request is not submiting the jsp page rather it resides in the servlet.
    The code in servlet is
    RequestDispatcher rd =getServletContext().getRequestDispatcher("/applyConfirm.jsp");
    rd.forward(request,response);
    Now in (applyConfirm.jsp )jsp page one button is there , so when i will click that button the page has to be submitted.But its not submitting rather the request resides in the servlet.
    Dose someone will have any idea.
    Thanks in advance

    First check what sort of button you are using. It should be of "submit" type.
    Check the URL to witch URL it is submitting i.e. Action property in <FORM> tag.
    Make sure for the URLs in the client i.e HTML ex: href, action, and so on use the thumb rule of prefixing "<%=request.getContextPath()%>/" in your JSP or in servlet add it in the java code.
    This should solve the relative URL reference problem.
    Hope this helps.
    Cheers.

  • Submitting form data as XML - Can you edit the node structure?

    Hi guys,  I was wondering if there was a way to edit the node structure of an xml file [submitted via a form through email], instead of what livecycle creates by default; or, is it a case that once you select 'submit As: XML Data (XML)' - it's out of your hands?  Thanks in anticipation for any help / suggestions. Cheers Dyr

    Thanks Dallas -- all sorted now with
    your advice . Cheers Dyr

  • Further problem with submitting forms

    I have a fillable pdf form which is submitted to an email address.  This works OK in Acrobat with the email program being opened and an email with attachment created.
    However, in Reader it gives an error message 'cannot launch program' and no email is created/sent.  If I have the email program already opened, this error message doesn't appear but no email is created.
    Any suggestions for a fix?
    Acrobat 8 Pro 8.3.1
    Reader X 10.1.3
    Win 7 Ult 32
    Thanks.

    - this is the problem in your interactive form.. Look at the fields and label in yout form which it has TypeLabel. and try to change it to valid name or something
    -gopal

  • Problem sync Satellite Forms data with Oracle 8i Lite through iConnect Consolidator.

    I receive following exception in the hotsync log:
    java.lang.Exception: Compose raw metadata not implemented for SMSE
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at oracle.lite.sync.palm.SMRL4PRecord.composeRawMetaData(SMRL4PRecord.java:126)
    at oracle.lite.sync.HeliosSession.<init>(Compiled Code)
    at oracle.lite.sync.HotSyncSession.RunTime(Compiled Code)
    OK Oracle with 1 message(s)
    This is when I after installed the satellite forms performes a sync.
    I use PalmV with PalmOS 3.3, performes the sync with HotSync through iConnect Consolidator for Oracle 8i Lite 4.0.0.2.0
    In the Satellite Forms App Designer I have check the Oracle Lite option in the property form.
    This happends for both the sample forms and the one I have created.
    I use the Satellite Form 3.0 beta 2, is there a new release and where can I find it ?
    Anyone with any ideas to solve this ?
    Thanks in advance !
    /Patrik

    Hello Patrik,
    Did you resolved this problem ? I have the same error message. Please, let me know what i can do.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Patrik Strid ():
    I receive following exception in the hotsync log:
    java.lang.Exception: Compose raw metadata not implemented for SMSE
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at oracle.lite.sync.palm.SMRL4PRecord.composeRawMetaData(SMRL4PRecord.java:126)
    at oracle.lite.sync.HeliosSession.<init>(Compiled Code)
    at oracle.lite.sync.HotSyncSession.RunTime(Compiled Code)
    OK Oracle with 1 message(s)
    <HR></BLOCKQUOTE>
    null

  • Problems receiving submitted forms

    I am having problems with some of my users not being able to email a completed pdf form back to me.  I changed the distribution to go through acrobat.com to avoid having the user use their email to submit the form.  However it is still prompting them to use their email to submit the form, is there a way around this?**

    I am having problems with some of my users not being able to email a completed pdf form back to me.  I changed the distribution to go through acrobat.com to avoid having the user use their email to submit the form.  However it is still prompting them to use their email to submit the form, is there a way around this?**

  • Problem with submitting form

    I have this plain HTML region that has a select box, something like :
    <select name="requestType" id="sdfsdf">
    <option value="01AX">Please select an option</option>
    <option id="1D" value="D">Upgrade / Enhancement</option>
    <option id="1E" value="E">BPR</option>
    <option id="1F" value="F">Ad-Hoc Piece of Work</option>
    </select>.
    when I submit the form, I get a 'File Not found' error. But when I make it a 'multiple select', I'm able to submit the form.
    <select multiple name="requestType" id="sdfsdf">
    <option value="01AX">Please select an option</option>
    <option id="1D" value="D">Upgrade / Enhancement</option>
    <option id="1E" value="E">BPR</option>
    <option id="1F" value="F">Ad-Hoc Piece of Work</option>
    </select>.
    any suggestions?

    Thanks for the response Vikas. Unfortunately due to the nature of our form, we need to use Javascript to display options - it is not easy for us to use HTML DB native components in this instance.
    Do you know if there is a workaround, or hidden tags that we can provide for the app server so that this will work?
    Thanks,
    Alex

  • Submitting form data to email

    Hello all,
    I'm really stuck here. And, In an effort to generate some
    sympathy to those who might get annoyed with people like me ;) I am
    just a stay at home mom that wants to do something fun on the side
    while helping my family out... at any rate, I'm self-taught and I
    don't quite understand the whole php, cgi, etc. thing. I've
    researched this topic but similar questions and their respective
    responses are too technical for me.
    So... I've created a simple informational website for someone
    (www.idoweddingsbylynda.com) and promised her a contact us form
    (remembering how easy it was to do in Frontpage, not realizing it
    wouldn't be as easy Dreamweaver) with the input being directed to
    her email.
    The contact us form I created is buried in the site at
    www.idoweddingsbylynda.com/contactus-temp.html. I've tried one
    script that I found online and called it "mail.php" - I have no
    idea how it works or anything, and when I click the submit button
    it just shows me the script as a web page.
    she is using godaddy as her host and it supposedly supports
    this action, although I don't see a cgi folder in there.

    I believe GoDaddy does allow the use of a formmail script.
    Why not email
    them and ask them which script they use and how to go about
    setting it up
    for your site? That would be the first approach you should
    take. You may
    find a script elsewhere, but GoDaddy may not allow the use of
    it.
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    http://www.csstemplates.com.au
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html
    "dflorentine" <[email protected]> wrote in
    message
    news:epl4d4$s2d$[email protected]..
    > Hello all,
    >
    > I'm really stuck here. And, In an effort to generate
    some sympathy to
    > those
    > who might get annoyed with people like me ;) I am just a
    stay at home mom
    > that
    > wants to do something fun on the side while helping my
    family out... at
    > any
    > rate, I'm self-taught and I don't quite understand the
    whole php, cgi,
    > etc.
    > thing. I've researched this topic but similar questions
    and their
    > respective
    > responses are too technical for me.
    >
    > So... I've created a simple informational website for
    someone
    > (www.idoweddingsbylynda.com) and promised her a contact
    us form
    > (remembering
    > how easy it was to do in Frontpage, not realizing it
    wouldn't be as easy
    > Dreamweaver) with the input being directed to her email.
    >
    > The contact us form I created is buried in the site at
    > www.idoweddingsbylynda.com/contactus-temp.html. I've
    tried one script
    > that I
    > found online and called it "mail.php" - I have no idea
    how it works or
    > anything, and when I click the submit button it just
    shows me the script
    > as a
    > web page.
    >
    > she is using godaddy as her host and it supposedly
    supports this action,
    > although I don't see a cgi folder in there.
    >

  • How to save the form data into adobe db?

    Hi All,
    How to save the form data into adobe db?
    I have designed one xdp file.
    Through processFormSubmission(), I got the submitted form data as Document obj.
    Then I have called the workflow kickoff program.
    code:
    InvocationRequest request = myFactory.createInvocationRequest ("myprocessname", //Specify the long-lived process name
    "invoke", //Specify the operation name
    params, //Specify input values (HashMap obj)
    false); //Create an asynchronous request
    It successfulyy started the workflow, but the submitted form data is not saved anywhere.
    And also, How get the form data from tables?
    Please provide the solution for the above.
    Thanks in advance.
    Regards,
    Saravanan G

    You need to create a process variable of type IN if you want to be able to pass data to your process. Then the params parameter (HashMap) contains a list of all the IN variables with their content that you want to pass to your process. They key is the name of the variable and the value the content. That way you should get it in your process.
    Now LiveCycle will create a column in the database for every process variable, so the content will be saved in the database just by creating that process variable.
    Jasmin

  • Elementary Problem With Submitting A PDF Form Via Email?

    Hello all!
    I'm brand new to creating forms with Adobe.  I have Acrobat X Pro.  I have created a form with multiple fields to fill in and placed a button at the top of the form.  Under button properties I selected the submit a form option under the actions tab and chose to email the entire pdf file.  Where it says enter a URL for this link I put mailto: and my email address.
    When I click on the submit button I choose the desktop application option as I use Outlook exchange. (that could be the problem?)  I click on the ok button and immediately get a pop up box that says "Either there is no default mail client or the current mail client cannot fulfill the messaging request.  Please run Microsoft Outlook and set it as the default client.
    I have no idea how to fix this issue or if I'm creating the submit form improperly.  My goal is to get an exact copy of the completed Adobe form emailed to the specified email address.  Any help would be much appreciated!
    Mike

    To answer some of your specific questions:
    2, 3. The submit form button needs to be on the PDF. You can either configure a Submit Form action or use the submitForm JavaScript method.
    4, 6: No to both questions. You can create the form in Acrobat. Such forms are knows as Acroforms, as opposed to XFA forms that are created with LiveCycle Designer. Acroforms have wider support.
    5: Yes, that's the method that's used when submitting to a web server. You have your choice of formats. The "HTML Form" option causes the form data to be submitted in the same format as an HTML form, so the same type of server-side code can be used to process the data. As Dave's tutorial shows, the server should return an FDF as the response, however, as opposed to HTML content.
    It's a mistake to try to embed the PDF in a web page. So much depends on the user's browser, PDF viewer, and how both are configured. PDF forms can be submitted directly from Adobe Reader/Acrobat, so it's not necessary for them to be viewed in a browser. Note that Adobe Reader for iOS/Android don't yet support submitting to a web server (apart from FormsCentral), but that's is supposedly being worked on.
    Since you mentioned digital signatures, be aware that for Reader users to be able to sign, the document has to be Reader-enabled, either with Acrobat Pro or LiveCycle Reader Extensions (which is not the same as LiveCycle Designer). Digital signatures in PDF forms are not yet supported on mobile devices. Also, you will want to submit the entire PDF, as opposed to just the form data, when submitting a digitally signed form.

  • Submitting Form Problems

    Hi everybody.
    I have a problem with my form. Its an user registration form,
    and you have to fill your information (name, email, etc). When i
    add validation to those fields, it works, but I need to add a 2
    <select> the first one have regions from my country, and the
    second one fills up with the cities of the selected region, I used
    spry data to do it, loading the information from XML and it works
    perfectly. Also the validation, if you don't select a region, or a
    city, the error messages that you can show with spry works.
    But when I click the submit button on the form, it wont
    submit, if I remove the validation of the 2 <select>, it
    submits. I don't know what is causing this problem.
    I hope you can help me to solve this issue.
    Thanks in advance.

    Hi,
    Nop, that's is the only message I get in the console
    This is how I create the cells (dinamically)
    private HtmlInputText createCelda(String vValue, String vStyle,
                   String vTitle, String vId, boolean vscript, boolean isreadonly) {
              ccelda = new HtmlInputText();
              ccelda = (HtmlInputText) application
                        .createComponent(HtmlInputText.COMPONENT_TYPE);
              ValueExpression ve = application.getExpressionFactory()
                        .createValueExpression(fc.getELContext(), vValue, String.class);
              ccelda.setValueExpression("value", ve);
              ccelda.setStyleClass(vStyle);
              ccelda.setTitle(vTitle);
              ccelda.setId(vId);
              ccelda.setReadonly(isreadonly);
              if (vscript != false) {
                   ccelda.setOnkeydown(";return checkGrid(event, this.id);");
                   ccelda.setOnchange(";return changeValue(this.id);");
                   ccelda.setOnclick("this.select()");
              return ccelda;
    As I told first, this works great in tomcat 6, but now in tomcat 5.0.28 I get the error, when I try to submit the form.
    Thanks

  • Problem with ENCTYPE='multipart/form-data'

    In my program I want to upload a file along with other details.
    I've dowloaded org.apache.commons.fileupload.* jar files and everything works fine only if I give
    <INPUT TYPE='file' NAME='file1'>
    i.e the file is uploaded
    But if I add any other field it becomes blank
    Title : <INPUT id=text1 maxlength="30" name=GHN1 >
    the value of GHN1 becomes blank. what cud be the problem.
    Here is my program
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.text.SimpleDateFormat.*,java.text.ParseException.*,java.text.*,java.text.DateFormat.*,java.util.*,java.util.Date.*,com.gh.db.*,org.apache.commons.fileupload.*,org.apache.commons.fileupload.servlet.ServletFileUpload,org.apache.commons.fileupload.disk.DiskFileItemFactory,org.apache.commons.io.FilenameUtils,java.io.*,java.io.File,java.lang.Exception" errorPage="Error.jsp" %>
    <%
    String TACm1="";
    String TASid,Nme="",Cm2="",GHN1="",GHN2="",GHN3="",Sid="";
    TACm1=((request.getParameter("TAIdCombo"))!=null?(request.getParameter("TAIdCombo")):"");
    DBconnection TApool = DBconnection.getInstance();
    Connection con2 = TApool.getConnection();
    con2.setAutoCommit(false);
    Statement TAst1 = con2.createStatement();
    ResultSet TArs1 = null,rs2=null,rs1=null;
    Cm2=((request.getParameter("TMIdCombo2"))!=null?(request.getParameter("TMIdCombo2")):"");
    java.util.Date d1;
    java.sql.Date d2;
    SimpleDateFormat format=new SimpleDateFormat("dd/MM/yyyy");
    %>
    <html>
    <head>
    <TITLE>Guest Houses of DOS</TITLE>
    </head>
    <%@ include file="StdValidations.js" %>
    <%@ page buffer="1094kb"%>
    <script Language="JavaScript">
    </script>
    <body onload="window.history.forward(1);">
    <FORM ENCTYPE='multipart/form-data' name="GHInfoDetails1"
         method='POST' action="GHInfoDetails1.jsp">'<br><br><br>
    <center>
    <%      
         String LoginName= "";
         String Name= "";
         String SectionName= "";
         try
              LoginName = session.getAttribute("LoginName").toString();
              Name = session.getAttribute("Name").toString();
              SectionName = session.getAttribute("SectionName").toString();     
         catch(NullPointerException npe)
              %>
              <jsp:forward page="LoginHere.jsp" >
              <jsp:param name="SessionMode" value="Session Expired try again to log on" />
              </jsp:forward>
              <%
    %>
    <%
              GHN1 = request.getParameter("GHN1");
              if (GHN1 == null) GHN1 = "";
              GHN2 = request.getParameter("GHN2");
              if (GHN2 == null) GHN2 = "";
              GHN3 = request.getParameter("GHN3");
              if (GHN3 == null) GHN3 = "";
    %>
         <table width="100%" bgcolor="#F7EDF7">
              <tr >
              <td align="center">
                   <img src="Images/Title2.gif">
              </td>
              </tr>
              </table>
              <table width="100%" bgcolor="#F7EDF7">
              <tr>
              <td >
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="+1">Logged in as:  <%= Name %></font></b>
              </td>
              <td >
                   <b><font face="Comic Sans MS" color="#402180" size="+1">Other Details of Guest House</font></b>
              </td>
              <td align="right">
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="+1">Logout</font></b>
              </td>
              </tr>
         </table>
              <table width="100%" bgcolor="#B6C7E5" border="1">
              <tr>
              <td valign="top">
              </br>
              <p><img src="Images/bullet.gif"><b><font face="Times New Roman, Times, serif" color="#402180" size="+0">Defining Guest House Information</font></b></p>
              <p><img src="Images/bullet.gif"><b><font face="Times New Roman, Times, serif" color="#402180" size="+0">Cancelling Guest House Information</font></b></p>
              </td>
              <td align="left"></br>
                   <table width="100%" bgcolor="#B6C7E5">
                   <tr>
                                  <td width="60%" align="right"></br>
                                  <P >Category :  <select onChange="TAMAssignCombo2();" name="TMIdCombo2" style="WIDTH: 120px" >
                                                                <option value="-">Select</option>
                                                                <% try
                                                                     PreparedStatement ps6=con2.prepareStatement("Select CategoryName from TableCategory order by CategoryName");
                                                                     rs2 = ps6.executeQuery();     
                                                                     while(rs2.next())
                                                                          Sid=rs2.getString(1);
                                                                               %>
                                                                                    <option value = "<% out.write(Sid); %>"><% out.write(Sid); %></option>
                                                                               <%
                                                                catch(Exception e)
                                                                     e.printStackTrace();
                                                                %>
                                                                     <Script>alert("Exception Occured : <%= e %>");</Script>
                                                                <%
                                                                %>
                                                 </select>
                                  </P>
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Title :     <INPUT id=text1 maxlength="30" name=GHN1 onKeyPress="if (((event.keyCode > 32) && (event.keyCode < 48)) || ((event.keyCode > 57) && (event.keyCode < 65)) || ((event.keyCode > 90) && (event.keyCode < 97))) event.returnValue=false;">
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Reference No :     <INPUT id=text1 maxlength="100" name=GHN2 onKeyPress="if (((event.keyCode > 32) && (event.keyCode < 48)) || ((event.keyCode > 57) && (event.keyCode < 65)) || ((event.keyCode > 90) && (event.keyCode < 97))) event.returnValue=false;">
                   </td>
                   </tr>
                   <tr align="center">
                   <td>
                        Date :     <INPUT id=text1 maxlength="30" name=GHN3 >
                   </td>
                   </tr>
                   <tr align="center">
                   <td >
                   </br>
                                           File Name:        <INPUT TYPE='file' NAME='file1'></p>
                   </td></tr>
                   <tr>
                   <td align="center">
                                                         <INPUT TYPE='submit' VALUE='Submit' ></br>
                   <b><font face="Times New Roman, Times, serif" color="#402180" size="3">(Information like distance,direction from central places such as Railway station, Airport, Bus Terminal....etc can be added in a file of windows format(such as word, pdf...) and can be uploaded through this screen. This will be displayed for the ISRO Guests.</font></b>)
                   </td>
                   </tr>
                   </table>
              </td>
              </tr>
              </table>
              <table width="100%" bgcolor="#B6C7E5">
              <tr>
              <td align="center">
                   </br>
                   <img src="Images/Home.jpg">
              </td>
              </tr>
              </table>     
    <% if (ServletFileUpload.isMultipartContent(request))
         GHN1 = request.getParameter("GHN1");
         if (GHN1 == null) GHN1 = "";
         GHN2 = request.getParameter("GHN2");
         if (GHN2 == null) GHN2 = "";
         GHN3 = request.getParameter("GHN3");
         if (GHN3 == null) GHN3 = "";
         DiskFileUpload fileUpload = new DiskFileUpload();
         List list = null;
         try
              list = fileUpload.parseRequest(request);
         catch(FileUploadException ex)
              throw new ServletException("Wrapped",ex);
         Iterator iter = list.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
         if (!item.isFormField())
              File itemFile = new File(item.getName());
              Nme=itemFile.getName();
              %>
              <%
              File destDir = new File(getServletContext().getRealPath("/")
                                       +"stored");
         if(!destDir.exists())
              destDir.mkdirs();
         File destFile = new File(getServletContext().getRealPath("/")
                                       +"stored"+File.separator+itemFile.getName());
         try
              item.write(destFile);
         catch(Exception ex)
              //throw new ServletException("Wrapped",ex);
         TACm1=SectionName;
         %><script>alert("<%=GHN1%>");</script><%
         try
              PreparedStatement ps26=     con2.prepareStatement("select CategoryNo from TableCategory where CategoryName=?");
              ps26.setString(1,Cm2);
              rs1=ps26.executeQuery();
              while (rs1.next())
                   PreparedStatement ps16=con2.prepareStatement("inset into TableMetaData (CategoryNo,Title,RefernceNo,Date,FileName) values(?,?,?,?,?)");
                   ps16.setString(1,rs1.getString(1));
                   ps16.setString(2,GHN1);
                   ps16.setString(3,GHN2);
                   d1=format.parse(GHN3);
                   d2=new java.sql.Date(d1.getTime());     
                   ps16.setDate(4,d2);
                   ps16.setString(5,Nme);
                   int NoOfRows=ps16.executeUpdate();
                   con2.commit();
         catch(Exception e)
              e.printStackTrace();
         %>
                             <script> alert("Error : <%= e %>"); </script>
         <%
    %>
    <%
              if (TAst1 != null) TAst1.close();
                                  if (con2 != null)
                                       con2.rollback();
                                       con2.setAutoCommit(true);
                                       TApool.returnConnection(con2);
              %>
    <input name="HomePage" type="hidden">
    </form>
    </body>
    </html>

    This article is worth reading: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • Problem with transfering unicode form data in MULTIPART/FORM-DATA

    HI experts,
    I have this web based multilingual application. Page 1(form6.jsp) is basic registeration form with 5 fields and one image upload to the server. Page 2(verify.jsp) is another jsp page for verification of UTF data entered in page 1.
    page 2 (verify.jsp) also uses a bean called (verify.java) for picking up values. page 3(insertEntry.jsp) is the page for inserting that data into the Database and uses a bean called (logicbean.java).
    Now, the problem im facing here is that if i use multipart/form-data, the unicode text filled in page1 is shown as garbage when its is transfered to page2 and displayed on page2. It is all gibberish. But if i do not use multipart/form-data, the unicode text transfered from page1 to page2 is displayed perfectly on page2.Im using devenagari(UTF) language for filling in details.
    // form6.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <HTML>
    <HEAD>
    <TITLE>
    <%=session.getValue("main.title")%>
    </TITLE>
    </HEAD>
    <h1><center><%=session.getValue("main.head")%><Center>
    <BODY background="brown.bmp">
    <form name=form6 action="verify.jsp" method="post" enctype="multipart/form-data">
    <center>
    <font>
    <table border=1>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.ecname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votername"></td>
    <td></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.ecsurname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votersurname"></td>
    <td></td>
    </tr>
    <tr>
    <td align="left"><b>2.)<%=session.getValue("main.rel")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="relation" onchange="if(this.selectedIndex!=0){this.form.texthiddenrelation.value=this.options[this.selectedIndex].value}" size="1">
                                       <option>Choose</option>
    <option value="father">Father</option>
    <option value="mother">Mother</option>
    <option value="husband">Husband</option>
    </select>
    <input type="hidden" name="texthiddenrelation" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="parentname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relsurname")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="parentsurname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b>3.)<%=session.getValue("main.sex")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="sex" onchange="if(this.selectedIndex!=0){this.form.texthiddensex.value=this.options[this.selectedIndex].value}" size="1">
                                            <option>Choose</option>
                                            <option value="male">Male</option>
    <option value="female">Female</option>
    <option value="other">Other</option>
    </select>
    <input type="hidden" name="texthiddensex" /> </td>
    <td align="right"><b><%=session.getValue("form6.image")%><input type ="file" name=pic1 onchange={this.form.pic.value=this.form.pic1.value}><input type= hidden name=pic> </b></td>
    </tr>
    <tr>
    <td colspan=2><b>4.)<%=session.getValue("main.age")%></b><input type="text" name="age">
    </td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b>
    <td><b><%=session.getValue("main.dobday")%></b> <select name="cmbday">
    <option value="1"> 1 </option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">10</option>
    <option value="10">11</option>
    <option value="11">12</option>
    <option value="12">13</option>
    <option value="13">14</option>
    <option value="14">15</option>
    <option value="15">16</option>
    <option value="16">17</option>
    <option value="17">18</option>
    <option value="18">19</option>
    <option value="19">20</option>
    <option value="20">21</option>
    <option value="21">22</option>
    <option value="22">23</option>
    <option value="23">24</option>
    <option value="24">25</option>
    <option value="25">26</option>
    <option value="26">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <b><%=session.getValue("main.dobmonth")%></b><select name="cmbmonth">
    <option value="jan">JAN</option>
    <option value="feb">FEB</option>
    <option value="mar">MAR</option>
    <option value="apr">APR</option>
    <option value="may">MAY</option>
    <option value="jun">JUN</option>
    <option value="jul">JUL</option>
    <option value="aug">AUG</option>
    <option value="sep">SEPT</option>
    <option value="oct">OCT</option>
    <option value="nov">NOV</option>
    <option value="dec">DEC</option>
    </select>
    <b><%=session.getValue("main.dobyear")%></b> <select name="cmbyear" onchange="if(this.form.cmbday.selectedIndex!=0 && this.form.cmbmonth.selectedIndex!=0 && this.form.cmbyear.selectedIndex!=0){this.form.mergedage.value=this.form.cmbday.options[this.form.cmbday.selectedIndex].value +' '+this.form.cmbmonth.options[this.form.cmbmonth.selectedIndex].text +' '+ this.form.cmbyear.options[this.form.cmbmonth.selectedIndex].value}" size="1">
    <option value="1970">1970</option>
    <option value="1971">1971</option>
    <option value="1972">1972</option>
    <option value="1973">1973</option>
    <option value="1974">1974</option>
    <option value="1975">1975</option>
    <option value="1976">1976</option>
    <option value="1977">1977</option>
    <option value="1978">1978</option>
    <option value="1979">1979</option>
    <option value="1980">1980</option>
    <option value="1981">1981</option>
    <option value="1982">1982</option>
    <option value="1983">1983</option>
    <option value="1984">1984</option>
    <option value="1985">1985</option>
    <option value="1986">1986</option>
    <option value="1987">1987</option>
    <option value="1988">1988</option>
    <option value="1989">1989</option>
    <option value="1990">1990</option>
    <option>
    </select>
    <input type="hidden" name="mergedage">
    </tr>
    <tr>
    <td colspan=2><b>6.)<%=session.getValue("main.add")%></b>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline1")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address1" value=""></td>
    <td><b><%=session.getValue("main.addstate")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="state"></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline2")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address2" onChange="this.form.finaladdress.value=this.form.address1.value + ';' + this.value;"> <input type="hidden" name="finaladdress"> </td>
    <td><b><%=session.getValue("main.addcity")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="city"></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.addpin")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="pincode">
    <td></td>
    </tr>
    <tr>
    <td ><b>7.)<%=session.getValue("main.const")%></b> <input type="text" name="constituency">
    <td ><b>8.)<%=session.getValue("main.id")%></b> &nbsp&nbsp<input type="text" name="refno">
    </tr>
    <tr>
    <td colspan="2"><center><input type="reset" name="reset" value="<%=session.getValue("button.reset")%>">&nbsp&nbsp<input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center></td>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </form>
    </font>
    </BODY>
    </HTML>
    // verify.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <jsp:useBean id="verify" class="pack.verify" scope="request"/>
    <%@ page import="com.oreilly.servlet.*" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%!
    MultipartRequest mp;
    // ParameterParser pp;
    %>
    <!-- Perform the actions on the bean. -->
    <%
    //pp.setCharacterEncoding("utf-8");
    %>
    <%
    try
    mp = new MultipartRequest(request, "d:/Files");
    out.println("DONE");
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    verify.setRequest(mp);
    /* Insert the employee data into the database.*/
    verify.verifyEntry();
    //verify.setscope();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQuery();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <LINK href="theme/Master.css" rel="stylesheet" type="text/css">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <form name=form6 action="insertEntry.jsp" method="POST">
    <center>
    <table border=3>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td rowspan=3>
    <image src="<%=verify.getpic()%>" width="85" hieght="85">
    </td>
    </tr>
    <tr>
    <td > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecname")%></b> <%=verify.getvotername()%>&nbsp&nbsp<input type="hidden" value= "<%=verify.getvotername()%>" name="votername"></td>
    </tr>
    <tr >
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecsurname")%></b><%=verify.getvotersurname()%>
    <input type="hidden" value= "<%=verify.getvotersurname()%>" name="votersurname"></td>
    </tr>
    <tr>
    <td ><b>2.)<%=session.getValue("main.rel")%></b><input type="hidden" value= "<%=verify.getvoterrelation()%>" name="texthiddenrelation"></td>
    <td><%=verify.getvoterrelation()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp <input type="hidden" value= "<%=verify.getparentname()%>" name="parentname"></td>
    <td><%=verify.getparentname()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relsurname")%></b><input type="hidden" value= "<%=verify.getparentsurname()%>" name="parentsurname"></td>
    <td><%=verify.getparentsurname()%></td>
    </tr>
    <tr>
    <td><b>3.)<%=session.getValue("main.sex")%></b><input type="hidden" value= "<%=verify.getsex()%>" name="texthiddensex"></td>
    <td><%=verify.getsex()%></td>
    </tr>
    <tr>
    <td ><b>4.)<%=session.getValue("main.age")%></B><input type="hidden" value= "<%=verify.getage()%>" name="age"></td>
    <td><%=verify.getage()%></td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b> <input type="hidden" value= "<%=verify.getdob()%>" name="mergedage"></td>
    <td> <%=verify.getdob()%></td>
    </tr>
    <tr>
    <td colspan=2><b>
    6.)<b><%=session.getValue("main.add")%></b></td>
    </tr>
    <tr>
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("verify.add")%></b><input type="hidden" value= "<%=verify.getadderess()%>" name="finaladdress"> </td>
    <td><%=verify.getadderess()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addpin")%></b><input type="hidden" value= "<%=verify.getpin()%>" name="pincode"></td>
    <td><%=verify.getpin()%></td>
    </tr>
    <tr>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addstate")%></b><input type="hidden" value= "<%=verify.getstate()%>" name="state"></td>
    <td><%=verify.getstate()%></td>
    </tr>
    <tr>
    <td><b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<%=session.getValue("main.addcity")%></b><input type="hidden" value= "<%=verify.getcity()%>" name="city"></td>
    <td><%=verify.getcity()%></td>
    </tr>
    <tr>
    <td><b>7.)<%=session.getValue("main.const")%></b> <input type="hidden" value= "<%=verify.getconst()%>" name="constituency"></td>
    <td><%=verify.getconst()%></td>
    </tr>
    <tr>
    <td><b>8.)<%=session.getValue("main.id")%></b> <input type="hidden" value= "<%=verify.getrefno()%>" name="refno"></td>
    <td><%=verify.getrefno()%></td>
    </tr>
    <tr>
    <td colspan="2"><center><INPUT TYPE="button" VALUE="<%=session.getValue("ie.back")%>" onClick="history.go(-1)">
    <input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center><input type="hidden" value= "<%=verify.getpic()%>" name="pic"></td>
    </tr>
    </form>
    </BODY>
    </HTML>
    //verify.java
    package pack;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.oreilly.servlet.*;
    import com.oreilly.servlet.ParameterParser.*;
    * @author Administrator
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class verify {
    String votername = "";
    String votersurname = "";
    String texthiddenrelation="";
    String parentname = "";
    String parentsurname = "";
    String gender = "";
    String texthiddensex="";
    String age = "";
    String dob = "";
    String mergedage="";
    String address = "";
    String finaladdress="";
    String pincode = "";
    String state = "";
    String city = "";
    String constituency = "";
    String refno = "";
    MultipartRequest request = null;
    Connection dbConn = null;
    ParameterParser pp;
    private String voternameParam;
    * Set the request object. This is used for getting parameters.
    public void setRequest(MultipartRequest request)
    this.request = request;
    public void verifyEntry()
    throws Exception
    /* Connect to the database.*/
    //pp.setCharacterEncoding("utf-8");
    //String nameParam = request.getParameter("name");
    MultipartRequest mp;
    System.out.println("connected to db2 through insertemployee");
    /* Get all the parameters from the calling HTML form.*/
    String voternameParam = request.getParameter("votername");
    System.out.println("the votername is " + request.getParameter("votername"));
    System.out.println(voternameParam);
    String votersurnameParam = request.getParameter("votersurname");
    System.out.println("the votersurname is " + request.getParameter("votersurname"));
    String hiddenrelationParam = request.getParameter("texthiddenrelation");
    System.out.println("the relation is " + request.getParameter("texthiddenrelation"));
    String parentnameParam = request.getParameter("parentname");
    System.out.println("the parentname is " + request.getParameter("parentname"));
    String parentsurnameParam = request.getParameter("parentsurname");
    System.out.println("the parentsurname is " + request.getParameter("parentsurname"));
    String ageParam = request.getParameter("age");
    System.out.println("the age is " + request.getParameter("age"));
    String mergedageParam = request.getParameter("mergedage");
    System.out.println("the mergedage is " + request.getParameter("mergedage"));
    String hiddensexParam = request.getParameter("texthiddensex");
    System.out.println("the hiddensex is " + request.getParameter("texthiddensex"));
    //String dobParam = request.getParameter("dob");
    //System.out.println("the dob is " + request.getParameter("dob"));
    String finaladdressParam = request.getParameter("finaladdress");
    System.out.println("the finaladdress is " + request.getParameter("finaladdress"));
    String pincodeParam = request.getParameter("pincode");
    System.out.println("the pincode is " + request.getParameter("pincode"));
    String stateParam = request.getParameter("state");
    System.out.println("the state is " + request.getParameter("state"));
    String cityParam = request.getParameter("city");
    System.out.println("the city is " + request.getParameter("city"));
    String constituencyParam = request.getParameter("constituency");
    System.out.println("the constituency is " + request.getParameter("constituency"));
    String refnoParam = request.getParameter("refno");
    System.out.println("the refno is " + request.getParameter("refno"));
    System.out.println("encoding = " + System.getProperty("file.encoding"));
    public String getvotername()
    return request.getParameter("votername");
    public String getvotersurname()
    return request.getParameter("votersurname");
    public String getvoterrelation()
    return request.getParameter("texthiddenrelation");
    public String getparentname()
    return request.getParameter("parentname");
    public String getparentsurname()
    return request.getParameter("parentsurname");
    public String getage()
    return request.getParameter("age");
    public String getsex()
    return request.getParameter("texthiddensex");
    public String getadderess()
    return request.getParameter("finaladdress");
    public String getpin()
    return request.getParameter("pincode");
    public String getstate()
    return request.getParameter("state");
    public String getcity()
    return request.getParameter("city");
    public String getconst()
    return request.getParameter("constituency");
    public String getrefno()
    return request.getParameter("refno");
    public String getdob()
    return request.getParameter("mergedage");
    public String getpic()
    //String a=request.getParameter("pic");
    //a=a.substring(a.lastIndexOf("/")+1);
    //System.out.print("Java path is "+a);     
    //Enumeration enum=request.getFileNames();
    //while(enum.hasMoreElements())
    //     String abc=(String)enum.nextElement();
    //     System.out.print("Java the path is "+abc);     
    return request.getParameter("pic");
    String votername1;
    //public void setScope()
    //request.setAttribute("votername1" ,voternameParam );
    //insertEntry.jsp
    <jsp:useBean id="logicbean" class="pack.logicbean" scope="request"/>
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <!-- Perform the actions on the bean. -->
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <%
    try
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    logicbean.setRequest(request);
    //MultiPartRequest mp=MultiPartRequest(request,"E:\Files");
    /* Insert the employee data into the database.*/
    logicbean.insertEntry();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQueryInsert();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <TITLE>
    Insert Record
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <center><H2><%=session.getValue("ie.label")%>
    </H2>
    <font face = "Devanagari MT for IBM" size = +2>
    <b><%=session.getValue("ie.sd")%>|<%=session.getValue("ie.home")%></b>
    </font>
    </center>
    </BODY>
    </HTML>
    I have narrowed down the problem to the point where i understand that the "request.getParameter()" function for multipart is not able to understand or read UTF data properly. The out.println prints garbage from this function on the console. im using WAS
    plz help
    thanx in advance
    caffaine

    hi,
    To solve your problem Servlet Filters
    FILTER PROGRAM
    ===============
    package filters;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.UnavailableException;
    public class SetCharacterEncodingFilter implements Filter {
    // ----------------------------------------------------- Instance Variables
    * The default character encoding to set for requests that pass through
    * this filter.
    protected String encoding = null;
    * The filter configuration object we are associated with. If this value
    * is null, this filter instance is not currently configured.
    protected FilterConfig filterConfig = null;
    * Should a character encoding specified by the client be ignored?
    protected boolean ignore = true;
    // --------------------------------------------------------- Public Methods
    * Take this filter out of service.
    public void destroy() {
    this.encoding = null;
    this.filterConfig = null;
    * Select and set (if specified) the character encoding to be used to
    * interpret request parameters for this request.
    * @param request The servlet request we are processing
    * @param result The servlet response we are creating
    * @param chain The filter chain we are processing
    * @exception IOException if an input/output error occurs
    * @exception ServletException if a servlet error occurs
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain)
         throws IOException, ServletException {
    // Conditionally select and set the character encoding to be used
    if (ignore || (request.getCharacterEncoding() == null)) {
    String encoding = selectEncoding(request);
    if (encoding != null)
    request.setCharacterEncoding(encoding);
         // Pass control on to the next filter
    chain.doFilter(request, response);
    * Place this filter into service.
    * @param filterConfig The filter configuration object
    public void init(FilterConfig filterConfig) throws ServletException {
         this.filterConfig = filterConfig;
    this.encoding = filterConfig.getInitParameter("encoding");
    String value = filterConfig.getInitParameter("ignore");
    if (value == null)
    this.ignore = true;
    else if (value.equalsIgnoreCase("true"))
    this.ignore = true;
    else if (value.equalsIgnoreCase("yes"))
    this.ignore = true;
    else
    this.ignore = false;
    // ------------------------------------------------------ Protected Methods
    * Select an appropriate character encoding to be used, based on the
    * characteristics of the current request and/or filter initialization
    * parameters. If no character encoding should be set, return
    * <code>null</code>.
    * <p>
    * The default implementation unconditionally returns the value configured
    * by the <strong>encoding</strong> initialization parameter for this
    * filter.
    * @param request The servlet request we are processing
    protected String selectEncoding(ServletRequest request) {
    return (this.encoding);
    web-xml entry
    +++++++++++
    <filter>     
         <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
              <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

Maybe you are looking for