Pass query to servlet through midlet

Hi, I have a problem here. I would like to control the SQL Statement to be executed by the servlet using the mobile midlet. Like this one:
midlet -> will call servlet with parameter statement -> servlet will execute the statement parameter passed by the midlet and will return a data result in XML -> midlet will read the XML file and retrieve the data.
Another thing I would like to ask is how will I make the servlet to output an XML file that can be read by the midlet. If there's some tutorial on how please give me the link.
I hope you get my point.

I have made to retrieve data on my midlet from my servlet. The bad thing is the data sent on the midlet has html tags. How will I make the midlet to just output the data result without the tags?If you are in charge of the servlet, then have it output plain text. If you need to parse the MIDlet input first, then having the content of XML/HTML elements will allow you to print them out.
Is this servlet used from HTML browser as well? If so, try having a separate one for mobile devices. There are plenty options to do it.
Daniel

Similar Messages

  • Pass query to the report through form

    Hello everybody...
    I m using forms and reports 6i.
    I create query through form depends on user selection.
    Means user select specified columns from specific table. And finally i create complete query.
    Now i wanna pass that query to report builder and wants to generate automatic report depends on that query.
    Can anybody have idea how to do this?
    How to pass query from form and generate report.
    If any1 knows then please help me

    You should pass all columns but with separator character i.e.:
    supl_cd||';'|| supl_name ||';' city ||';'|| add1 ||';'|| add2 ||';'|| pincode ||';'|| country my_column
    You should also pass column names if you want and get them back using the same procedure.
    Procedure for retrieving should use instr,loop and srw.do_sql, if you don't know what is SRW built in package, then take a look in report's help. That's a pity that there is nothing similar in forms. You can use dynamic select to pass values exactly to the report's variables:
    for i in 1..10 loop
    srw.do_sql('select '||i||' into :cp_'||i||' from dual');
    end loop;
    Jakub Flejmer

  • Passing Query to search iview

    Dear Expert
    I want to pass query to the KM Search iview, I want to pass a couston property and based on the property the documents need to be displayed
    How to pass the query to KM Search ivew
    Regards
    Noel

    Hi Noel,
    Try the follwing URL
    https:/your.portal.com/irj/servlet/prt/portal/prteventname/HtmlbEvent/prtroot
    /pcd!3aportal_content!2fevery_user!2fgeneral!2feu_role!2fcom.sap.km.
    home_ws!2fcom.sap.km.hidden!2fcom.sap.km.
    urlaccess!2fcom.sap.km.basicsearch?
    SearchType=ctrlpers&
    SelectedSearchIn=FROM_HERE&
    SearchVisible=false&
    rndLayoutSet=aSearchResultLayoutSet&
    SelectedCustomProps=aNamespace:aProdId(value=aValue/operator=EQ)&
    disDidYouMean=true&
    QueryString=aString&
    SelectedSearchFolder=/documents/Public+Documents
    Regards
    BP

  • Pass data from servlet to jsp using sendRedirect

    Hi,
    I am passing data from servlet to jsp using forward method of request dispatcher but as it doesn't change the url it is creating problems. When ever user refreshes the screen(browser refresh) it's re-loading both servlet and jsp, which i don't want to happen. I want only the jsp to be reloaded.
    Can I pass data from servlet to jsp using sendRedirect in this case. I also want to pass some values from servlet to jsp but without using query string. I want to set some attributes and send to jsp just like we do for forward method of request dispatcher.
    Is there any way i can send data using attributes(without using query string) using sendRedirect? Please let me know

    sendRedirect is meant as a true redirect. meaning
    you can use it to redirect to urls not in your
    context....with forward you couldn't pass information
    to jsps/servlets outside your own context.Actually, you can:
    getServletContext().getContext("/other").getRequestDispatcher("/path/to/servlet").forward(request, response)I think the issue here is that the OP would like to have RequestDispatcher.forward() also update the address in the client's browser. That's not possible, AFAIK. By the time the request is forwarded, the browser has already determined the URL of the servlet, and the only I know of way to have the browser change the URL to the forwarded Servlet/JSP is to send a Location: header (i.e. sendRedirect()). Remember that server-side dispatching is transparent to the client. Maybe there's some tricky stuff you can do with JavaScript to change the address in the address bar without reloading the page?
    Brian

  • Null values passed into the servlet

    Hi all,
    I keep getting null values for all the params that I pass into the servlet i.e. sqltype, producttype, process, instance etc....I have attempted to print some of them out on the screen but I keep getting the 'NullPointerException' error message...can anyone tell me what it is that I have down wrong in the below code?
    If I run the servlet with method calls that have hardcoded arguments in them it works but not when I pass in the params from the URL...I am absolutley puzzled!
    Help!
    package blotter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Date;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.db.util.WriteToLogFile;
    import blotter.cache.*;
    Servlet to extract an object that has already been placed
    in the cache by GetBondPrices servlet from the cache.
    public class ExtractSecurityObject extends HttpServlet
         String sqlType = "";
         String productType = "";
         String instance = "";
         String process = "";
         String asOfDate = "";
         String currencyCode = "";
         String curveId = "";
         String results = "";
         private String debug;
    private PrintWriter out;
         private WriteToLogFile logFile;
         // called when servlet first initialised
         public void init(ServletConfig config) throws ServletException
              super.init(config);
         // method called for each get request
         public void doGet( HttpServletRequest request, HttpServletResponse response )
                   throws ServletException, IOException
              String toWrite = " ";
    // Get the object identifier from the parameters passed in
              sqlType = request.getParameter("sqltype");
    productType = request.getParameter("producttype").toUpperCase();
              instance = request.getParameter("instance");
              process = request.getParameter("process");
              asOfDate = request.getParameter("asofdate");
              curveId = request.getParameter("curveid");
              currencyCode = request.getParameter("ccy").toUpperCase();
              out.println(currencyCode);
              if ( request.getParameter("debug") !=null)
                   debug = request.getParameter("debug");
              else
                   debug ="";
              // set the mime type to html
    response.setContentType( "text/html" );
    out = response.getWriter();
    out.println("<HTML>");
              try
              // write some parameters to a log file
              toWrite = toWrite + "<li>" + getServletInfo() + " at " + new Date() + " " + sqlType + " " +
                        productType + " " + instance + " " + process + " " + asOfDate + " " + curveId + " " +
                        currencyCode;
         CachedObject o1 = (CachedObject)CacheManager.getCache("EB_" + currencyCode + productType + asOfDate);
    if(o1 == null){
              CacheSecurityObject cso = new CacheSecurityObject();
                   if((request.getParameter("sqltype") == null) && (request.getParameter("instance") != null)){
    results = (String)cso.putSecurityinCache(null, request.getParameter("producttype"), request.getParameter("instance"), request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    //results = (String)cso.putSecurityinCache(null, "yc", "frafu", "official", "20011105", "baceod", "sek");
    out.println(results);
                   } else {
    //results = (String)cso.putSecurityinCache("bondtypes", "bond", null, "official", "20011105", "baceod", "eur");
    results = (String)cso.putSecurityinCache(request.getParameter("sqltype"), request.getParameter("producttype"), null, request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
    out.println(results);
              else{
                   out.println(((String)o1.object).toString());
    // general catch for all exceptions
              catch(Exception exception)
                   out.println( "Exception: The item that you requested was not found in the cache" + "<BR>" );
                   toWrite = toWrite + "Exception : " + exception.getMessage() + "\n" ;
              finally
    // write to logfile
              logFile = new WriteToLogFile();
              logFile.setSourceDirName("blotter");
              logFile.setQuery(request.getQueryString());
              logFile.setServletPath(request.getServletPath());
              if (toWrite!=null)
              logFile.writeLog(getServletInfo(),toWrite);
    out.println("</HTML>");
              out.close();
         // need the class name for log file
         public String getServletInfo()
         return this.getClass().getName();
    }

    That section of the code references a cache to extract an item that has been requested by the user. If the item is not in the cache i.e. if(o1 == null) then it will call a class that generates that object and places that object into the cache. The second time the user makes the same call then they will be handed a cached copy of that object which is aimed to make the whole servlet call faster.
    That section of the code works fine coz I have tested that separately. It is the reading in of the arguments that is causing the problem.

  • Error while executing servlet through a HyperLink.

    Hi
    When i am trying to execute a servlet through the HyperLink using this statement
    where CallStatusDetailsAssign is my servlet.then i am getting this error :
    The Following is the Alert Message.
    1. Microsoft InterNet Explorer
    http://localhost:8080/examples/servlets/CallStatusDetails?Call_ID=1&EMP_NO=1
    ** Download of the specified Resource has failed.
    & also getting this error:
    2. IE Cannot open the Internet Site
         ** Operation has been Cancelled.
    If i refresh the screen by clicking on refresh button in the Internet Explorer.the Page is getting displayed properly.
    Is there any problem with my servlet code ??or some other Problem.
    Can Anyone Please help me on this & give me the Solution for my Problem.
    Rashmi

    I'm not sure if this is cause of your problem but the anchor tag should look like this:
    some text</ a>
    ... in the code the quotes are missing
    spieler

  • How Transportation of Adhoc Query is done through RSAQR3TR report.

    Hi,
    How Transportation of Adhoc Query is done through RSAQR3TR report.i want to transport a new usergroup, new infoset and a query from Develpment to Quality and Production.
    I have gone through the documentation of the RSAQR3TR report and as well as the SAP library material, but still i am confused.
    Please help

    Hi,
    http://www.sap-img.com/basis/transport-of-abap-query.htm
    Hope this helps.
    Regards,
    Rashmi

  • Passing values to servlet

    HI All
    I am developing a project using html and servlets. from my html page(regis.html) i am trying to pass the values which are entered by the user to the servlet (Admin_Regis.java) which is in the another package called Admin. The way i am doing is
    <form class="registerlogin" method="post" action="Adimn/Admin_Regis">
    but i am not able to send the values to the servlet. It showsr HTTP Status 404 - /Adimn/Admin_Regis.
    My question is how to pass the values from html to servlet which is the different packages . I have three more packages .
    Can any body please help me in solving this problem.

    HI
    The problem i was facing ie the values was not able to pass to the servlet i got the part of the solution for that . What actually i have done is i have kept all my web pages in one saperate folder so i was not able to send . But now when all my pages are in default folder even then i was not be send the values can any body please help me out for this problem.

  • Pass query string in Flex Builder debug?

    Hi,
    I'm trying to figure out how to launch a debug session while passing query strings in Flex Builder. If I open up the Debug dialog, and uncheck "Use Defaults" and attempt to add my query string to the Debug Path text field, Flex Builder states that "The file cannot be found to launch".  How do I pass a query string to debug in a SWF with Flex Builder?
    Thank you.

    If I understood your question correctly.
    go to html-template/index.template.html and add the query string there and everything you run the app the query string should be there.
    Hope this helps,
    BaBo,

  • Is it possible to pass Query parameters between two XLF's

    Hi,
    I have a parent dashboard (.xlf) and i'm trying to launch another .xlf (child) from the main dashboard using OpenDocURL.
    Is it possible to pass Query Parameters from parent to the child using OpenDocURL ?
    If not , how we can do it ? . I don't want to use SWF loader to load the child dashboard.
    I'm using SAP Dashboard 4.1 SP4.
    Thanks,
    Shiva.

    Hi Permisindo,
    I tried the approach suggested in the blog, but the parameters are not being passed.
    I have a master xlf and a child swf. I used swf loader to load the child and pass the paramters.
    Here is the URL -
    http://<Server>:8080/BOE/Xcelsius/opendoc/documentDownload?sIDType=CUID&iDocID=<doc id>&sKind=Flash&Fac=All Departments&RoomGroup=All Rooms
    I created the flash varibles(Fac , RoomGroup) in the child swf which i mapped to the respective query trigger cells.

  • Fetching network name from a mobile through MIDlet

    Hi All,
    Friends can we fetching network name from a mobile through Midlet programming ? I mean the network tower it currently used.
    if anyone has the concept about that then please help me about that.
    Thanks........
    Edited by: javalearner83 on Sep 26, 2007 4:58 AM

    sory to tell u that i dont know whether it is possible in j2me or not??
    but surely it is possible in Symbian c++
    in my company my collegue has worked in same application about which u are talking

  • Passing arguments with spaces through to asc.jar

    According to the docs, we can pass arguments through to llc using -fllvm-llc-opt.  Additionally, with llc we can pass arguments through to asc.jar using -ascopt.  Let's say I want to define an AS3 variable in my flascc swf/swc.  asc.jar says that I can do this using "-config <ns::name=value>".
    So it seems like I should be able to do this:
    gcc ... -fllvm-llc-opt=-ascopt=-config CONFIG::RELEASE=true
    But this doesn't work, as the "-config" parameter takes its next argument via a space and not an equals, which throws the whole thing off.  gcc thinks its another argument.  Trying it with spaces like this:
    gcc ... "-fllvm-llc-opt=-ascopt=-config CONFIG::RELEASE=true"
    also doesn't work.  The toolchain outputs:
    Error:
    LLVM ERROR: Failed to run /usr/bin/java with args:
    -Xmx1500M -jar /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/asc2.jar -merge -md -abcfuture -AS3
    -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/builtin.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/playerglobal.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/BinaryData.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/Exit.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/LongJmp.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/ISpecialFile.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/IBackingStore.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/InMemoryBackingStore.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/IVFS.abc -import /Users/asimmons/FlasCC_1.0/sdk/usr/bin/../../usr/lib/CModule.abc
    -config CONFIG::RELEASE=false -d /var/folders/cn/hjz9nbt53bdfpn1rzn6wdb900000gr/T//ccQPoczK.lto.2.as /var/folders/cn/hjz9nbt53bdfpn1rzn6wdb900000gr/T//ccZDGxMF.lto.1.as -outdir . -out output
    As you can see, the "-config" command made it to asc.jar.  What I think is happening is that its being passed to asc.jar as one argument (not two).  For example, I can copy-paste this command into bash and it will work-- just not when done from gcc.
    So: how do I pass arguments with spaces through to asc.jar?

    I believe you should be able to do this by splitting it across two fllvm-llc-opt flags:
    gcc ... -fllvm-llc-opt=-ascopt=-config -fllvm-llc-opt=-ascopt=CONFIG::release=true
    The Makefile in the 12_Stage3D sample that ships with the FlasCC SDK demonstrates this.

  • Passing password to servlet

    I need to authenticate a user. In an applet I created a name JTextField and password JPasswordField. I get the password with .getPassword().toString(). At the servlet I get a sequence of meaningless characters. How do I get the original password?
    Thank you all.

    Are you using Base64 encoding? If not I don't undestand your problem. You have an applet wich has a textfield. The user enters the password and then you send it to the servlet. But most probably you've got a problem while sending the password.
    Two solutions for u:
    1) Invoke the servlet through HTTP or HTTPS
    2) Put the textfield directly in the web page (HTML or JSP) and then use FORM to send the data to your servlet.
    If u want more details, please ask!
    Hope it helps,
    St�phane

  • Passing a whole array through a method

    I need some quick help on how to pass a whole array through the method addCoins(). Here is the code:
    public class Purse {
         private Coin[] coins;
         private int lastIdx;
    public Purse() {
         coins = new Coin[100];
         lastIdx = 0;
    public boolean addCoin(Coin b) {
         if (lastIdx < coins.length) {
              lastIdx++;
              coins[lastIdx] = b;
              return true;
         else {
              return false;
    public boolean addCoins(Coin[] b) {
         if (lastIdx < coins.length) {
              for (b=0; b<99; b++) {
                   coins[b] = b;
         else {
              return false;
    }I figured passing the whole array would be "Coin[] b" but apparently Eclipse says that it can't convert from int to Coin[]. I have no idea what that means. Thanks in advance.

    I need to create 3 classes, Coin, Purse, and TestPurse.
    Coin code:
    public class Coin {
         private String typeOfCoin;
         private double value;
    public Coin(String t, double v) {
         typeOfCoin = t;
         value = v;
    public String toString() {
         return typeOfCoin + value;
    }Purse code:
    public class Purse {
         private Coin[] coins;
         private int lastIdx;
    public Purse() {
         coins = new Coin[100];
         lastIdx = 0;
    public boolean addCoin(Coin b) {
         if (lastIdx < coins.length) {
              lastIdx++;
              coins[lastIdx] = b;
              return true;
         else {
              return false;
    public boolean addCoins(Coin[] b) {
          if (lastIdx < coins.length) {
              for (int i=0; i<coins.length; i++) {
                   coins[i] = b;
         else {
              return false;
    public Coin getReverse() {
         coins = new Coin[0];
         lastIdx = 100;
    }In the Purse class, I need methods addCoin and addCoins that need to return boolean.  addCoin is supposed to add the argument coin as an element of the coins array if there is space.  addCoins neds to add all the coins in the input argument as elements of the coins array if there is space.  I then have to create two methods, getReverse and getValue that take no argument and getReverse that returns an array of type Coin while getValue returns a double.  In getReverse, I create an array simlar to coins but this new array is reverse.  I started on this method but I first need to worry about the addCoin and addCoins method.  For the record, getValue needs to add up the values of all the coins in the purse and return it, which I have no idea how to do that.  That's my next question.
    Edited by: quagmire87 on Dec 1, 2009 4:35 PM
    fixed method addCoins                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Trying to run my first servlet through Eclipse + XAMPP

    I'm trying to run my first servlet through eclipse, I'm using XAMPP + Tomcat add-on as my webserver. How do I even try and compile my servlet? I've added the external jar Servlet-api.jar to my project as stated in here, http://www.theserverside.com/discussions/thread.tss?thread_id=37924
    But eclipse wouldn't compile it, because there just isn't a main() in my servlet program..
    Do I need to install the WPT plugin for eclipse? I'm guessing I'm not setting my CLASSPATH correctly - Do I need to set it up manually?

    Nevermind, there were lots of Issues going the XAMPP way, so I just installed Tomcat separately and all is fine now.
    I used instructions from http://www.scribd.com/doc/495993/Installing-Apache-Tomcat-6-and-Using-It-With-Eclipse and it was a walk-in-the-park..

Maybe you are looking for

  • About to panic! need urgent help with Notes!!!

    I had this huge collection of very important notes which are now all gone thanks to a bug in Mountain Lion! The notes app in mountain lion was showing two copies of each note. So i disabled the icloud notes from system preferance. now i could see onl

  • Spotlight search .dmg in Yosemite?

    Can I get spotlight to search a mounted .dmg file when it does a search?

  • I Tunes - Sync (Btw Comps)

    Hi there, in conjunction with the NY, my laptop absolutely died on me yesterday - won't even register the power feed. I had my i-tunes installed on it, the back-up I have is a few months old... Is there a simple way of getting the material I have pur

  • UCCX In Parallels

    Hello, We are running an 8.5 HA instance of UCCX. One of our superivosrs asked me if there is a method to address the following: Per our conversation yesterday here are the problems faced with ACD, both Supervisor and Agent Desktops. When using Mac O

  • AE 12.2 - online or offline updates?

    Just updated adobe applications, not sure after effects was even one of them but hey, and my workspaces have disappeared. Ae says it's version 12.2.1.5 I'm aware they're about to update, but I'm not keen on downloading that until bug roll outs come i