JEditorPane can't handle POST from HTML form?

I posted this before but i never got an answer so i'll try again :-)
Im running a tomcat server were i have a jsp script that uploads files to the server. What i need to do to is to use a regular java application for the rest of the "project" im working on.
And i can get the JSP page to be displayed properly using JEditorPane but i cant get the html FORM POST in the JSP to execute... i dont know if theres some limits in JEditorPane or if im just using the wrong type of approach on this one.
This is the server
http://chilly-schrimp.kicks-ass.org/uploadbean/SimpleUpload.jsp
(only works if my computer is turned on)
Heres the code:
=======================================================================
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
public class JSPtest {
public static void main(String[] args) {
JEditorPane pane = null;
try {
pane = new JEditorPane("http://chilly-schrimp.kicks-ass.org/uploadbean/SimpleUpload.jsp");
catch (IOException ex) {
ex.printStackTrace(System.err);
System.exit(1);
pane.setEditable(false);
// Add a hyperlink listener.
final JEditorPane finalPane = pane;
pane.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent ev) {
try {
if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
finalPane.setPage(ev.getURL());
} catch (IOException ex) { ex.printStackTrace(System.err); }
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setContentPane(new JScrollPane(finalPane));
frame.setSize(350,400);
frame.setVisible(true);
=======================================================================
any suggestions??
thanx
/eric

I am using request.getParameter(passed variable name)
to pass data from HTML form to JSP with no problem.
WHen I try to pass data from HTML form of
multipart/form-dta type to JSP as following:
< form enctype="multipart/form-data" name="theForm"
method="post"
ACTION="http://titan.ssd.loral.com:7778/ifs/jsp-bin/if
-cts/stringsecond.jsp">
The passed value is null. Why?because the jsp most likely does not handling of POST parameters like this.
How can I pass data successfully from this form to
JSP?jsp's are not meant to read such amounts of data. this (= uploading) is a typical task for a specialized servlet. there you have full control over input and output. if you need to, you can still forward to a jsp after processing in the servlet.
How can I pass data from JavaScript to JSP???? i'm not sure what exactly you mean. normally you put it into an url and submit it.
robert

Similar Messages

  • Can't pass parameter from HTML form of multipart/form-dta type to JSP

    I am using request.getParameter(passed variable name) to pass data from HTML form to JSP with no problem. WHen I try to pass data from HTML form of multipart/form-dta type to JSP as following:
    < form enctype="multipart/form-data" name="theForm" method="post" ACTION="http://titan.ssd.loral.com:7778/ifs/jsp-bin/ifs-cts/stringsecond.jsp">
    The passed value is null. Why?
    How can I pass data successfully from this form to JSP?
    How can I pass data from JavaScript to JSP?
    Thank you

    I am using request.getParameter(passed variable name)
    to pass data from HTML form to JSP with no problem.
    WHen I try to pass data from HTML form of
    multipart/form-dta type to JSP as following:
    < form enctype="multipart/form-data" name="theForm"
    method="post"
    ACTION="http://titan.ssd.loral.com:7778/ifs/jsp-bin/if
    -cts/stringsecond.jsp">
    The passed value is null. Why?because the jsp most likely does not handling of POST parameters like this.
    How can I pass data successfully from this form to
    JSP?jsp's are not meant to read such amounts of data. this (= uploading) is a typical task for a specialized servlet. there you have full control over input and output. if you need to, you can still forward to a jsp after processing in the servlet.
    How can I pass data from JavaScript to JSP???? i'm not sure what exactly you mean. normally you put it into an url and submit it.
    robert

  • Solved: process POST from html form

    Hello,
    I have the next question, I have a public website (in an other technology) that uses the "POST" method of an html form to navigate to my application.
    One of the fields on the html form is the field "name".
    I was wondering if their is any possibility to get the value of the field "name" when I come on my ApEx page?
    I hope i'm making some sense here.
    Thanks in advance
    Kind regards,
    Oli

    Perhaps this will help....
    http://htmldb.oracle.com/pls/otn/f?p=9487:65
    Run the demo and try the view_http_post_flex_redirect procedure call.

  • How can I embed an DOCTYPE HTML Form from Adobe Forms central into a responsive html5 page?

    How can I embed an DOCTYPE HTML Form from Adobe Forms central into a responsive html5 page?
    -Luis

    Hi,
    You can embed the form on your website, but you need to make sure that javascript has been enabled in the browser. You need to copy the embed code and add it into your HTML code. If you would like FormsCentral to generate embeded HTML form without using javascript, you may post a feature request and vote it. Hope it helps! Thanks!
    Kind regards,
    Shiyao Bao

  • In-Context Editor can't handle implicit index.html

    The In-Context Editor can't handle implicit index.html - e.g., when a menu link points to /subfolder/ with a file named index.html inside, the link works fine on the front-end but In-Context Editor users get a 404 Page Not Found error.
    Naively, it appends .htm to the folder, producing an invalid url like this: /subfolder/.htm
    The workaround is to explicitly include the filename in the link like /subfolder/index.html, but this is undesirable.
    Anyone else been bitten by this?

    /subfolder
    Will go to the same place as well.

  • How can we handle dateformat from diff countries into india in bdc with out

    hi
    experts can u help me pz
    how can we handle dateformat from diff countries into india in bdc with out chnaging system parameters while uploading.
    i.e flatfile date is germanformat
         target date is indianformat.
    thanks and regords.

    use WRITE statement to format date.. along with extension ...
    DD/MM/YY
    or
    DD/MM/YYYY

  • JDBC + SERVLET: inserting text data  to access file from Html form

    Hi everybody !
    I'm trying to insert text data from my html form to access database using servlet and jdbc technologies.
    The problem that I'm that the data is TEXT, but not the English language !!!
    So my access db file gets - ???????? symbols instead the real text.
    This is the form line that sending data to my servlet:
    <form
    method="POST"
    ACTION=http://localhost:8080/servlet/myServlet enctype="text/html">
    And this is servlet line that defines response content:
    res.setContentType( "text/html" );
    What can I do to get in access db file the right text format and not a ???????? symbols.
    Maybe I must to ad some <meta ...> , but where ?

    You're dealing with Unicode, I'd guess, and not ASCII.
    I guess I'd have two questions:
    (1) Is the character encoding on your pages set properly for the language you're trying to use?
    (2) Does Access handle Unicode characters?
    Access isn't exacly a world-class database. (If it was, there'd be no reason for M$ to develop SQL Server.) I'd find out if it supports other character sets. If not, you'll have to switch to a more capable database that does. - MOD

  • Calling PLSQL Stored Procedure From HTML Form Submit Button

    Hi there,
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
    Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
    So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
    Seems pretty simple but I am not sure how to make this happen... My thoughts were:
    Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
    Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
    Thanks so much in advance!
    - Jeff

    795018 wrote:
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
    The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2 );
    end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
    URL:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
    PL/SQL call:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2, birthdate => :value3 );
    end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
    Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
    The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
    You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
    All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
    Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on.

