Example CODE to show information on URLs

import java.awt.Dimension;
import javax.swing.JOptionPane;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;
import java.net.URL;
import java.net.URLConnection;
import java.util.Date;
import java.util.Iterator;
/** Accepts an URL and dumps information relevant to it.
Does not attempt to display the actual content.
Note the response codes carefully.
E.G. If an URL's has a response code of '403 Forbidden',
this means the URL is not allowed, either for general
browsing, or more specifically, to connections that
identify themselves as 'bot'.
For more information on response codes, see
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@version 1.0 2006/12/06 */
public class ShowHeaders {
  public static void main(String[] args) {
    String address = null;
    if (args.length==0) {
      address = JOptionPane.showInputDialog(
        null,
        "Show information for which URL?");
    } else {
      address = args[0];
    JEditorPane jep =  new JEditorPane();
    try {
      URL url = new URL(address);
      URLConnection urlc = url.openConnection();
      urlc.setRequestProperty("user-agent", "bot");
      StringBuffer sb = new StringBuffer();
      // show the URL/address
      sb.append( "URL: \t" + url  );
      /** Show the reported content-type.
      Some common content types..
      HTML - text/html
      JNLP - application/x-java-jnlp-file
      ZIP  - application/zip */
      sb.append( "\n\ncontent-type: \t" +
        urlc.getContentType()  );
      // display dates..
      sb.append( "\n\nDate: \t" +
        new Date(urlc.getDate())  );
      sb.append( "\nExpires: \t" +
        new Date(urlc.getExpiration())  );
      // display user interaction params.
      sb.append( "\n\nAllow User Interaction: \t" +
        urlc.getAllowUserInteraction()  );
      sb.append( "\nDefault Allow Interaction: \t" +
        urlc.getDefaultAllowUserInteraction()  );
      /** add the encoding and length
      (often not available) */
      sb.append( "\n\nEncoding: \t" +
        urlc.getContentEncoding()  );
      sb.append( "\nLength: \t" +
        urlc.getContentLength()  );
      // dump the header fields
      sb.append( "\n\nHeader Fields:" );
      Iterator it = urlc.getHeaderFields().
        values().iterator();
      while ( it.hasNext() ) {
        sb.append("\n" + it.next());
      jep.setText( sb.toString() );
    } catch(Exception e) {
      // tell the user what went wrong
      jep.setText( "URL: \t'" + address + "'\n\n" +
        e.toString() );
    JScrollPane jsp = new JScrollPane(jep);
    jsp.setPreferredSize(new Dimension(500,300));
    JOptionPane.showMessageDialog(
      null,
      jsp,
      "Information on the URL",
      JOptionPane.INFORMATION_MESSAGE);
}Example useage;C:\showheader>javac ShowHeaders.java
C:\showheader>java ShowHeaders http://www.physci.org/pc/jtest.jnlp
C:\showheader>java ShowHeaders http://java.sun.com/
C:\showheader>rem: prompt user for an URL
C:\showheader>java ShowHeadersHTH (anybody)

Yes. My apologies for forgetting to mention, it
is just example code that others may find useful.
I like to have 'copies' of any handy little utils,
'stewn about the place' as well, in case I need
them while away from my PC.
..Or to link to them for the benefit of others.
"check the content type with the code shown here.."
This is one way to get a (pretty!) version of it.. ;-)

Similar Messages

  • Do I have to use an external clock with a cDAQ-9188 and NI 9401 to read a linear encoder? I'm seeing error message that implies that but the example code doesn't show it.

    We can set up a task that works on demand but when we go to continuous sampleing we see Error -200303, which claims an external sample clock source must be specified for this application.  However, some of the NI linear encoder example code doesn't show that (uses the cDAQ 80 Mhz clock) and the documentation didn't mention that. 

    It's mentioned in the 918x user manual:
    Unlike analog input, analog output, digital input, and digital output, the cDAQ chassis counters do not have the ability to divide down a timebase to produce an internal counter sample clock.  For sample clocked operations, an external signal must be provided to supply a clock source.  The source can be any of the following signals:
    AI Sample Clock
    AI Start Trigger
    AI Reference Trigger
    AO Sample Clock
    DI Sample Clock
    DI Start Trigger
    DO Sample Clock
    CTR n Internal Output
    Freq Out
    PFI
    Change Detection Event
    Analog Comparison Event
    Assuming you have at least one available counter (there are 4 on the backplane), I would suggest to configure a continuous counter output task and use its internal output as the sample clock.  Specify the internal counter using an "_" for example "cDAQ1/_ctr0".  The terminal to use for the sample clock source would be for example "/cDAQ1/Ctr0InternalOutput".
    Which example uses the 80 MHz timebase as a sample clock?  It is far too fast for a sample clock on the 9188 according to the throughput benchmarks (80 MHz * 4 byte samples = 320 MB/s).  There is also no direct route between the 80 MHz timebase and the sample clock terminal for the counters--making this route would use a second counter anyway.
    Best Regards,
    John Passiak

  • Simple example code to connect to SQL server 2002

    Hi,
    I found a good website a while back which showed step by step how to connect to a sql server DB using JDBC, a re-install of windows means I cant find it again. I have searched the web, but to no avail. Basically I need to find a step by step guide to using java to access data within MS SQL server 2000. It needs to include details about where to download suitable drivers etc. and example code so that I can originally test my connection before diving much deeper.
    Any help much appreciated.

    Hi:
    here is the code that you can use it to test your connect if you use MS sql 2000 free driver. Others, you need to make little change on
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); and
    con = .......... parts
    goog luck !
    import java.sql.*;
    public class Connect{
    private java.sql.Connection con = null;
    private final String url = "jdbc:microsoft:sqlserver://";
    private final String serverName= "localhost";
    private final String portNumber = "1433";
    private final String databaseName= "pubs";
    private final String userName = "xxxxx";
    private final String password = "xxxxx";
    // Informs the driver to use server a side-cursor,
    // which permits more than one active statement
    // on a connection.
    private final String selectMethod = "cursor";
    // Constructor
    public Connect(){}
    private String getConnectionUrl(){
    return url+serverName+":"+portNumber+";databaseName="+databaseName+";selectMethod="+selectMethod+";";
    private java.sql.Connection getConnection(){
    try{
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = java.sql.DriverManager.getConnection(getConnectionUrl(),userName,password);
    if(con!=null) System.out.println("Connection Successful!");
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());
    return con;
    Display the driver properties, database details
    public void displayDbProperties(){
    java.sql.DatabaseMetaData dm = null;
    java.sql.ResultSet rs = null;
    try{
    con= this.getConnection();
    if(con!=null){
    dm = con.getMetaData();
    System.out.println("Driver Information");
    System.out.println("\tDriver Name: "+ dm.getDriverName());
    System.out.println("\tDriver Version: "+ dm.getDriverVersion ());
    System.out.println("\nDatabase Information ");
    System.out.println("\tDatabase Name: "+ dm.getDatabaseProductName());
    System.out.println("\tDatabase Version: "+ dm.getDatabaseProductVersion());
    System.out.println("Avalilable Catalogs ");
    rs = dm.getCatalogs();
    while(rs.next()){
    System.out.println("\tcatalog: "+ rs.getString(1));
    rs.close();
    rs = null;
    closeConnection();
    }else System.out.println("Error: No active Connection");
    }catch(Exception e){
    e.printStackTrace();
    dm=null;
    private void closeConnection(){
    try{
    if(con!=null)
    con.close();
    con=null;
    }catch(Exception e){
    e.printStackTrace();
    public static void main(String[] args) throws Exception
    Connect myDbTest = new Connect();
    myDbTest.displayDbProperties();

  • Simple Server/Client Applet example code ???

    Hi to all.
    I would like to ask if possible to someone to tell me some example code to do this simple thing:
    I want an applet showing only a TextField and a button. When the user writes something on the textfield and press the button, it should send the text in the textfield to the "server", and then it should save it in a variable.
    I think there should be 2 different classes at least (server and client), but no idea in how could I make this on Java.
    So I am asking if possible for some sample code for make this.
    Thank you for the information
    John

    hello!
    Here is a console based Server which will recieve the string and disply on the DOS screen.
    /////////////////////////////////// Server /////////////////
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class ChatServer extends Thread
    ServerSocket ssSocket;
    Socket sSocket;
    public BufferedReader in;
    public PrintWriter out;
    public ChatServer()
         try
         ssSocket = new ServerSocket (4000);
         catch(IOException e)
         System.out.println (e);
    public void run()
    try
         sSocket = ssSocket.accept();
         if(sSocket != null)
              in = new BufferedReader(new InputStreamReader(sSocket.getInputStream()));
              out = new PrintWriter(sSocket.getOutputStream(), true);
    String str = in.readLine();
         System.out.println (str);
         catch(IOException e)
              System.out.println (e);
    public static void main (String []args)
              Thread th = (Thread) new ChatServer();
              th.start();     
    ///////////////////////// Client //////////////////////
    public class Client extends Applet implements ActionListener
    public Socket sClient;
    public BufferedReader in;
    public PrintWriter out ;
    String str;
    private TextField txt = new TextField();
    private Button btn = new Button ("OK");
    public void init()
         try
         sClient = new Socket ("localhost" , 4000);
         in = new BufferedReader(new InputStreamReader(sClient.getInputStream()));
         out = new PrintWriter(sClient.getOutputStream(), true);
         catch (UnknownHostException uhe)
         catch (IOException ioe)
         System.out.println (" I/O Exception : " + ioe);
         setLayout(new FlowLayout());
         txt.setColumns (20);
         add(txt);
         add(btn);
         btn.addActionListener(this);
    public void actionPerformed(ActionEvent AE)
         if(AE.getSource() == btn)
         str = txt.getText();
         out.println(str);
    now u should try it and improve it according to ur need...
    Ahmad Jamal.

  • Any example code to generate and measure both channels using a 4451 DSA card?

    I want to generate signals and check the magnitude and phase performance between the inputs on a 4451 DSA card. It seems like there would be some example code already available for this function.

    I've attached an example which shows how to perform sychronized input and output with a NI-4451 board. This example only acquires the raw voltages and displays them on a graph. If you want magnitude and phase information, consider using a complex FFT algorithm.
    Hope this helps,
    Jack Arnold
    Application Engineer
    National Instruments
    Attachments:
    DSA_Simultaneous_IO_(reduced_ringing).vi ‏177 KB

  • Error compiling this example code of libcurl

    Its an example code to download a file and show gtk window..
    http://curl.haxx.se/libcurl/c/curlgtk.html
    I get this error:-
    shadyabhi@ArchLinux /tmp $ gcc curlgtk.c `pkg-config --libs --cflags libcurl`
    curlgtk.c:13:21: fatal error: gtk/gtk.h: No such file or directory
    compilation terminated.
    shadyabhi@ArchLinux /tmp $
    Then I tried :-
    shadyabhi@ArchLinux /tmp $ gcc curlgtk.c `pkg-config --libs --cflags libcurl` -I /usr/include/gtk-2.0/
    In file included from /usr/include/gtk-2.0/gdk/gdk.h:32:0,
    from /usr/include/gtk-2.0/gtk/gtk.h:32,
    from curlgtk.c:13:
    /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30:21: fatal error: gio/gio.h: No such file or directory
    compilation terminated.
    shadyabhi@ArchLinux /tmp $
    Whats the issue?
    The complete code:-
    /* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft */
    /* an attempt to use the curl library in concert with a gtk-threaded application */
    #include <stdio.h>
    #include <gtk/gtk.h>
    #include <curl/curl.h>
    #include <curl/types.h> /* new for v7 */
    #include <curl/easy.h> /* new for v7 */
    GtkWidget *Bar;
    size_t my_write_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
    return fwrite(ptr, size, nmemb, stream);
    size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
    return fread(ptr, size, nmemb, stream);
    int my_progress_func(GtkWidget *bar,
    double t, /* dltotal */
    double d, /* dlnow */
    double ultotal,
    double ulnow)
    /* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/
    gdk_threads_enter();
    gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t);
    gdk_threads_leave();
    return 0;
    void *my_thread(void *ptr)
    CURL *curl;
    CURLcode res;
    FILE *outfile;
    gchar *url = ptr;
    curl = curl_easy_init();
    if(curl)
    outfile = fopen("test.curl", "w");
    curl_easy_setopt(curl, CURLOPT_URL, url);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
    curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
    curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
    res = curl_easy_perform(curl);
    fclose(outfile);
    /* always cleanup */
    curl_easy_cleanup(curl);
    return NULL;
    int main(int argc, char **argv)
    GtkWidget *Window, *Frame, *Frame2;
    GtkAdjustment *adj;
    /* Must initialize libcurl before any threads are started */
    curl_global_init(CURL_GLOBAL_ALL);
    /* Init thread */
    g_thread_init(NULL);
    gtk_init(&argc, &argv);
    Window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    Frame = gtk_frame_new(NULL);
    gtk_frame_set_shadow_type(GTK_FRAME(Frame), GTK_SHADOW_OUT);
    gtk_container_add(GTK_CONTAINER(Window), Frame);
    Frame2 = gtk_frame_new(NULL);
    gtk_frame_set_shadow_type(GTK_FRAME(Frame2), GTK_SHADOW_IN);
    gtk_container_add(GTK_CONTAINER(Frame), Frame2);
    gtk_container_set_border_width(GTK_CONTAINER(Frame2), 5);
    adj = (GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0);
    Bar = gtk_progress_bar_new_with_adjustment(adj);
    gtk_container_add(GTK_CONTAINER(Frame2), Bar);
    gtk_widget_show_all(Window);
    if (!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0)
    g_warning("can't create the thread");
    gdk_threads_enter();
    gtk_main();
    gdk_threads_leave();
    return 0;

    Your error is unrelated to curl. You're not properly linking against gtk
    gcc curlgtk.c $(pkg-config --libs --cflags gtk+-2.0 libcurl)

  • Url used to show in the url box when opening from a shortcut or email, but now it's not there. If I refresh the page it is. How do I get this back the way I like it?

    The url of the website that I'm visiting used to show in the url box when I opened from a shortcut or email. But not it's not there unless I refresh the page. I've looked and haven't found a way to set this so that it works like it used to. I liked being able to click in the address bar and copy the link, or even to look there and see where I am.

    I'm unable to check it in safe mode because the only time it happens is when I click a link and have not firefox open. For example if I would click a link in my email right now, it would open in another tab and show the address of the link I clicked. But if I didn't not have this window open and clicked alink, it would open a new window and I wouldn't be able to see the url.
    Here's a screen shot.
    [http://chibitude.com/gallery/albums/userpics/10001/firefoxSSForAddressProblem.jpg firefoxSSForAddressProblem.jpg]

  • (Error code: sec_error_bad_signature) shows up on fire fox and IE when i try to use any google service

    (Error code: sec_error_bad_signature) shows up on both firefox and ie when i try to go on google or youtube. it says exactly:Secure Connection Failed
    An error occurred during a connection to www.google.com. Peer's certificate has an invalid signature. (Error code: sec_error_bad_signature)
    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
    What peer?
    please answer

    Do you get a prompt to create an exception?
    Click the site identity button - More Information - View Certificate https://support.mozilla.org/en-US/kb/how-do-i-tell-if-my-connection-is-secure
    Look for 'Issued By' and post that information or post a screenshot.
    https://support.mozilla.org/en-US/kb/how-do-i-create-screenshot-my-problem
    Note that some anti-virus/firewall software and programs like Sendori, FiddlerRoot, or BrowserProtect can intercept your secure connections and send their own certificate instead of the website's certificate.

  • Acrobat 7.0 ActiveX Object example code in Lookout

    Help folks!
    I'm trying to set up the Adobe Acrobat 7.0 Browser Document ActiveX Object under Lookout 6.0 but it doesn't work. My goal is to display a pdf document by lookout.
    What should I set by Property Browser...?
    What should I set by Property Pages...?
    What should I set by Value Property:?
    What means the term "Property" in this kind of objects?
    Is there an example code I can get?
    Any suggestion will be appreciated.
    Thanx.

    I don't know of a FREE ActiveX control for MS Word.  However, if you have MS Word installed on the same computer, you can use MS Internet Explorer ActiveX Control to view Word documents. 
    But before we do that, we have to make sure that MS Word is set to open documents in the "same window."  This basically opens a DOC file in Internet Explorer itself rather than launching a new MS Word window and then opening the DOC file in it.  To set this (if it isn't already):
    1. Launch Windows Explorer. 
    2. From the Tools menu, select "Folder Options"
    3. Click the "File Types" tab. 
    4. From the listing of "Registered File Types," select "Microsoft Word Document," (you can get to it fast by typing "DOC"); click Advanced. 
    5. Click the "Browse in same window" check box -- this toggles whether a Word document is launched outside of Internet Explorer. 
    6. Click OK to close the dialog boxes. 
    NOTE:  if the DOC still opens in a new MS Word window (and not IE), go back and toggle the check-box. 
    In Lookout, use the Lookout Webbrowser control (which is nothing but MS IE Control).  Specify the file path to the DOC file as the URL.  I am attaching a process file which does this using a TextEntry object. 
    Hope this helps.
    -Khalid
    PS:  not sure when this changed but we can't directly attach .L4P files to a post.. what a pain!  Please take a minute to add your weight to this request: 
    http://forums.ni.com/ni/board/message?board.id=130​&message.id=2142
    Message Edited by Khalid on 12-28-2005 02:55 PM
    Attachments:
    doc_process.zip ‏4 KB

  • How to show a nice URL in Browser URL navigator?

    How to show a nice URL in Browser URL navigator?
    Hello
    Arquitecture:
    Internet --- Machine1 (Apache like Proxy Reverse and rewrite) --- MAchine2 (GLASSFISH-APEX LISTENER 2.0.1) --- DATABASE
    That application will be like a directory of products, we need a nice indexation inside google, yahoo, etc...
    We want to build an application with APEX, with a nice custom URL. like http:\\domain\pagina1\pagina2\pagina3
    Limitations:
    * We can not use frame
    Actually, We obtained that when we write in a browsers URL domain "the domain" redirect to "http://domain/apex/f?p=600", and that appear in "browser url" but we want to know if is posible to change that without use frames.
    Thanks.

    Interesting Morten states that "You can use Apache with mod_rewrite to set up mapping between REST-style URLs to your Apex pages...", I've seen no working examples of how to do this with Apache because mod_rewrite is very limited in it's ability to process the query string part of the URL, with all the APEX stuff we need to refer to.
    Morten if you are reading this, what's the secret man?

  • Alt codes not showing.

    I bought a new laptop a few months ago with windows 7, and found right away that with firefox, alt codes/symbols are not displayed properly. They work correctly on other browers, but firefox specifically will not render the characters, showing me spaces instead. For example, code number (&)#10077, which normally displays a quotation mark, only appears as a space. On chrome, it renders perfectly. My firefox is up to date. The problem has spanned all of the versions of firefox installed on this computer, with and without addons, and changing the encoding of the page does nothing to remedy it. Is there a way to correct this behaviour in firefox?

    You're quite welcome. As I understand it, once Windows is installed, those fonts no longer serve a purpose. If you need to recover them, you can find them in the '''boot\fonts''' folder of your Windows installation disc.
    When I tested, Firefox no longer had this issue starting with version 13, which is slated for release today (it may take a while until it's available as an update though).
    * [https://wiki.mozilla.org/Features/Release_Tracking#Firefox_13 wiki.mozilla.org/Features/Release_Tracking#Firefox_13]

  • Yahoo is my home page and News, Sports, Business links now shows a few sentences after each main URL link. How do I put it back to show just the URL links?

    Yahoo is my home page and News, Sports, Business categories/links changed and now shows a few sentences after each main URL link/topic. How do I put it back to show just the URL links/topics without having to scroll down and down the page. All the extra sentences after the links causes too much scrolling to view the topics.

    Those steps did not solve my problem. Here is an example of what I see although it's not exact copy/paste. All I want to see are the links but I get all the verbiage after the links
    Firefox 17.0.1 version
    ''' '''Ask Stacy: How Can I Rebuild My Credit?''''''
    Here’s a question familiar to millions of Americans… Stacy, My wife and I recently filed for bankruptcy due to high medical bills we were unable to pay. We purposefully didn’t add our Wells Fargo credit ...
    Money Talks News
    '''Analysis: High stakes for Cuba in Chavez's cancer battle'''
    HAVANA (Reuters) - As Venezuelan President Hugo Chavez recovers in Havana from his fourth cancer operation, Cubans face renewed worries about their economic future if the country's top ally dies or has to step down from office. Cuba has staked its economic well-being on the success - and generosity…
    41 mins agoReuters
    [$$] Playing FICC or Treat With Bank Investors
    '''Playing FICC or Treat With Bank Investors'''
    The Wall Street Journal
    AdChoices
    '''Cybergeddon
    A digital crime thriller from Anthony E. Zuicker, the creator of CSI. Only on Yahoo!
    And here is what Internet Explore shows: All LINKS below
    '''Molten gold signals mining's return to Calif.'s Mother Lode'''
    '''Century-old fight for Budweiser name hits new snag'''
    '''NRA goes silent after Connecticut school shooting'''
    '''.Authorities: Kansas man who killed 2 cops dies'''

  • Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    Is there example code for using Ni488 and PCI-GPIB card in non controller mode?

    cymrieg,
    Your code looks good to me. What is the problem? What happens when it fails? What is the IBSTA value on the controller, and at what point in the code does it stop? What is the IBSTA value on the slave, and at what point does it stop?
    One thing is that you might not want to call IBCLR() in a loop on the device. At the beginning of the program is fine...This will send a clear command to the device and will clear out any LACS and TACS bits that might be set. Also your IBDEV call shouldn't be in a loop.
    Hope this helps, but let me know if you need more information.
    Scott B.
    GPIB Software
    National Instruments

  • [svn] 4595: Fix for - Example code in ObjectProxy ASDoc page is incorrect

    Revision: 4595
    Author: [email protected]
    Date: 2009-01-20 08:11:25 -0800 (Tue, 20 Jan 2009)
    Log Message:
    Fix for - Example code in ObjectProxy ASDoc page is incorrect
    Also modify the build.xml for "ant asdoc"
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-18335
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18335
    Modified Paths:
    flex/sdk/trunk/asdoc/build.xml
    flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectProxy.as

    >
    build url like this,
    '<a href=f?p='||NV('APP_ID')||':45:'||V('APP_SESSION')||'::NO:RP,45,CIR:ub_branch,ub_supplier,ub_customer,ub_product,ub_aging,ub_destination:'||REPLACE(branch,' ','%20')||'%2C'||REPLACE(ub_supplier,' ','%20')||'%2C'||REPLACE(ub_customer,' ','%20')||'%2C'||REPLACE(ub_product,' ','%20')||'%2C'||REPLACE(ub_aging,' ','%20')||'%2C'||REPLACE(ub_destination,' ','%20') ||'>All</a>',All of this is handled by the apex_util.url_encode API function as described above.
    However, as also mentioned above, the best approach is to only pass discrete key values in URLs.

  • Asking for example code (RFComm Bluetooth Application)

    hello there, i almost give up on finding a way to connect a client application using widcomm sdk on pc to server application using jsr82 j2me on mobile ph0ne ...
    anybody can give me an example code for connecting both of them ...
    if u can, or have some advice for me please give me that valueable thing...
    my recent not working application :
    - server deployed on mobile phone using jsr82 j2me
    - client on pc using widcomm sdk visual c++ .net
    or may be u can correct and give me advice for my code bellow...
    Server (JSR82) :
    private static final UUID APP_UUID = new UUID("F0E0D0C0B0A000908070605040302010", false);
    private static final String URL = "btspp://localhost:"+APP_UUID+";name=My App;authorize=false";
    private static final String APP_ID = "My App";
    private static final int ATTR_ID = 0x1234;
    try {
    localDevice = LocalDevice.getLocalDevice();
    localDevice.setDiscoverable(DiscoveryAgent.GIAC);
    notifier = (StreamConnectionNotifier)Connector.open(URL);
    DataElement base = new DataElement(DataElement.STRING, APP_ID);
    record = localDevice.getRecord(notifier);
    record.setAttributeValue(ATTR_ID, base);
    connection = notifier.acceptAndOpen();
    catch(Exception e) {
    System.err.println(e.getMessage());
    Client (Widcomm SDK) :
    StartDiscovery(m_BdAddr, m_pServiceGuid)CSdpDiscoveryRec Sdp_Record;
    if ( ReadDiscoveryRecords(m_BdAddr, 1, &Sdp_Record, m_pServiceGuid) )
    UINT8 scn;
    SDP_DISC_ATTTR_VAL *pVal;
    if ( Sdp_Record.FindRFCommScn(&scn) )
    //if(Sdp_Record.FindAttribute(0x1234, pVal))
    I can't find an RFComm channel number from server (the j2me one)
    regards, Arch_Cancer
    // sorry my bad english
    Edited by: Arch_Cancer on Jun 20, 2008 12:03 AM

    Still looking for solutions. Looks like many Z-W88 users are having trouble with iPhone only. Assistant does not ask for pairing code, just ask confirmation of a six digit number or Bluetooth device.
    Also this problem is more common on recent iOS versions.
    There is not info about how to force iPhone to ask for pairing code, and support at stores have no idea how to make it work either, so I'm kind of stuck with this.
    If anyone have any ideas I'm open to them...
    Thanks :)

Maybe you are looking for