Flash, Servlets & MySQL: Collecting variables

Hi,
I have developed a Java Servlet that recieves variables from a Flash file. THe problem is the encoding, i need a way to either convert into the correct encoding for populating into a MySQL db or to extravt the value from the request. Sample code looks like this:
String name = req.getParameter("name");
but when populated into the database the HTML tags that make up the HTTP request are still there
ie <P ALIGN="LEFT"><FONT FACE="AR">Kevin Kilroy</FONT></P>
Thanks in advance
Kevin

best would be to strip the html tags in the flash file. But i don't know Flash, so i have no idea whether and how this can be done.
You need something like a html stripper. i never used something like this, but i remeber i read about this topic in the forum. There must be a class somewhere in the jdk that is designed to parse a hmtl file and 'grap' the values of the html elements and attributes. I guess this way you should be able get the values you like.
Do a search in the forum or in the jdk for HTML Parser - i guess you'll find what you need.

Similar Messages

  • Wrong character encoding from flash to mysql

    Hi, im experiencing problems with character encoding not
    functioning correctly when sending from flash to mysql. What i am
    doing is doing a contact form in flash which then sends the value
    to a php file which takes the values and inserts them into a table.
    As i'm using icelandic charecters i need the char encoding to be
    either latin1 or utf8 in mysql, or at least i think so. But it
    seems that flash or the php document isn't sending in the same
    format as i have selected in mysql because all special icelandic
    characters come scrambled in the mysql table. Firefox tells me
    tough that the html document containing the flash movie is using
    utf-8.

    I don't know anything about Icelandic characters, but Flash
    generally really likes UTF-8. So it should be sending that if that
    is what it is starting with.
    You aren't using any kind of useCodePage? That will mess it
    up.
    Are you sure that the input method is Icelandic?
    In the testing environment can you list variables (from the
    debug menu) and see if they look proper? If they do then Flash is
    readying them correctly and the problem must be coming in further
    down stream.

  • Flash PHP MySQL issue

    can someone please tell me what i'm doing wrong:
    (Actionscript)
    var db_out:URLVariables = new URLVariables();
    db_out.from = "property";
    db_out.where = "`state`='OR'";
    var db_req:URLRequest = new URLRequest("php/search.php");
    db_req.data = db_out;
    db_req.method = URLRequestMethod.POST;
    ldr_db.load(db_req);
    (PHP)
    $select='`id`';
    $from=$_POST['from'];
    $where=$_POST['where'];
    $order='`type`';
    $result=mysql_query('SELECT '.$select.' FROM `'.$from.'` WHERE '.$where.' ORDER BY '.$order);
    this returns no results.
    this issue is within the db_out.where variable.
    other searches where db_out.where is a Number (IE: where = "`status`=1") work fine.
    so how do i pass a String query from Flash to MySQL?
    if it were a single variable sent to PHP, i would wrap it in single quotes (IE: ''SELECT '.$select.' FROM `'.$from.'` WHERE `state`='."'".$var."'".' ORDER BY '.$order), but how do i properly send a WHERE statement from Flash to MySQL involving a String??
    much appreciated,

    i figured it out. no idea why this is an issue, but it seems to be.
    if Flash passes a string to PHP to be used in a MySQL query, and that string contains single quotes (IE `city`='Portland'), the query will return 0 results, even if its WHERE had an OR conditional in it not using single quotes (IE `status`=1).
    so here's the fix:
    use some unused symbol in place of the single quotes (IE ^) in Flash, and have PHP use str_replace to swap them for single quotes.
    i dont know why PHP has to be the one to implement the single quotes, but it seems to
    IE:
    $where = str_replace('^', "'", $_POST['where']);
    i hope this saves someone the hours i spent trying to figure this one out!!

  • SMSTSMPListRequestTimeout collection variable is not working ?

    Anybody tested the following collection variable introduced in SCCM 2012 R2?
    We found that it's not functioning as expected ... We're experiencing similar issue mentioned in technet thread
    here. We used SMSTSMPListRequestTimeout
    variable without any success. After that we fall back to normal 180 seconds sleep before application installation and that worked very well. :(
    http://technet.microsoft.com/en-us/library/hh273375.aspx
    SMSTSMPListRequestTimeout
    For System Center 2012 R2 Configuration Manager only:
    Use this variable to specify how much time a task sequence waits before it retries to install an application after it fails to retrieve the management point list from location services. By default, the task sequence
    waits one minute before it retries the step. This variable is applicable only to the Install Application task sequence step.
    Anoop C Nair -
    @anoopmannur :: MY Site:
     www.AnoopCNair.com ::
    FaceBook:
     ConfigMgr(SCCM) Page :: 

    Hi David ! - Thank you much. I don't have logs at the moment. Will try to check on this Monday.
    Regards
    Anoop
    Anoop C Nair -
    @anoopmannur :: MY Site:
     www.AnoopCNair.com ::
    FaceBook:
     ConfigMgr(SCCM) Page ::
    Linkedin:
     Linkedin<

  • For loop or table cast to collection variable

    Hi ,
    I have a collection variable (Table type) which can have at-most 20 variables in it. I want to fetch one particular record.
    Which is more efficient; a For loop* or a table cast* ?
    Thanks,

    @Karthick, The requirement is like I have a query (with 2 joins in it) in a procedure which is executing about 50Lac times, and out of 50Lac execution it is fetching same data for say 25000 records.
    I mean query output is same for 25000 records (not fixed) and then it is same for next 25000 records. So I took a collection variable and did a BULK COLLECT to a variable and trying to process (fetch) data in memory instead of hitting the query again (and table ) again.
    Also query is taking 0.001 sec per execution but it is running for so many times thats why procedure is taking time. Oracle performs 2 type of I/O
    1. Physical I/O
    This happens when oracle picks up the data blocks from the data file and puts it in the Data buffer (SGA)
    2. Logical I/O
    This happens when oracle picks up data block from Data buffer (SGA)
    In Data Buffer the data is stored in FIFO basis. So when you hit a table for the first time oracle goes for a physical I/O the subsequent time it will go for Logical I/O.
    What you are trying to do oracle does it already. You don't have to use a collection. Collection uses expensive private memory (PGA).
    And again the basic question is why are you executing a procedure 50,00,000 times?

  • SCCM 2012 R2 collection variables question

    Can a task sequence setup for collection variables be used with different collections [each with different collection variables] and each having a unique deployment?
    Regards

    You are free to file feedback on connect.microsoft.com but first think about what you are asking: How would ConfigMgr know anything about the variable you set or what it will be used for during the TS?
    Why are you having to create new applications and packages in the first place though? That part is unclear to me?
    Finally, are you really manually setting task sequence variables on collections and then manually populating those collections? Why not use MDT and/or UDI or simply present a GUI to the interactive user to choose what they want/need?
    Jason | http://blog.configmgrftw.com

  • Error while passing collection variable into procedure.

    Hi Experts,
    I'm facing errors while trying to pass the collection variables as in parameter to the procedure.
    PLS-00306: wrong number or types of arguments in call
    Please suggest me?
    Thanks in advance....

    I'm facing errors while trying to pass the collection variables as in parameter to the procedure.
    PLS-00306: wrong number or types of arguments in call
    If you want help with code you need to POST THE CODE.
    Post the DDL for the procedure that shows how the parameters are defined.
    And post the code you are using to CALL that procedure that shows what parameters you are passing and the datatypes for those parameters.

  • Collection variables

    Hi,
    I am not able to view the collection variable values in the pl-sql developer, is there any setting from which i can change it and view the same.
    Thanks,
    Mehul

    Are you talking about viewing PL/SQL collection variables at runtime in th debugger? AFAIK it can only show you scalar collections. Or, do you have a database table with a nested table or varray column? If so it should be able to handle it but I can't check right now.
    You might try the Allround Automations' PL/SQL Developer forum.

  • Not being prompted for collection variables

    Heres the situation:  i have a few very similar task sequences that deploy operating systems to unknown computers.  By placing the collection variable "OSDComputerName" on the unknown x64 computers collection my unknown 64-bit computers
    stop and ask for a computer name before executing the rest of the task.  I have an identical setup on my unknown x86 collection.  When i PXE boot that task sequence though i am never prompted to enter the variables.  Both advertisements are
    optional installs.  Both boot disks while different architecture and drivers are based on the lasted boot images that came with SCCM 2012r2 with the latest updates (6.3.9600.16384).  Other than collecting my variables the task sequence functions.
     Any ideas?
    Update:  It appears that the real problem is that this computer is not associating with the expected collection.  The device runs a 64-bit capable Atom CPU but is only compatible with 32-bit versions of Windows.  I expected (possibly incorrectly)
    that the computer when unknown would associate with the unknown 32-bit computer object, but in fact it associates with the 64-bit unknown computer object.

    That was a good idea and gave me a clue.  The collection variable did function that time so i did some more testing.  I have determined that this device is booting my 32-bit boot image, but is including itself in the "Unknown x64 Computer"
    object and therefore pulling collection variables and tasks from the "Unknown x64" collection.  Is there a place in the logs I can determine what collection this unknown device is associating with?  Looking at smsts.log i also found what
    appears to be the machine stating that its a 64-bit compatible system:  "Is 64-bit capable: 1"

  • MySQL Environment Variable on Installation

    Hi,
    This is probably a relatively simple problem to resolve, but I have no experience with BO
    and it has me stumped.
    I am trying to install Business Objects Server on a Redhat Server, and the BO installation script complains :
    MySQL '' environment variable not set. This means either that a MySQL client is not installed on this computer, or that a MySQL client is installed on this computer but not set up for the current user.
    Can anyone tell me what environment variable it's checking ? The MYSQL client is in my path.
    Many thanks,
    Russ.

    I've made some progress. The perl script BOBJEsetupui.pm tests for $MYSQL_HOME being set, and fails with this message if it's not set.
    Now I just need to get through the "validating database credentials..."
    thanks,
    Russ.

  • Web Hosting for Flash/ColdFusion/MySQL

    I am new to Flash and interesting in creating simple
    forms/guestbooks using flash. My web hosting service supports most
    php & mysql technology. Most of the tutorial I see on the the
    macromedia site refer to coldfusion.
    Can anyone provide tips or articles relating
    Flash/ColdFusion/MySQL on web hosts that do not support Access
    & SQL server?
    Can anyone recommed a host that supports
    Flash/ColdFusion/MySQL

    The host I use most often is CrystalTech.
    http://www.crystaltech.com
    They have ColdFusion hosting with MySQL, Flash. They are
    reasonably priced and have very good customer service. (very
    important in my opinion...)

  • Using collection variables

    Hi could you please help me in putting the values (Output from the query ) into collection variable
    The following is the sample one i tried , but confused to use this Record variable.
    CREATE OR REPLACE PACKAGE Pkg_test
    IS
      ----- Record Variable ----
      TYPE rec_job IS RECORD
       ( job1 varchar2(50),
         job2 varchar2(50),
         Rank varchar2(50)
      TYPE typ_job IS TABLE OF rec_job
         INDEX BY VARCHAR2(500)  ;
      ---- Procedure Declaration ----
    PROCEDURE proc_job ( p_d1 IN   number, p_d2 number
                         o_Rat     OUT  typ_job );
    END Pkg_test
    CREATE OR REPLACE PACKAGE BODY Pkg_test
    IS
    PROCEDURE proc_job ( p_d1 IN   number default 10, p_d2 number default 20
                         o_Rat     OUT  typ_job )
      IS
    BEGIN
       select e1_job,e2_job,
    case when e1_job =e2_job
         then '0'
          else '1'
          end as Rating    into O_RAT -- How to use this collection variable
           from (
    select distinct e1_job,e2_job , rank () over (partition by e1_job ,e2_job order by e1_SAL )rn
    from
    (select e1.job e1_job,e1.sal e1_sal,e2.job e2_job from
    emp e1 , emp e2 where e1.deptno =p_d1 and e2.deptno =p_d2 )
    ) where rn =1
    order by 1,2   
    -- How can i keep  e1_job ,e2_job ,Rating values into the collection variable  o_Rat.
    -- Could you hint me to do this                          
    end;Thank you
    Edited by: Smile on May 7, 2012 10:50 AM

    Hi Smile,
    are you asking how to get the output into a collection variable?
    Your o_Rat output parameter is of type typ_job which is an associative array (or index-by table) of records of rec_job type having as index defined as VARCHAR2(500).
    Do you have any specific requirement about this table?
    Why the index is declared as VARCHAR2(500)?
    What do you expect to return as index value?
    If it was a nested table or an associative array with index PLS_INTEGER or BINARY_INTEGER you could have used BULK COLLECT INTO if you want to fill your array.
       select e1_job,e2_job,
    case when e1_job =e2_job
         then '0'
          else '1'
          end as Rating   
              BULK COLLECT into O_RAT -- How to use this collection variable
           from (
    select distinct e1_job,e2_job , rank () over (partition by e1_job ,e2_job order by e1_SAL )rn
    from
    (select e1.job e1_job,e1.sal e1_sal,e2.job e2_job from
    emp e1 , emp e2 where e1.deptno =p_d1 and e2.deptno =p_d2 )
    ) where rn =1
    order by 1,2
    {code}
    This however is not working in your case unless you modify your table to be either a nested table or an associative array with an integer index.
    Please specify what do you expect the output to be.
    I suggest you to check the Oracle documentation to understand collections: http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm
    Regards
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HELP! flash error code #1065 variable TCMText is not defined

    Hi,
    Im doing a project for uni and trying to create a search bar throughout the flash document for people to find what they are looking for.
    Followed a tutorial online step by step and then i get this error. #1065 variable TCMText is not defined.
    I'm really a beginner, any help would be so greatly appreciated!
    stop();
    var i:int = 0;
    var names:Array = new Array("Annual Report","annual report");
    var frames:Array = new Array("2","2");
    text_in = "..."; /*what is wrong with you */
    searchbutton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
      findInArray(text_in.text);
      gotoAndStop(frames[i]);
    function findInArray(str:String):int
      for(i = 0; i < names.length; i++)
      if(names[i] == str)
      return i;
      return 0;
    it says the issue is on line 7 where i have commented out "what is wrong with you"!
    Ive read a lot of things online and i have got it as classic text, which everyone is telling them to do. So quite confused.
    If you can, please help me.
    Thanks!!!

    Sorry for a delay in reply.
    Here is what the error says...
    ReferenceError: Error #1065: Variable TCMText is not defined.
    Scene 1, Layer 'Actions', Frame 1, Line 7
    1067: Implicit coercion of a value of type String to an unrelated type flash.text:TextField.
    If you could help in away that would be great cheers!

  • Servlet mySQL help needed

    Hey Guys... I have a servlet located on the same server as my mySQL database, which is supposed to gather data from the database. Then I have client code, which is supposed to connect to the servlet from some other remote machine, and get the data from the servlet. I had to do it this way because my webhost does not allow remote access to the mySQL database. But my servlet code is not working, no data is being gathered. And I'm betting my client code is incorrect too. I've never had to connect to a servlet from a remote app, I've always connected directly to the database...sooo could you check my code and show me what is wrong and how to do it correctly? (note I XXX'ed out passwords, etc) Thank you...
    LOCAL SERVLET
    public class ServletTest extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
             response.setContentType("text/html");
              PrintWriter out = response.getWriter();
             Connection myConnection;
            Statement myStatement;
            String url="jdbc:mysql://localhost/tsptracker_com?user=XXX&password=XXX";
            String query = "SELECT * FROM fund_data ORDER BY datadate DESC LIMIT 2";
            try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); }
            catch (Exception e)
            { System.err.print("Unable to load driver"); }
            try
                myConnection = DriverManager.getConnection (url, XXX, XXX);
                myStatement = myConnection.createStatement();
                ResultSet rs = myStatement.executeQuery(query);
                for(int i = 0; i < 4; i++)
                      int id = rs.getInt("dataID");
                      String dataDate = rs.getString("datadate");
                      double gPrice = rs.getDouble("g_price");
                      double fPrice = rs.getDouble("f_price");
                      double cPrice = rs.getDouble("c_price");
                      double sPrice = rs.getDouble("s_price");
                      double iPrice = rs.getDouble("i_price");
                      String temp = id + " " + dataDate + " " + gPrice + " " +
                           fPrice + " " + cPrice + " " + sPrice + " " + iPrice;
                     out.println(temp);
                myStatement.close();
                myConnection.close();
            catch(SQLException e)
            { System.err.println(e.getMessage()); }
            out.close();
    }REMOTE CLIENT
    public class ClientTest
         public static void main(String[] args) throws Exception
              URL url = new URL("http://www.XXX.com/servlet/Test");
              URLConnection con = url.openConnection();
              con.setDoOutput(false);
              con.setDoInput(true);
              con.setUseCaches(false);
              InputStream in = con.getInputStream();
              String buffer = "";
              for(int i = in.read(); i != -1; i = in.read())
            { buffer += (char)i; }
              in.close();
              System.out.println(buffer + "");
    }

    Hello kkopacz,
    From your code, some of the assumptions seems to appear :
    1) You are having Your Servlet Container and MySql on the same machine.
    2) You are providing your user name and password in your URL for the MySql Driver.
    3) You have mapped the 'ServletTest' class's object by '/servlet/Test' in your Deployment
    Descriptor(web.xml).
    4) You are assuming at least four records in your MySql database : tsptracker_com [ This should be in fact in your while(rs.next()) loop at least though not checked for rs to be null ]
    I would say, try with following changes in your code,
    1) insted of 'myConnection = DriverManager.getConnection (url, XXX, XXX);' in ServletTest
    only say 'myConnection = DriverManager.getConnection (url)', since you are already giving as a part of dbase URL , uname and pwd.
    2) In your ClientTest, try following code
    public class ClientTest
         public static void main(String[] args) throws Exception
              URL url = new URL("http://www.XXX.com/servlet/Test");
    // Since http URL and also set content type in response test/html,
    // U can use HttpURLConnection object.
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
    if(con.getContentLength() == -1) {
    con.connect();
              InputStream in = con.getInputStream();
              String buffer = "";
              for(int i = in.read(); i != -1; i = in.read()) {
    buffer += (char)i;
              in.close();
              System.out.println(buffer + "");
    I hope this should work fine.
    Main prob seems to be in your code, is you are giving unmae and paswd again.. and assumption of recod numbers.
    Anyway, I think this should work for you.
    Cheers
    -Yogi

  • Oral exam - Flash CS4 - Local/global variables?

    Hi!
    In two days, i have an Oral exam in flash programming, with CS4.
    we've been given a problem to solve, and i naturally am having problems solving it!
    This is the problem
    You are suppost to make a calculator. The calculator should be able to show how much time a person uses
    when he/she climbs a mountain when hiking. Time is counted in minutes, and the height is the mountain-height.
    a) I should be able to calculate, and show how many heightmeters one walks per minute.
    example:
    Height: 1440 meters
    time: 360 minutes
    1440/360 = 4 Heightmeters per minute.
    4 * 60 = 240 heightmeters per hour
    So, i pretty much figured this out.
    iHeight, iTime and iHeightmeters, and iHeightmeters2(for the hour one).
    My problem shows itsself when i get to b.
    b) animation: Show a person that walks from the bottom, to the top of the mountain, in this application(basically the stage, with the calculator on the right side or something along those lines)
    I animated, and i was able to give my "guy" some speed in x and y direction, so that he walks up to the top of the mountain.
    c) Let the speed from a, decide the speed the person walking up the mountain has.
    So what i'm suppost to do is:
    mcWalkingman.x += iHeightmeters;
    mcWalkingman.y += iHeightmeters;
    Theese values have to recide in a function for themselfs, a function only containing speed variables and such. While the "iHeightmeters" recide in the first function where the calculator is. How do i get whatever value iHeightmeters turns out to be, into the next function or another function at all, when the variables are local?
    I hope you understand my problem, and that someone is able to help me.

    If i got you right you want to share a variable between differnet functions ?
    You need to specify it globally and not within the function. If you are programming it just in the Flash IDE, it would be something like
    var iHeightmeters:int = 123456;
    testFunction();
    function testFunction():void
        trace("iHeightmeters = " + iHeightmeters);
    If you do this within a class, it should be
    private var iHeightmeters:int = 123456;
    testFunction();
    private function testFunction():void
         trace("iHeightmeters = " + iHeightmeters);