  • Using xsgl:insert-request to insert non-English character data from HTML form

    I tried to insert a text written in French and pasted into an HTML form into my database following the recipe from the XSQL release notes.
    The table:
    create table content_object (
    id number(9) constraint pk_content_object primary key,
    author number(9),
    title varchar2(256),
    abstract varchar2(1024),
    object_type_id number(9),
    content_meat clob,
    XML file the form is posted to:
    <?xml version="1.0"?>
    <xsql:insert-request connection="demo"
    xmlns:xsql="urn:oracle-xsql"
    table="content_object"
    transform="article_form_to_content_object.xsl"/>
    article_form_to_content_object.xsl:
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="request/parameters">
    <ROW>
    <TITLE><xsl:value-of select="title_field"/></TITLE>
    <ABSTRACT><xsl:value-of select="abstract_field"/></ABSTRACT>
    <CONTENT_MEAT><xsl:value-of select="content_field"/></CONTENT_MEAT>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    The result was:
    <ROW num="2">
    <ID>6</ID>
    <TITLE>Le go</TITLE>
    <ABSTRACT>Vin bouchonn</ABSTRACT>
    <CONTENT_MEAT>Des conditions de conservation au tant d</CONTENT_MEAT>
    </ROW>
    All strings were cropped at the point where the first accented character appeared.
    Any idea why this is happening? With English texts it works just fine.
    Maciej

    Another user hit this problem this week. I debugged it and posted the reply in the discussion thread:
    http://technet.oracle.com:89/ubb/Forum11/HTML/002799.html
    It's a JDK bug in character set conversion that has a simple workaround, just indicate the ISO-8859-1 encoding on your XSQL page. See the end of this other thread for details.

  • Uploading File To MySQL from HTML form via Servlet

    Hello all !
    I hope this is better place to ask.
    I'm working on simple Servlet/Jsp application trying to hold to MVC pattern and got stuck on uploading file to MySQL db.
    Here's what I'm trying to accomplish:
    1) client submits a JPEG image via a simple html form on a webpage.
    2) JPEG is put into a database table, column field of type BLOB.
    3) Servlet processes the request, gets a connection to the db and inserts the image into the table.
    4) after that user is able to retrieve an image from db and display it in JSP page.
    This is pretty much the same task Angela was trying to do here:
    http://forum.java.sun.com/thread.jspa?threadID=667597&messageID=3905449
    I could use her snippets if i knew what is what and decided to figure out this myself. Aftet some investigation i found out that i need to import org.apache.commons.fileupload.*;which i found here: http://jakarta.apache.org/commons/fileupload/
    what am i driving at ?
    -----------------------1-----------------------
    After first line of code
    boolean isPart = FileUpload.isMultipartContent(request);netBeans 5.5 beta2 with bundled Tomcat 5.5.17 underlines this with warning saying that
    org.apache.commons.fileupload.FileUploadBase
    has been depreceted
    is it a reason for concern ?
    -----------------------2-----------------------
    Is it actually good idea to store images in db as blob ?
    what about large ammounts of text ?
    thank you
    -Dominik

    is it a reason for concern ?Yes.
    You should take a look at the method in the documentation and find out exact reason for depricating it.
    If it is depricated becouse they going to remove it in the future you should use the new alternative method becouse if you use the old method your app will not work in the future releases of the API.
    If it is depricated becouse it is not safe to use the method you should clearly understand the risks involved in using the method and see if that can give you any trouble in your project.
    -----------------------2-----------------------
    Is it actually good idea to store images in db as
    blob ?I think that it is ths best option available when you want to store binary data
    what about large ammounts of text ?You can use clob columns.
    By the way when you store files in the database its better you put some extra columns to store the file name and file type(mime) becouse you cant directly detect those things later by just looking at the data of the file.

  • How to search xml file data based on the given keyword from html form

    hi,
    i'm new to XML. I have this problem regarding searching within a XML file.
    the
    idea is that my search will be based on the keyword entered
    in
    by the user from a HTML form. the keyword is then used to search all
    the
    question nodes and the choice nodes within a XML file. once the match
    is
    found, i will have to display the results.
    But i don't know how to do so - especially the part of searching xml file.
    Can
    anyone help me in this? Your help is much appreciated.
    Edited by: Moti_Lal.D on Apr 4, 2008 7:28 AM

    yeah.. what i was trying to do is
    i have one xml fine. then i have to read all the tag values say
    <book>
    <title>Java</title>
    <author>agarwal</author>
    <price>200</price>
    </book>
    <book>
    <title>Xml</title>
    <author>saxmann</author>
    <price>300</price>
    </book>
    i can read the tag values like this
    File file = new File("dom.xml");
    try {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(file);
    NodeList nodes = doc.getElementsByTagName"book");
    for (int i = 0; i < nodes.getLength(); i++) {
    Element element = (Element) nodes.item(i);
    NodeList title = element.getElementsByTagName("title");
    Element line = (Element) title.item(0);
    what i want is i may give any xml file
    like File file = new File("xxx.xml");
    (it may be one level/two level/3level tagged one)
    then the i should read all the tag values and store them in some array. Then when i enter some character from keyboard (say "a") then it has to show all the tag values starts with "a" and display them.
    i guess u understand my problem.

  • Processing cyrilic input from HTML FORM

    Hello everybody,
    I have faced the problem with processing the cyrilic input from the HTML form, The JSP code to receive it and store it can`t do it properly. The <page> directive has ContentType='text/html; charset=UTF-8' and the HTML itself has <meta> tag for the same charset; Only problem is that cyrilic symbols are coming from
    HttpServletRequest object not properly encoded.
    Can anybody help me?
    Regards
    Pavel

    Have a look at
    http://www.crazysquirrel.com/compgen/form-encoding.php
    Jacek

  • Modify flash movie from HTML form

    so here is what I have:
    I have a flash movie and as the flash movie plays there are
    elements that say things like, "Your company name here" or "Your
    title here", or "Your Product Picture here" etc.
    From an HTML form (I can do all this part) I would want
    someone to be able to specify their customized information and
    SOMEHOW that would end up in the Flash movie. I would like to know
    whether I need special software to create these. I ultimately need
    have the final product be a .swf with the form-entered information
    like Company Name, etc.
    I don't know what I need in order to do this. I'm basically
    info-gathering. Ask any questions if I am leaving anything out that
    might help you help me identify what we need.
    Thanks in advance.

    no. none from me. i honestly dont have the first clue

  • Can not run Reports from a Form

    Hello,
    First: I'm completely new to Oracle, even my english is not very good - i'm sorry for that.
    Problem:
    I want to run a report from a Form using the Report Server.
    If i use:
    WEB.SHOW_DOCUMENT('http://tfischer:8888/reports/rwservlet?report=C:\Oracle-Projekte\testbericht.rdf&USERID=user/password@oraapp&SERVER=SrvShadow&DESFORMAT=html&DESTYPE=cache', '_blank') - everything works well.
    But if i use:
    repid := FIND_REPORT_OBJECT('REPORT_NAME');
    v_rep := RUN_REPORT_OBJECT(repid); - always following Error-Message appears:
    "FRM41213: Anmeldung bei Report-Server SrvShadow nicht möglich" (english: registration on Report-Server SrvShadow not possible)
    I am using:
    Windows 2000
    Oracle DS9i
    Oracle DB92 (Personal edition)
    Can somebody help me, please?
    If you need more information, to help me, please ask.

    Hi,
    Try using
    SET_REPORT_OBJECT_PROPERTY
    (repid,REPORT_SERVER,"YOURSERVERNAME");
    before
    v_rep := RUN_REPORT_OBJECT;
    If you are testing the report on your PC using reports services on your PC then you may need to initiailize the reprots server using
    rwserver server="YOURSERVERNAME" install
    at command prompt.
    Hope this helps.
    -Jayshree

  • Procedure that receives object from HTML form

    Hello......
    I need to create a procedure that will accept some type of object from an HTML form - either an array or result set of some sort, that I can accept and parse within PL/SQL.
    Does anyone know the best type of object to receive? It will simply be a dataset that contains code/value pairs.
    Thanks,
    -Christine

    passing the information I described previously Please take this comment in the spirit it is descibed. Often this kind of discussion raises insults and barbs and this is not the intention...
    You did really not "descibed the information previously."
    Whenever "key value pairs" are present, this is the point.
    Then I will ask "what is the purpose of this procedure that has no fixed definition"? but instead can take any arbitrary list of dynamically named parameters and values, and how is such a procedure to be written?
    I guess if you don't understand yet the data domain, then such decisions as "which technology shall I use to render and interact with the information" becomes suitably difficult and you find yourself this position.

Maybe you are looking for