How do I ping a URL in Java?

All I wanna do it ping a URL. Can I do it? Like, have the user input a URL, then make the URL object, then ping it, then display the results. Can I do this?

do you mean 'ping' in the traditional sense of computers finding the time delay in communication between them? Or do you really just wanna find out if theres a server listening on a certain URL/port? The only way I know how to find a time delay is to make a client/server so you'd have to have access to both machines, or perhaps use the ping protocol but I believe that is limited to Unix boxes? Or if you'd rather just findout if there's a server listening at a particular URL you can just create a Socket for the url/host and if it throws an exception you know theres nothing listening on the other side.

Similar Messages

  • How to know the logout url in Java PDK

    Is there any method that can give us the logout url of SSO using java PDK?
    Thanks in advance,
    Tony Cruz

    Thank you for the replies. But what i really want to do is a login portlet that can show me a link to logout, and i want to use this portlet in all projects that my company is in, so the code of this portlet must be 100% dinamic, this means that i do not have to know the database schema/passwords, where database is, etc, i thought there was some method in the JPDK that was able to give the link to logout (this is possible for login) but until now i cannot find it. There is a solution for this using a PL/SQL procedure called wwsec_app_priv.logout that lies in the portal schema, this procedure works but i'm not able to redirect the browser to the url i want after logout (in the documentation they say its possible and that there is a parameter called p_done_url that can do this, but in the procedure signature this parameter its not implemented) so right now i'm stucked in this one, and im not sure if i can use the 100% dynamic approach with good results.
    Thanks

  • How to get SEO url in java

    Hi
    My requirement is to generate a product feed which has its product url as one of the fields.
    Now does anybody know how to get the SEO url of a product in a java file.
    I know form front end we generate it via ItemLinkDroplet.
    But is there a way i can generate it in my java class?
    Thanks

    Assuming you have used ATG SEO Repository and ATG DirectUrlTemplate and IndirectUrlTemplate etc..for SEO URL generation.
    Now, create a standalone jsp, example, seolinkbuilder.jsp.
    Let it take following parameters,
    productId
    categoryId
    brandId
    siteId
    and any other ids as needed by your application.
    Suppose you just needed SEO url for a given product id.
    /contextpath/seolinkbuilder.jsp?productId=12345
    The JSP would contain a droplet which would construct a SEO url and set it as oparam which can be written to JSP.
    Finally, from an independent JAVA program, using Apache HTTPClient API, call seolunkbuilder.jsp by passing productId. Read the response for SEO url.
    Let me know if you have further questions.

  • How to validate a url in java script

    Hi to all.
    can any one send me the code to validate a url in java script
    thanks in advance

    How about Google? There are several JavaScript code samples available on the web.
    xH4x0r

  • Using URL in Java to send sms ( Intelligent IP Monitoring )

    hi all
    i have created a IP monitoring where in case of faulty it will send sms based on the error that has been caused in they system, i used this code before but did not responded
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.UnknownHostException;
    import java.util.Vector;
    import java.util.concurrent.TimeUnit;
    import java.util.logging.Level;
    import java.util.logging.Logger;
      public void run() {
        try {
          while (go) {
            str = logs.getText();
            logs.setText(str + System.getProperty("line.separator") + name + " Start Pinging .... ");
            boolean reachable=false;
            try {
                InetAddress address = InetAddress.getByName(name);
                reachable =address.isReachable(3000);
                if (address.isReachable(3000) == false) {
                    str = logs.getText();
                    logs.setText(str + System.getProperty("line.separator") + name + " : Time Out ... ");
                    for(int i = 0 ; i < phonenumbers.size() ; i++){
                        try {
                            URL u = new URL("https://myaccount.dialnow.com/clx/sendsms.php?username= xxxxxxx&#8203; &#8203;&" +
                                    "password= xxxxxxx&#8203;&from= xxxxxxx&#8203;&to=" +
                                    phonenumbers.get(i) + "&text="
                                    + name + ":TimeOut...");
                            URLConnection uc = u.openConnection();
                        } catch (IOException ex) {
                            Logger.getLogger(menu.class.getName()).log(Level.SEVERE, null, ex);
            } catch (UnknownHostException e){
                str = logs.getText();
                logs.setText(str + System.getProperty("line.separator") + name + " : Unable to Lookup ... ");
                for(int i = 0 ; i < phonenumbers.size() ; i++){
                    try {
                        URL u = new URL("https://myaccount.dialnow.com/clx/sendsms.php?username= xxxxxxx&#8203; &#8203;&" +
                                "password= xxxxxxx&#8203;&from= xxxxxxx&#8203;&to=" +
                                phonenumbers.get(i) + "&text="
                                + name + ":Unable to Lookup...");
                        URLConnection uc = u.openConnection();
                    } catch (IOException ex) {
                        Logger.getLogger(menu.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException e){
                str = logs.getText();
                logs.setText(str + System.getProperty("line.separator") + name + " : Unable to Reach ... ");
                for(int i = 0 ; i < phonenumbers.size() ; i++){
                    try {
                        URL u = new URL("https://myaccount.dialnow.com/clx/sendsms.php?username= xxxxxxx&#8203; &#8203;&" +
                                "password= xxxxxxx&#8203;&from= xxxxxxx&#8203;&to=" +
                                phonenumbers.get(i) + "&text="
                                + name + ":Unable to Reach...");
                        URLConnection uc = u.openConnection();
                    } catch (IOException ex) {
                        Logger.getLogger(menu.class.getName()).log(Level.SEVERE, null, ex);
            } catch(Exception e1){
                str = logs.getText();
                logs.setText(str + System.getProperty("line.separator") + name + " : Exception Error ... ");
                for(int i = 0 ; i < phonenumbers.size() ; i++){
                    try {
                        URL u = new URL("https://myaccount.dialnow.com/clx/sendsms.php?username=xxxxxxx&#8203;&" +
                                "password= xxxxxxx&#8203;&from= xxxxxxx&#8203;&to=" +
                                phonenumbers.get(i) + "&text="
                                + name + ":Exception Error...");
                        URLConnection uc = u.openConnection();
                    } catch (IOException ex) {
                        Logger.getLogger(menu.class.getName()).log(Level.SEVERE, null, ex);
            TimeUnit.SECONDS.sleep(10);
        } catch (InterruptedException e) {
          System.out.println(name + "Interrupted");
        System.out.println(name + " exiting.");
    }the system dose not give error but it dose not send sms either i found out that it was cus of the url and the gateway that iw as using so i found a new gatway which is in malaysia ( thats where im implementing my system) and this is how the new source code looks like for the URL
      URL u = new URL("http://www.bulksms2u.com/websmsapi/ISendSMS.aspx?username=xxxxx" +
                                 "&password=xxxxx&message" + name + ":Unable to Lookup..." + "&mobile="
                                 + phonenumbers.get(i) + "&sender=IP-Admin&type=1");
                        URLConnection uc = u.openConnection();i have replaced it with the old one which it was
    URL u = new URL("https://myaccount.dialnow.com/clx/sendsms.php?username= xxxxxxx&#8203; &#8203;&" +
                                    "password= xxxxxxx&#8203;&from= xxxxxxx&#8203;&to=" +
                                    phonenumbers.get(i) + "&text="
                                    + name + ":TimeOut...");this new url works i have tried it using direct url into a explorer and the sms has been sent but this way it dose not work
    dose any one have any clue what should i do to get respond for sending this sms?

    soudshoja wrote:
    i tried applying it directly into browser did not work, I thought you said it did work. The reason is that browser a lot of the time will apply URL encoding on things manually entered.
    and about ( URL encode the parameter values before concatenating them into the URL. ) i dont get what u mean can you be specific?Check java.net.URLEncoder Only specific characters are allowed in a URL, other characters need to be encoded/escaped using a process called URL encoding

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

  • How to change object background color on  java run time

    Hi,
    I create object loading program. my problem is run time i change object background color using color picker. i select any one color of color picker than submit. The selecting color not assign object background.
    pls help me? How to run time change object background color?
    here follwing code
    import com.sun.j3d.loaders.objectfile.ObjectFile;
    import com.sun.j3d.loaders.ParsingErrorException;
    import com.sun.j3d.loaders.IncorrectFormatException;
    import com.sun.j3d.loaders.Scene;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import javax.vecmath.*;
    import java.io.*;
    import com.sun.j3d.utils.behaviors.vp.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.Graphics ;
    import javax.swing.*;
    public class ObjLoad1 extends Applet implements ActionListener
    private boolean spin = false;
    private boolean noTriangulate = false;
    private boolean noStripify = false;
    private double creaseAngle = 60.0;
    private URL filename = null;
    private SimpleUniverse u;
    private BoundingSphere bounds;
    private Panel cardPanel;
    private Button Tit,sub;
    private CardLayout ourLayout;
    private BorderLayout bl;
    Background bgNode;
    BranchGroup objRoot;
    List thelist;
    Label l1;
    public BranchGroup createSceneGraph()
    BranchGroup objRoot = new BranchGroup();
    TransformGroup objScale = new TransformGroup();
    Transform3D t3d = new Transform3D();
    t3d.setScale(0.7);
    objScale.setTransform(t3d);
    objRoot.addChild(objScale);
    TransformGroup objTrans = new TransformGroup();
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    objScale.addChild(objTrans);
    int flags = ObjectFile.RESIZE;
    if (!noTriangulate) flags |= ObjectFile.TRIANGULATE;
    if (!noStripify) flags |= ObjectFile.STRIPIFY;
    ObjectFile f = new ObjectFile(flags,(float)(creaseAngle * Math.PI / 180.0));
    Scene s = null;
         try {
              s = f.load(filename);
         catch (FileNotFoundException e) {
         System.err.println(e);
         System.exit(1);
         catch (ParsingErrorException e) {
         System.err.println(e);
         System.exit(1);
         catch (IncorrectFormatException e) {
         System.err.println(e);
         System.exit(1);
         objTrans.addChild(s.getSceneGroup());
         bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
    if (spin) {
         Transform3D yAxis = new Transform3D();
         Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,0,0,4000,0,0,0,0,0);
         RotationInterpolator rotator = new RotationInterpolator(rotationAlpha,objTrans,yAxis,0.0f,(float) Math.PI*2.0f);
         rotator.setSchedulingBounds(bounds);
         objTrans.addChild(rotator);
    //Background color setting
    Color3f bgColor = new Color3f(100,200,230);
    bgNode = new Background(bgColor);
    bgNode.setApplicationBounds(bounds);
    objRoot.addChild(bgNode);
    return objRoot;
    private void usage()
    System.out.println("Usage: java ObjLoad1 [-s] [-n] [-t] [-c degrees] <.obj file>");
    System.out.println("-s Spin (no user interaction)");
    System.out.println("-n No triangulation");
    System.out.println("-t No stripification");
    System.out.println("-c Set crease angle for normal generation (default is 60 without");
    System.out.println("smoothing group info, otherwise 180 within smoothing groups)");
    System.exit(0);
    } // End of usage
    public void init() {
    if (filename == null) {
    try {
    URL path = getCodeBase();
    filename = new URL(path.toString() + "./galleon.obj");
    catch (MalformedURLException e) {
         System.err.println(e);
         System.exit(1);
         //setLayout(new BorderLayout());
         //setLayout(new GridLayout(5,0));
         //setLayout(new CardLayout());
         //setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
    Canvas3D c = new Canvas3D(config);
    add(c);
    BranchGroup scene = createSceneGraph();
    u = new SimpleUniverse(c);
    ViewingPlatform viewingPlatform = u.getViewingPlatform();
    PlatformGeometry pg = new PlatformGeometry();
    Color3f ambientColor = new Color3f(45,27,15);
    AmbientLight ambientLightNode = new AmbientLight(ambientColor);
    ambientLightNode.setInfluencingBounds(bounds);
    pg.addChild(ambientLightNode);
    Color3f light1Color = new Color3f(111,222,222);
    Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
    Color3f light2Color = new Color3f(1.0f, 1.0f, 1.0f);
    Vector3f light2Direction = new Vector3f(-1.0f, -1.0f, -1.0f);
    DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
    light1.setInfluencingBounds(bounds);
    pg.addChild(light1);
    DirectionalLight light2 = new DirectionalLight(light2Color, light2Direction);
    light2.setInfluencingBounds(bounds);
    pg.addChild(light2);
    viewingPlatform.setPlatformGeometry(pg);
    viewingPlatform.setNominalViewingTransform();
    if (!spin) {
    OrbitBehavior orbit = new OrbitBehavior(c,OrbitBehavior.REVERSE_ALL);
    BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), 100.0);
    orbit.setSchedulingBounds(bounds);
    viewingPlatform.setViewPlatformBehavior(orbit);     
    u.addBranchGraph(scene);
         public ObjLoad1(String[] args) {
              if (args.length != 0) {
                   for (int i = 0 ; i < args.length ; i++) {
                        if (args.startsWith("-")) {
                             if (args[i].equals("-s")) {
                                  spin = true;
                             } else if (args[i].equals("-n")) {
                                  noTriangulate = true;
                             } else if (args[i].equals("-t")) {
                                  noStripify = true;
                             } else if (args[i].equals("-c")) {
                                  if (i < args.length - 1) {
                                       creaseAngle = (new Double(args[++i])).doubleValue();
                                  } else usage();
                             } else {
                                  usage();
                        } else {
                             try {
                                  if ((args[i].indexOf("file:") == 0) ||
                                            (args[i].indexOf("http") == 0)) {
                                       filename = new URL(args[i]);
                                  else if (args[i].charAt(0) != '/') {
                                       filename = new URL("file:./" + args[i]);
                                  else {
                                       filename = new URL("file:" + args[i]);
                             catch (MalformedURLException e) {
                                  System.err.println(e);
                                  System.exit(1);
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == Tit)
    //Color Picker tool
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              cardPanel.setBackground(c1);
              objRoot.removeChild(bgNode);
              int a = c1.getRed();
              int b = c1.getBlue();
              int c = c1.getBlue();
              System.out.println(a);
              System.out.println(b);
              System.out.println(c);
              Color3f ccc = new Color3f(a,b,c);
              bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
         else
              System.out.println("mathi");
    public ObjLoad1()
    Tit = new Button("BG Color");
    sub = new Button("Object Color");
    cardPanel = new Panel();
    cardPanel.add(Tit);
    cardPanel.add(sub);
    //cardPanel.add(l1);
    //cardPanel.add(thelist);
    sub.addActionListener(this);
    Tit.addActionListener(this);
    // thelist.addActionListener(this);
    //setLayout for applet to be BorderLayout
    this.setLayout(new BorderLayout());
    //button Panel goes South, card panels go Center
    this.add(cardPanel, BorderLayout.SOUTH);
    //this.add(cardPanel, BorderLayout.CENTER);     
    this.setVisible(true);
    public void destroy() {
    public static void main(String[] args) {
         new MainFrame(new ObjLoad1(args),400, 400);

    hi,
    i am using setColor(Color3f color) method
    like
    if (e.getSource() == Tit)
              Color c1 = JColorChooser.showDialog(((Component)e.getSource()).getParent(),"Zaxis Color Picker", Color.blue);
              bgColor = new Color3f(c1);
              System.out.println(bgColor.get());
         bgNode.setColor(bgColor);
         bgNode.setApplicationBounds(bounds);
         objRoot.addChild(bgNode);
    but error will be displayed
    like
    javax.media.j3d.CapabilityNotSetException: Background: no capability to set color
         at javax.media.j3d.Background.setColor(Background.java:307)
         at ObjLoad1.actionPerformed(ObjLoad1.java:230)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    pls help me

  • How can i execute Spaces API in java main class?

    Hi
    I am able to execute Spaces API through portal application. However if i try to execute it in java main class, its throwing an exception
    "SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)"
    oracle.wsm.common.sdk.WSMException: WSM-00145 : Keystore location or path can not be null or empty; it must be configured through JPS configuration or policy configuration override.
    How can i set this path, so that i can execute Spaces API from java main class.
    Need this main class to configure in cron job, to schedule a task.
    Regards
    Raj

    Hi Daniel
    Currently i have implemented create functionality in my portal application using Spaces API, which is working fine. Now the requirement is, i need to implement a "Cron Job" to schedule a task, which will execute to create space(for example once in a week). Cron job will execute only the main method. So I have created java main class, in which I have used Spaces API to perform create space operation. Then it was giving exception.
    Later I understood the reason, as I am executing the Space API with a simple JSE client, its failing since a simple java program has no idea of default-keystore.jks, jps-config.xml, Security Policy. Hence i have included those details in main class. Now I am getting new error,
    SEVERE: WSM-06303 The method "registerListener" was not called with required permission "oracle.wsm.policyaccess"
    For your reference i have attached the code below, please help. How can i use Spaces API in java main method(i mean public static void main(String[] args) by giving all required information.
        public static void main(String[] args) throws InstantiationException,
                                                      GroupSpaceWSException,
                                                      SpacesException {
            Class2 class2 = new Class2();
            GroupSpaceWSContext context = new GroupSpaceWSContext();
            FactoryFinder.init(null);
            context.setEndPoint("http://10.161.226.30/webcenter/SpacesWebService");
            context.setSamlIssuerName("www.oracle.com");
            context.setRecipientKeyAlias("orakey");
            Properties systemProps = System.getProperties();
            systemProps.put("java.security.policy","oracle/wss11_saml_or_username_token_with_message_protection_client_policy");
            systemProps.put("javax.net.ssl.trustStore","C:\\Oracle\\Middleware11.1.7\\wlserver_10.3\\server\\lib\\cacerts.jks");
    systemProps.put("oracle.security.jps.config","C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
            systemProps.put("javax.net.ssl.keyStore",C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\consumer.jks");
            systemProps.put("javax.net.ssl.keyStorePassword", "Test12");
            System.setProperties(systemProps);
            GroupSpaceWSClient groupSpaceWSClient;
            try {
                groupSpaceWSClient = new GroupSpaceWSClient(context);
                System.out.println("URL: " +
                                   groupSpaceWSClient.getWebCenterSpacesURL());
                //delete the Space
                List<String> groupSpaces = groupSpaceWSClient.getGroupSpaces(null);
                System.out.println("GroupSpaces:: " + groupSpaces.size());
            } catch (Exception e) {
    Regards
    Raj

  • How to Read a CAB File from JAVA?

    Hi,
    Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
    I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
    siva.

    Perhaps there's something in the Cabinet SDK that will help:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

  • How to import a tcl package in Java

    Hi,
    I want to convert an existing tcl file into a java source file. In my existing tcl file, some tcl packages have been imported, using the syntax
    package requires XML
    where "XML" is the name of a tcl package.
    But I am not sure how to import this tcl package in my Java code. Also, how can i call tcl procedures from Java code. The tcl package file contains a set of tcl procedures.
    Please let me know that
    1> How can I import/call a tcl package in a Java code.
    2> How can I call a tcl procedure in a Java code. The tcl procedure is contained in the tcl package file.

    I have searched the url provided by you. But I couldn't find anything relevant to my requirements.
    They have basically explained about how to call a Java program from a tcl code using java::call command
    But they haven't provided anything related to importing tcl package files inside java source.
    Please let me know your opinion on this issue.

  • How applet write in a URL plz.. plz..

    how applet can write in URL
    like this
    URL url = new URL(file://c:/some.mov);
    in this url applet want to write
    for this what i have to do......

    Double post, is allready answerd here:
    http://forum.java.sun.com/thread.jspa?threadID=577956&tstart=0

  • How to configure a JNDI URL resource

    I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.
    CONTEXT.XML
    code:
    <?xml version="1.0" encoding="UTF-8"?><Context> <Resource name="url/wfresource" auth="Container" type="java.net.URL" url="http://localhost:8080/ibi_html/wfresource.properties"/></Context>
    WEB.XML
    code:
    <resource-env-ref>     <description>Object factory for MyBean instances.</description>     <resource-env-ref-name>url/wfresource</resource-env-ref-name>     <resource-env-ref-type>java.net.URL</resource-env-ref-type>     </resource-env-ref>
    JNDI Lookup code snippet
    code:
    //Get a handle to the JNDI environment naming contextContext env = (Context)new InitialContext().lookup("java:comp/env");//Get a single valuejava.net.URL destURL = (java.net.URL)env.lookup("url/wfresource");
    Its throwing an exception.
    My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.
    thanks

    Problem solved in the original thread. If you are trying to do the same be sure to check it out (the SUN documentation is faulty):
    http://swforum.sun.com/jive/thread.jspa?threadID=62965&tstart=0
    I apologize for starting two threads on this.

  • How can I build Instalation Program for java applet?

    I want to build on line internet game based on java applet.
    Uset must instull the game to his computer.And this program mast Connect to the server when user enter
    to this application.Not from explorer,but from my application,like when i enter to ICQ.
    My questions:
    How can i build instalation program in java?
    How can i connect to the server when user enter into my game not from explorer but from game?
    Thanks,Maya.

    Hi Maya
    First of all an Applet does not have to be "installed" as you would with a normal application. The browser handles the install and execution of the applet.
    Check out this URL for more about applets:
    http://web2.java.sun.com/docs/books/tutorial/applet/index.html
    On the subject client/server pairs - see:
    http://web2.java.sun.com/docs/books/tutorial/networking/sockets/index.html
    If you decide to make the game an application instead check out Sun's WebStart - under the products section.
    That's about all the help I can give you.
    Programming a game is a complicated subject - I am doing one too:
    http://hjem.get2net.dk/mhjembaek/armageddon/
    Kind reg,
    Hjembaek

  • How can i display the result of java class in InputText ?

    Hi all,
    How can i get the result of java class to InputText Or OutputText ???
    also can every one in the forum give me road map for dealing with java in oracle adf because i'm beginner in oracle adf
    i saw some samples in oracle adf corner but it's difficult for me.

    User,
    Always mention your JDev version, technologies used and clear usecase description (read through this announcement : https://forums.oracle.com/forums/ann.jspa?annID=56)
    How can i get the result of java class to InputText Or OutputText ???Can you elaborate on your requirement? Do you mean the return value of a method in a class as output text? Or an attribute in your class (bean?) as text field?
    -Arun

  • How to call SAP Webservice in standalone java program

    Hi,
    In our Java application, we want to use the SAP Webservices. I dont know much about authentication mechanism used by SAP. Can any one please help me with any sample code how to Call SAP webservice in Standalone Jave Program. I searched alot on the web regarding this, but helpless. Please help me.
    Thanks,
    Mohan

    Hi Mohan,
    You need an account for the ES Workplace. I'm afraid this is not free, e.g. check [SAP NetWeaver, Composition Subscription|https://www.sdn.sap.com/irj/sdn/subscriptions/composition].
    But I thought you wanted to play with a WSDL [you already had at hand|Sample code to access BAPI Web services from JAVA required;?

Maybe you are looking for

  • FCP 6.0.3 & XDCAM EX-1 - How are xdcam MPEG4 clips processed by FCP

    Greetings, I've been using XDCam Ex-1 clips in FCP for a while now.The FCP Sony XDCam import option is seamless, however now I need to send clients the QT .mov files of the clips for them to use on their systems - both FCP and Avid. I thought these w

  • Is there a way to burn images in a specific project with a certain star rating directly to a disc?

    I want to burn all the one-starred images in a project to a disc, and was wondering if there is a way to do it directly from Aperture, instead of having to export them to a file, and then burn them to the disc.  Also, when I do this, shots from multi

  • How to configure OSPFv3 with VRF in IOS (a guide)

    Hi everybody,      I recently found myself in need of configuring VRF segregated IPv6 routing with OSPFv3 in a pair of IOS 6500s. After a bit of research, I found that although the latest IOS releases for the 6500 (15.1(1)SY for the Sup720 and Sup2T)

  • Dynamic headers in table control

    Hi, How to create dynamic headers in table control headers? I have to replace the header labels with internally computed headers. I have created input fields for headers.. Regards, Krutika

  • How adl lines created when expenditure item is splitted

    We are using Oracle Grants Accounting module that is built on top of Projects. When expenditure item is splitted in Expenditure Inquiry form, there are lines created in pa_expenditure_items_all table and gms_award_distributions(ADL) table. Does anyon