Using BufferedReader with a web form

I am importing a fixed length txt file into our database from the web.
My process code looks like:
java.io.BufferedReader r=request.getReader();
java.io.BufferedReader br=new java.io.BufferedReader(r);
String currentRow = "";
StringBuffer fileBody=new StringBuffer(1000);
     while((currentRow=br.readLine().trim())!=null) {
          out.print(currentRow + "<BR>");
          br.close();
It works okay, but I also get all field names and extra info from the form that looks like this:
-----------------------------11955629961970272440171062340
Content-Disposition: form-data; name="file_body"; filename="opudiskMiniEMC.txt"
Content-Type: text/plain
How can I get just the content of the text file?
Thanks,
Evan

sounds like you are doing multipart POST ... you should get UploadBean or Jakarta Commons File Uploader which will process those out for you...
However, every field will start with a separator. The separator is defined at the top of the stream. After the separator is a newline and some header info and a blank line. After the blank line to the next separator is the data for that field. Such is the format of multipart/form-data.

Similar Messages

  • Using Xerces with Java Web Start

    I read that there might be problems using xerces with Java Web Start, because JWS uses Sun's implementation of JAXP internally. My application needs Xerces and I think I am able to get it working using the following settings in the JNLP file:
    <resources>
    <j2se version="1.3"/>
    <jar href="xerces-1.4.3.jar"/>
    <property name="javax.xml.parsers.DocumentBuilderFactory" value="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    </resources>

    Hi,
    I have packaged the xerces jar into my code jar and it does work. HTH
    Aniruddha

  • Licence Error while Using nqcmd with Analytics Web DSN

    Hi,
    While running nqcmd with Analytics Web DSN i am getting a DataDirect error, stating that you do not have appropriate licence to run ODBC Data Direct.
    I am getting this on Linux box but while running the same on Windows their is no such error.
    Have any one of you got such kind of stuff. I am using OBIEE which Oracle provides on her website for free for development purpose.
    Please help.
    Edited by: RKK on Oct 3, 2011 10:01 PM

    Hi,
    kindly Refer
    https://forums.oracle.com/forums/thread.jspa?messageID=2289534&#2289534
    Thanks
    Deva

  • How to write a application using WDJ with the adobe form ?

    Hi, experts,
    I don't know how to write a application using !!webdynpro for java!! with the adobe form so that I can fill data to the adobe form and get data from the adobe form.
    Note: I have configed the ADS(adobe document services),and I can create a application with a interactiveform in webdynpro for abap and run it successfully, so that I can  fill data to the adobe form and get data from the adobe form.
    Do you give me some hint?
    Thanks a lot.
    Best regards,
    tao
    Edited by: wang tao on Sep 9, 2008 8:59 AM

    Hi,
    Refers the following links.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93e1a9
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c9a954-aa20-2a10-64bb-ea0835204e03
    Thanks
    Abhilasha.

  • Using Substitution Variable in Web forms

    Hi,
    I'm trying to use substitution variable in a planning web form &CurYr in the Column, after creating the form when I save it and try to open the form it says the substitution variable required for this calculation is undefined .Variable : &CurYr.It should be defined as I'm able to see it and select it for the column/row. Any kind of help is appreciated.
    Thanks
    Vinil

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Issue with New Web Form Created for Web Page Composer

    Hello,
    I created new Web Form as per the example given on sdn: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7
    Everything looks fine with all the setup but when I restarted the Portal, I am not seeing this new webform where we see Article, List, Banner and other webform to create new document in Web Page Composer section.
    Any idea what could be the reason behind this would be really helpful?
    regards,
    Jaish

    Hi Jaish,
    Can you please confirm if you have followed all the steps in here.
    The following configuration steps are necessary:
    1.Create a KM Resource Type
    2.Create a Web Resource Type and assign the KM Resource Type to it
    3.Extending the Configuration of Existing Web Resource Types and Containers
    4.Referencing the XSL File in the Stylesheet Object
    5.Creating a Stylesheet Group
    6.Referencing the XML File in the Document Type
    7.Restart the portal
    Make sure that you store the files in the following KM folders:
    The XML file in the /etc/wpceditor/types directory, the XSL files in the /etc/wpceditor/styles directory.
    Please refer to this link.
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/599b78b0aa3bdde10000000a1553f7/frameset.htm
    Hope this helps.
    Cheers,
    Sandeep Tudumu

  • Can I use CSS with PS Web Gallery Preset?

    Using DW CS4. I wanted to create a web gallery with captions under the thumbnail images. I could not get captions to show up using the workspace output tool in Bridge, so I used the web gallery plug-in and preset in Photoshop. The doc title and description from the metadata shows up with each thumbnail and large photo, which is what I wanted. I added an Iframe to make the gallery show up in my web page layout with all the links I wanted, and I re-wrote part of the preset html to eliminate some of the extra preset gallery text at the top of the gallery pages. I am using a transitional doc type.
    It all worked out just fine and the pages are working as planned.
    However, when I used DW to validate the gallery pages, the report showed errors because the font attributes for the gallery pages are controlled by html and not by CSS. There are two problems cited in the report:
    The tag "center" is not allowed within: <p>
    In HTML 4.0, FONT is deprecated... consider using style sheets instead.
    Questions: On the gallery pages generated by the PS plug-in and pre-set, is there a way to control font attributes with a style sheet instead of using the pre-existing html styling? Do I need to be concerned about the attributes being deprecated?
    If you need to look at the web gallery, you can see it at http://www.LoonSongGardens.com/webgallery/galleryab.html
    If you look, you can see why I am daylilybud!

    I used an iframe (as opposed to a frame) as suggested in an article by David Powers about embedding a gallery into a web page. He says the iframe is acceptable in html, and no problem with the iframe itself was indicated during validation, just the FONT attributes from the PS preset I used. You can read the article here: http://foundationphp.com/tutorials/gallery/embed1.php
    In my current gallery, thumbnail captions appear from the metadata for each photograph. For each large image, both the title and the description come from the photo's metadata.  This works well for my purpose, and I want to avoid re-entering each title and description. I guess my question could be better stated by asking if CSS can be added to the preset to apply to captions coming from the metadata of each photo.
    Regarding the lightbox approach you suggest, I looked at the example and do not see captions under the thumbnails. Can captions be added to the thumbnail images? (It is essential that my thumbnails have captions.)
    Customers need to see the name of each plant when they browse thumbnails in order to select items (daylily plants) of interest.
    Because I am dealing with hundreds of photos and will need to update frequently, I am looking for a solution that is efficient and fairly easy to maintain. So far, the PS web gallery preset meets my needs better than anything else I have found, but I thought I'd try to find out if I should and can fix the FONT attribute validation problem.

  • Using PHP with Flash (contact form)

    I am trying to get a contact form on a flash site to work and
    for some reason the PHP isn't forwarding the message to my email.
    Below is the flash code I have used as well as the document I have
    saved as contact.php. Thank you so much for the help. This is the
    last thing I need to complete for the site and I just can't seem to
    get it right. Thanks.
    Flash Code For the Submit Button:
    onClipEvent (enterFrame) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (this._currentframe<this._totalframes) {
    this.nextFrame();
    } else {
    if (this._currentframe>1) {
    this.prevFrame();
    on (release) {
    this._parent.getURL ("contact.php","_blank","GET");
    this._parent.name = "Your Name:";
    this._parent.email = "Your Email:";
    this._parent.phone = "Your Phone Number:";
    this._parent.text4 = "e-mail:";
    this._parent.message = "Your Message:";
    Here is what I have for Contact.php:
    <?php
    $your_name = $_GET['name'];
    $your_email = $_GET['email'];
    $your_phone = $_GET['phone'];
    $your_message = $_GET['message'];
    $recipient_email = "[email protected]";
    $subject = "from " . $your_email;
    $headers = "From: " . $your_name . "<" . $your_email .
    ">\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1';
    $content = "<html><head><title>Contact
    letter</title></head><body><br>";
    $content .= "Name: <b>" . $your_name .
    "</b><br>";
    $content .= "E-mail: <b>" . $your_email .
    "</b><br><hr><br>";
    $content .= "Phone: <b>" . $your_phone .
    "</b><br>";
    $content .= $your_message;
    $content .= "<br></body></html>";
    mail($recipient,$subject,$content,$headers);
    ?>
    <html>
    <body bgcolor="#282E2C">
    <div align="center"
    style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">
    Your message was sent. Thank you.
    </div>
    </body>
    </html>
    <script>resizeTo(300, 300)</script>

    well...that's true..I wanted "name" to be cleared when
    clicked...this version I found doesn't clear "name" when clicked,
    but it needs selected and erased manually...anyway..it's better
    then nothing...
    Reason I want this is because I'm using a design that is not
    giving me much space and I have to trick the low space with this
    option.
    If you want I can send you the fla to get a better
    picture...I believe you deserve it :)

  • Using credentials with a web service -- what our my options?

    Hi All,
    I'm trying to determine what options I have in regards to
    setting credential requirements on my web services. The two options
    seem to be:
    -Basic authentication
    -SOAP header authentication.
    I see that the WebService class has a "setCredentials"
    method, but I haven't had much success with it. Here's the
    documentation reference:
    http://livedocs.adobe.com/labs/flex/3/langref/mx/rpc/AbstractService.html#setCredentials()
    It says: "Set the credentials for the destination accessed by
    the service ... Note that services that use a proxy or a
    third-party adapter to a remote endpoint will need to
    setRemoteCredentials instead."
    Great, I'm not using a proxy, so I figured it would work. I
    thought I would try it with SOAP header auth. I setup a simple
    ASP.NET web service that users SOAP header auth, and decided to
    test it out. Attached is my complete MXML (I also tried using SSL).
    The Flash player threw the following error:
    [MessagingError message='Authentication not supported on
    DirectHTTPChannel (no proxy).']
    at mx.messaging.channels::DirectHTTPChannel/setCredentials()
    at mx.messaging::ChannelSet/setCredentials()
    at mx.messaging::MessageAgent/setCredentials()
    at mx.rpc::AbstractService/setCredentials()
    at SoapHeaderAuthenticatedServicesTest/handleLoad()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc::AbstractService/dispatchEvent()
    at mx.rpc.soap::WebService/
    http://www.adobe.com/2006/flex/mx/internal::wsdlHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc.wsdl::WSDLLoader/private::checkLoadsOutstanding()
    at
    mx.rpc.wsdl::WSDLLoader/mx.rpc.wsdl:WSDLLoader::resultHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
    at mx.rpc::AbstractInvoker/
    http://www.adobe.com/2006/flex/mx/internal::resultHandler()
    at mx.rpc::Responder/result()
    at mx.rpc::AsyncRequest/acknowledge()
    at private::DirectHTTPMessageResponder/completeHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    at [io]
    Interesting -- "Authentication not supported on
    DirectHTTPChannel (no proxy)" -- but the docs made it sound like
    that's precisely when you were to use setCredentials. If using a
    proxy, you would use setRemoteCredentials.
    So... what's up? How do I use setCredentials? And is it for
    use with SOAP header authentication, Basic authentication, or
    something else?

    quote:
    Originally posted by:
    pete
    ...Other times you see operations requiring credentials in
    SOAP headers...
    Pete
    This is what I'm currently pursuing. I did not have much
    success with Basic authentication (didn't work at all in IE, and,
    as you mentioned, even in browsers where it worked, if the
    username/password is wrong, the Flex UI can't intercept the login
    failure, and the user gets that ugly login popup).
    But, I'm not having much success. Here's what the SOAP
    request *should* look like, for my test web service that uses SOAP
    headers for authentication. I used a Visual Studio generated proxy
    class to make this call, and it returned the expected data from the
    web service (i.e., the SOAP authentication worked).
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema">
    <soap:Header>
    <AuthHeader xmlns="
    http://intranet/WebServices/">
    <UserName>TestUser</UserName>
    <Password>TestPassword</Password>
    </AuthHeader>
    </soap:Header>
    <soap:Body>
    <HelloWorld xmlns="
    http://intranet/WebServices/"
    />
    </soap:Body>
    </soap:Envelope>
    Now, I want to set this up in Flex as well. Here's what I
    tried:
    // Called when the WSDL is finished loading
    public function handleLoad(event:Event):void{
    var qName : QName = new QName( "
    http://intranet/WebServices/",
    "AuthHeader" );
    var authXml : XML = <AuthHeader>
    <UserName>TestUser</UserName>
    <Password>TestPassword</Password>
    </AuthHeader>;
    var auth : SOAPHeader = new SOAPHeader( qName, authXml );
    service.addHeader(auth);
    service.HelloWorld();
    No errors are thrown by Flex, however, the SOAP
    authentication fails (I get the expected "access denied" response
    from the web service). I used Wireshark to see what traffic was
    being sent back and forth, and this is what I see for the request
    from Flex:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:s="
    http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header></SOAP-ENV:Header>
    <SOAP-ENV:Body>
    <tns:HelloWorld xmlns:tns="
    http://intranet/WebServices/"/>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Emphasis mine. Note that the SOAP header is empty -- what's
    going on?

  • Can i use global variable in web forms

    guys can any one tell me if i can use global variables when i am
    deplying the forms on the web,.....
    thank you
    vas
    null

    Global variables work in their perfection even when you deploy
    your forms on the WEB.
    null

  • Using JCE with java web start

    We are trying to use bouncy castle provider in an app that is distributed using Java Web Start. We sign the jars for use with jws so that they have unrestricted access. The problem is that bouncy castle provider jar is already signed, and jws does not like a jar signed by multiple signers so we can't re-sign it using our key. If we strip off the provider's signature information from the jars and sign it using our key, the JCE throws an exception as if it could not locate the RSA provider.
    Has anyone faced this problem? Any workarounds that you're aware of?
    Thanks!

    Well, I found this was already asked on the forum. Sorry for not checking that before posting. In case someone is interested, following are some links:
    http://forum.java.sun.com/thread.jsp?forum=38&thread=291494
    http://forum.java.sun.com/thread.jsp?forum=38&thread=237963
    http://forum.java.sun.com/thread.jsp?forum=38&thread=71559

  • Using Safari with Outlook web access

    I use MS Outlook Web Access to access my work email (OWA). When I first bought the iPhone and tried to access OWA, Safari would "hang" and never connect.
    My IT department found the solution. They implemented OWA with SSL. Once they activiated that feature on the Exchange server, it worked fine.
    You will access your OWA account through Safari with an https://mail.yourmail.com/exchange. It will prompt you for your ID and password. You are good to go!

    Try turning off the pop up blocker. The reply in OWA opens a new window.

  • Error 2170 when using Xcelsius with a web service

    Hi,
    I have built a small dashboard that gets data from a web service. When previewing it in XCelsius itself, the data is picked up without problem, but when exporting the file to PPT, Word or PDF, I get Error 2170 which is a connection error.
    The Webservice I use a self-built one from a function module in an ECC6.0 system.
    In the web (and her in SDN) I have found two solutions:
    1) Flash settings. For Flash versions above 9.0, one has to allow connection to external programs. I have tried that but am not sure if I should allow connection for the PPT or PDF or for the .swf file "inside" (which I dont know the name of).
    2) Server side. A crossdomain.xml file should be added to the root of the webserver. What folder would that be in the case of an ERP system and could I do that? Additionally: can the be the reason to my problem when the webservice works fine as long as called from within XCelsius?
    I would be very grateful for ideas...
    Thorben

    Thorben,
    Here is what you need to do
    -->Export your visualization to swf
    -->Run the Swf, right click on visualization and got to settings.
    OR
    Click
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
    In 3rd Tab (Global Security Settings)
    --> Check box "Always Allow"
    --> In the Drop down (Edit location... select Add Location
    -->Browse the swf file
    That is it...now reopen the .swf file, it should not throw error.
    Hope this helps
    -Anil

  • Using Mail with Outlook Web Access?

    I've heard there is a lot of trouble with this but wondering if someone can help me out, I would really love to get my work email this way, I DESPISE Outlook Web Access, I entered the proper POP server address and it took, but kept ignoring my password, any help?
    Thanks!

    Just to confirm, since I don't see it mentioned, can you confirm that you're not on Exchange 2003.
    OWA for Exchange 2003:
    http://i190.photobucket.com/albums/z242/asatoran/OWA2003.jpg
    OWA for Exchange 2007:
    http://i190.photobucket.com/albums/z242/asatoran/OWA2007.jpg
    OWA for Exchange 2010:
    http://i190.photobucket.com/albums/z242/asatoran/OWA2010.jpg
    Configuring Mail for Exchange does not work on Exchange 2003 and earlier.

  • Help with java - web form filling out

    I am pretty new to java, but I am learning the basics. However, I know next to nothing about html spec/ java net packages.
    I have code that goes through a database of "stuff" I have stored. It then generates all the choices that I want to list an ebay auction as. However, I need to get java to fill out the form, get an answer and send a submit command. I know there are .net related classes, but not really sure how to use them. I also am sure there are simplier ways to do this, but am trying to do this in java. I know you basically telnet into port 80 of the host computer, and feed them a line of stuff saying who you are and asking for the new page.
    If you want a link go here
    http://pages.ebay.com/sell/index.html
    then click on a catagory and log in and you will see the generic sell item form.
    Any help you can give is great, assume you are talking to a complete idiot cough.

    Look at this, to send mails.
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.Date;
    public class TestMail {
      public static void main (String args[]) throws Exception {
         //String host = "smtp.mail.yahoo.com";
         String host = "your_smtp_host_ip_address";
         String from = "karthik";
         String subject = "Test Message";
         String body = "Hi ,\nThis is Sudha sending this test mail.\nKindly send ack.\nSudha";
         String to= "[email protected]";
         String mes = sendMessage(from,to,subject,body,host,false);
           System.out.println(mes);
    public static String sendMessage(String s, String s1, String s2, String s3, String s4, boolean flag)
    try
    Properties properties = new Properties();
    properties.put("mail.smtp.host", s4);
    Session session = Session.getDefaultInstance(properties, null);
    MimeMessage mimemessage = new MimeMessage(session);
    InternetAddress internetaddress = new InternetAddress(s);
    mimemessage.setFrom(internetaddress);
    mimemessage.setSentDate(new Date());
    InternetAddress ainternetaddress[] = InternetAddress.parse(s1);
    InternetAddress ccinternetaddress[] = InternetAddress.parse("some_email_id");
    mimemessage.setRecipients(javax.mail.Message.RecipientType.TO, ainternetaddress);
    mimemessage.setRecipients(javax.mail.Message.RecipientType.CC, ccinternetaddress);
    if(s2 != null)
    mimemessage.setSubject(s2);
    if(flag)
    String s5 = "<html><head><title>Job Alert</title></head><body>";
    s5 = s5 + s3;
    s5 = s5 + "</body></html>";
    mimemessage.setContent(s5, "text/html");
    } else
    mimemessage.setText(s3);
    Transport.send(mimemessage);
    return "Mail sent successfully";
    catch(Exception exception)
    return "Error in sending mail!!! " + exception.getMessage();
    }Sudha

Maybe you are looking for

  • Adobe Muse (2014.3) "Add Web Font" Function Not Working As Expected - Newly Added Fonts Become Unavailable Though Shown

    Hello. This has also been posted in the Community: Adobe Muse Bugs forum. I've been having some odd/irregular issues though they have now become fairly predictable in nature. The issue is in regards to Adobe Muse (2014.3) and the availability of web

  • DW CS3 - custom file extension no longer working correctly

    Hi - for a particular job, I needed to use a custom file extension .htmx and it has been working fine. However, I went into DW CS3 today, and the file opens in the DW editor, but the code coloring and code hints etc seem to be broken. I've checked th

  • Need help in performance

    hallow i doing this select and it take more then 10 minutes and i don't now way because object_key have just 60 entries ? how i can slve this problem? Regards   SELECT * FROM covp APPENDING TABLE *covp           FOR ALL ENTRIES IN object_key         

  • Strange GL account in Invoive Verification

    Dear Experts, Usually, IR doc is Dr: GR/IR Cr: AP-vendor But, My document is Dr: GR/IR Cr: GL account I don't know where is this GL account from, Is it configurable? otherwise, how does SAP find and post this GL account instead of AP-vendor? Before t

  • XAI invalid user name and password

    Hello, I am getting the following error when i submit the SOAP request to CC&B, i have changed the all username's and password's fields on XAI Option page to SYSUSER and its corresponding password. still getting the below error, looks like i am doing