Maybe you are looking for

  • Wired dslr control cinematography or videography?

    I've noticed that the only way to use an iPad as a field monitor for my Canon 7D is through an app that transmits the signal wirelessly (i.e. camRanger,Teredek - TeraCentral). A method that doesn't work for video due to the delay. I've seen wired dsl

  • Is there a way to adjust the opacity of a photo in Aperture 3?

    Hello.....I am a new user to aperture 3.   When creating a book I am looking for a way to adjust the OPACITY or TRANSPERANCY of a photo to use as a background behind other photos or text.   Also wondering if there is a way to adjust the OPACITY or TR

  • Conditional Page Header Suppression

    Post Author: whellier CA Forum: Formula I have a report in v9.0 that I have inherited. A formatting issue has come up which requires a page header to be conditionally suppressed. The condition that triggers the suppression is that the last record pri

  • Any good conferences in oracle e-business in 2007?

    Hi apps dbas, Do you know any good conferences in e-business in 2007? From there can share the experience with the other dbas and Know how the other shops deal with their systems? Thanks, Lily

  • Batch Selection LIFO/FIFO

    Hi experts, I've read many threads, wikis, websites about how to customize the batch selection FIFO or LIFO. While testing the settings, trying to to a Mvt 201 from MB1A, I've seen in the screen "Goods Movement: Storage Location and Batch Selection"