How to get browser URL

Dears
We are working with system with 2 application server IPs and one Real IP (which is able to be accessed through internet)
I would like to know the URL is the user using in order to use his IP to open something else from the system.
Chcking the host name not usesful because if user connect from home using Real IP it return the AS host name which real IP redirct to it.
I need to know how to get the URL of the session from the form or to know whether the user connected using the Real IP or not.
(Oracle forms 10gR2)

I think you can get a URL from/with a PJC (java pluggable component) from/with IHandler interface..
Try this bean.. You have a property with name HOST_URL.. (with some modification you can also read applet parameters).. (I have done this now but I have not jet tested it)....but I thik this should work...
You have also other parameters to get client IP addres and hostname...
package in2.client;
import java.io.PrintStream;
import java.net.InetAddress;
import oracle.forms.handler.IHandler;
import oracle.forms.properties.ID;
import oracle.forms.ui.VBean;
public class ClientInfo extends VBean
  private static final ID CLIENT_IP = ID.registerProperty("CLIENT_IP");
  private static final ID CLIENT_NAME = ID.registerProperty("CLIENT_NAME");
  private static final ID CLIENT_OS = ID.registerProperty("CLIENT_OS");
  private static final ID CLIENT_USER = ID.registerProperty("CLIENT_USER");
  private static final ID HOST_URL = ID.registerProperty("HOST_URL");
  private IHandler mHandler;
  private String hostAddress = "";
  private String hostName = "";
  private String hostOs = "";
  private String hostUser = "";
  private String hostURL = "";
  public ClientInfo()
    try
      System.out.println("+----------------------+");
      System.out.println("+  ClientInfro PJC     +");
      System.out.println("+  Peter Valencic      +");
      System.out.println("+----------------------+");
      System.out.println("+Dat spr: 10.09.2007   +");
      System.out.println("+Dat spr: 04.07.2008   +");
      System.out.println("+Dat spr: 10.07.2008   +");
      System.out.println("+Dat spr: 15.11.2010   +");
      System.out.println("+----------------------+\n");
      this.hostAddress = InetAddress.getLocalHost().getHostAddress();
      this.hostName = InetAddress.getLocalHost().getHostName();
      this.hostOs = System.getProperty("os.name");
      this.hostUser = System.getProperty("user.name");
      System.out.println("Host   adress: " + this.hostAddress);
      System.out.println("Host     name: " + this.hostAddress);
      System.out.println("Host op. syst: " + this.hostOs);
      System.out.println("Host username: " + this.hostUser);
      System.out.println("+----------------------+\n");
    catch (Exception e)
      System.out.println("Napaka pri inicializaciji beana: " + e.toString());
  public void init(IHandler handler)
    super.init(handler);
    this.mHandler = handler;
  public Object getProperty(ID pid)
    if (pid == CLIENT_IP) {
      System.out.println("Client IP: " + this.hostAddress);
      return "" + this.hostAddress;
    if (pid == CLIENT_NAME) {
      System.out.println("Client Name: " + this.hostName);
      return "" + this.hostName;
    if (pid == CLIENT_OS) {
      System.out.println("Client os: " + this.hostOs);
      return "" + this.hostOs;
    if (pid == CLIENT_USER) {
      System.out.println("Clientuser: " + this.hostUser);
      return "" + this.hostUser;
    if (pid == HOST_URL) {
      hostURL = this.mHandler.getApplet().getDocumentBase();
      System.out.println("Host Url: " + this.hostURL);
      return "" + this.hostURL;
    return super.getProperty(pid);
}

Similar Messages

  • How get browser URL from portlet JSR-168?

    I use Oracle Portal. And I have problem.
    How get browser URL from portlet JSR-168?

    Normaly it is
    http://server:port/portletContextRoot
    Did you create the portlet with JDeveloper? When you dpeloy the portlet to your application server, JDeveloper should output the URL of the portlet test page in the deployment output feedback.

  • How to get Target URL

    Hallo,
    In my Dynpage portal application.I use 3 Jsp's.One of the Jsp having a Iframe element.This iframe source is an External HTTP address.In the source tag i have to supply the Results frame as some Iframe name and result-url as my 3rd jsp url,so that i can unpack the XML and process the data.
    All the 3 Jsp's are in /pagelet/ folder.Does anybody know how to get the url for the Jsp inside the pagelet folder.
    Further more pagelet folder is private folder,will it be a problem for the external website to post the result to this private /pagelet/3rd.jsp.
    Example src tag for Iframe
    http://demo.mygraphics.nl/nbgint/NBG_INT_main.asp?action=CHART&datas
    ource=NBGMV&product=INTERNET&size_x=300&size_y=300&result_frame=Results&
    result_url="Here i have to give my 3rd jsp url"&defa
    ult_centre_x=256000&default_centre_y=471000&default_width=0.5

    Hi gaurav,
    You are right,it is Jspdynpage.I have already read about the Urlgenerator that it can generate url's only for components and pages.So i have created 2 components in one PAR but havent tested yet.
    Anyway thanks for your reply.
    I have tested it and it works fine.Here is the code
          try {
              IUrlGeneratorService urlGen = (IUrlGeneratorService) PortalRuntime.getRuntimeResources().getService(IUrlGeneratorService.KEY);
             IPortalUrlGenerator portalGen = null;
                                    ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
                                    if (specUrlGen instanceof IPortalUrlGenerator) {
                                         portalGen = (IPortalUrlGenerator) specUrlGen;
                                         // generate Component Url
                                         try {
                                              String url = null;
                                              url = portalGen.generatePortalComponentUrl(request,"NewUrlProj.NewUrlComp");
                                              HttpServletRequest srq = request.getServletRequest();
                                              String vorUrl = srq.getScheme()"://"srq.getServerName()":"srq.getServerPort();
                                            myBean.setUrl(vorUrl+url);
                                         } catch (NullPointerException e) {
                                              myBean.setErrorMsg("Unexpected Nullpointer. This should not happenend, but it did! Something must have gone wrong :-(");
           catch(Exception e){
              myBean.setErrorMsg(e.getLocalizedMessage());
    Message was edited by: Baskaran Senthivel

  • How to get the URL of an iView using AbstractPortalComponent

    Hi All,
    I need to get the URL of an iView using AbstractPortalComponent using the following code.
    But i am unable to open the URL from the Browser
    This is the following code snippet
    public class AbsClass extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    IPortalComponentURI componentURI = request.createPortalComponentURI();
    componentURI.setContextName("pcd:portal_content/LOG_Viewer/LogViewer");
    String URI=componentURI.toString();
    response.write(URI);
    The output i got from the browser is:
    /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Actual Path: pcd:portal_content/LOG_Viewer/LogViewer
    Output Path: /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Why some extra numerics are embeded in the output path when compare with the Actual Path.
    Can any one send me the modified code and your suggestions, how to achieve this problem.
    Regards
    Phani

    Hi,
    Now i need to get the URL of this component.
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentURI componentURI = request.createPortalComponentURi();
    componentURI.setContextName("com.sap.portal.appintegrator.sap.bwc.Transaction");
    String URI=componentURI.toString();
    response.write(URI);
    I export this component into Portal and i tested with an iView based on this par file, i got the URL in the Preview.
    But when i tried to run this URL by adding the http://<IPADDRESS>:<PORTNO>+URL
    I am facing one AccessDenied Exception for this Object. ( USER/GUEST)
    Is there any security zone, or other Permissions Problem, if so can you plz guide me what are the settings i have to change inorder to resolve this exception
    Regards
    Phani

  • How to get webpage URL with new Safari  V6.0 under OS 10.74

    Now that the URL space of Safari allows searching by key words, and there's no separate Google search box, this poses a problem.  
    Let's say one wishes to search for images of "kendall jenner model".   This will bring you to a Google page of multiple individual images.  BUT unlike prior versions of Safari, no long URL is formed so one cannot repost the URL in a forum.  So now I must use Chrome or browser other than Safari to get the URL of the entire page.  Here are the examples of what one is left with in the URL box:
    •   Old Safari URL (or Chrome):  https://www.google.com/search?q=kendall+jenner+model&hl=en&prmd=imvnsuo&tbm=isch &tbo=u&source=univ&sa=X&ei=1pw3UK63LsmwiQKvxIHoDQ&ved=0CCAQsAQ&biw=1050&bih=639
    •  New Safari URL:  kendall jenner model  (which is useless)
    QUESTIONS:  Using Safari V6.0, how does one get the entire page URL ?    Can the dedicated Google search box at the top be revived so that the proper URL appears in the central top box ?

    Just found the cure for Safari 6.0 under 10.74
    In Safari preferences,  changed the default search engine from Google to Yahoo.  Now whenever, for example, a search is made in Google's images, and other websites, the full URL shows in the address line.
    Now all websites show the full URL, even through they were derived from search words in the URL field.

  • Getting browser URL from form

    Dears,
    I'm running some forms 10gr2, I would like to get the browser URL inside my form. How could I do something like this?
    Thanks in advance.

    Also with PJC bean is possible..
    http://peterv6i.blogspot.com/2012/04/reading-applet-parameters-in-oracle.html
    or
    package in2.client;
    import java.io.PrintStream;
    import java.net.InetAddress;
    import oracle.forms.handler.IHandler;
    import oracle.forms.properties.ID;
    import oracle.forms.ui.VBean;
    public class ClientInfo extends VBean
      private static final ID CLIENT_IP = ID.registerProperty("CLIENT_IP");
      private static final ID CLIENT_NAME = ID.registerProperty("CLIENT_NAME");
      private static final ID CLIENT_OS = ID.registerProperty("CLIENT_OS");
      private static final ID CLIENT_USER = ID.registerProperty("CLIENT_USER");
      private static final ID HOST_URL = ID.registerProperty("HOST_URL");
      private IHandler mHandler;
      private String hostAddress = "";
      private String hostName = "";
      private String hostOs = "";
      private String hostUser = "";
      private String hostURL = "";
      public ClientInfo()
        try
          System.out.println("+----------------------+");
          System.out.println("+  ClientInfro PJC     +");
          System.out.println("+  Peter Valencic      +");
          System.out.println("+----------------------+\n");
          this.hostAddress = InetAddress.getLocalHost().getHostAddress();
          this.hostName    = InetAddress.getLocalHost().getHostName();
          this.hostOs      = System.getProperty("os.name");
          this.hostUser    = System.getProperty("user.name");
          System.out.println("Host   adress: " + this.hostAddress);
          System.out.println("Host     name: " + this.hostAddress);
          System.out.println("Host op. syst: " + this.hostOs);
          System.out.println("Host username: " + this.hostUser);
          System.out.println("+----------------------+\n");
        catch (Exception e)
          System.out.println("Init error: " + e.toString());
      public void init(IHandler handler)
        super.init(handler);
        this.mHandler = handler;
      public Object getProperty(ID pid)
        if (pid == CLIENT_IP) {
          System.out.println("Client IP: " + this.hostAddress);
          return "" + this.hostAddress;
        if (pid == CLIENT_NAME) {
          System.out.println("Client Name: " + this.hostName);
          return "" + this.hostName;
        if (pid == CLIENT_OS) {
          System.out.println("Client os: " + this.hostOs);
          return "" + this.hostOs;
        if (pid == CLIENT_USER) {
          System.out.println("Clientuser: " + this.hostUser);
          return "" + this.hostUser;
        if (pid == HOST_URL) {
          hostURL = this.mHandler.getApplet().getDocumentBase();
          System.out.println("Host Url: " + this.hostURL);
          return "" + this.hostURL;
        return super.getProperty(pid);
    }

  • How to get page URL in a dynamic page in 10.1.4?

    Does anyone know how to get the page URL in a Dynamic Page in 10.1.4 without using javascript.
    I know that you can use a PL/SQL portlet and the portlet_record, but this is specifically for a Dynamic Page.
    Regards
    Jenny

    Hi,
    I am trying the suggested approach in 10.1.4 but unfortunatley I get the following error:
    PLS-00302: component 'SHOW_INTERNAL' must be declared
    In my Dynamic Page I have the following code
    htp.p(cms_context.urlpage);
    In the '... before displaying the page' I have the following
    schema_name.cms_context.urlpage := schema_name.dynamic_page_name.show_internal.p_page_url;
    Can anyone help?
    Cheers
    Chris

  • How to get full url using UCM RIDC api

    Hi,
    I am using RIDC api to get the full url of the document (including protocol, host, port info). I tried using DOC_INFO
    and GET_SEARCH_RESULTS api. The GET_SEARCH_RESULTS api returns the path but no protocol, host, port info.
    DOC_INFO does not contain any uri. Is there a way to get full url? I only have access to the idc socket connection
    configuration to connect to the server.
    E.g. I know the idc connection url is idc://hostname:4444
    The user supplies document name as "myDoc.txt" and dId = 2000.
    I used GET_SEARCH_RESULTS for myDoc.txt and DOC_INFO for dId=2000.
    I need to return absolute url to the user that user can copy paste in the browser and download the doc.
    Thanks,
    --dhiraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You can ge the docUrl using doc info services DOC_INFO or DOC_INFO_BY_NAME.
    dataBinder.putLocal("IdcService", "DOC_INFO");
    dataBinder.putLocal("dID", docId);
    ServiceResponse response = idcClient.sendRequest (idcContext, dataBinder);
    DataBinder respBinder = response.getResponseAsBinder();
    System.out.println("DocUrl"+ respBinder.getLocal("DocUrl"));

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • 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.

  • Get browser url from 11g form?

    Is there any function to get the current url of the browser that the 11g form applet is running in?
    Or at least the server:port part?
    Thanks

    In version 11 you can use javascript to extract the browser url. For example:
    Declare
         JS_in      varchar2(32767);
         rtn     varchar2(1024);
    Begin
         -- JS_in is the javascript funtion you want to call.
         JS_in := 'location.href';
         rtn := WEB.JAVASCRIPT_EVAL_FUNCTION (JS_in);
         -- "rtn" should contain the complete URL as seen in the browser address bar.
         -- Do something with rtn.       
    End;

  • How to get the URL of the request.

    I am trying to get the URL from where the request is coming to the servlet. If http://www.xx.com/ calls my servlet i want to know that the request is coming from http://www.xx.com/ URL. If i use request.getRequestURL() which is displaying my servlet URL. Please help me which is very urgent.

    You actually want the referrer? You can obtain it from the request headers as follows:String referrer = request.getHeader("referer"); // Yes, with the legendaric misspelling in there.Having said that, be aware that the client has full control over what he sends with the request headers. So the client can change/spoof/remove the referrer entry to his taste anytime. Your code should not rely that much on it, it should rather be used for statistics only.

  • How to get the url of a document in content management?

    Hello,
    I have used API  'SKWF_PHIO_CONTENT_URL_GET to get the url of a file in CRM content management. But when I tried to open this url in explorer got error message "SSF error: Decoding not possible". Could any one please help me to resolve this problem.
    Thanks
    Nisha

    Thanks for replying - unfortunately, there is not much
    support on these forums.
    I wish there was some way to emulate the mouse from
    Javascript to click the play, pause, and slider buttons... but one
    would't even know, programmatically, the location on screen of the
    play, pause, and slider buttons.
    quote:
    Originally posted by:
    davexnet
    You'll notice that questions like this don't get answered on
    this
    forum. The Flash player has a philosophy that skews the power
    over almost everything about it to the content providers,
    and precious little control, if at all, to the client player.
    It's a crappy situation - I use Flashblock in Firefox and
    only view the
    content *I* want to see.
    It works for me, particularly since I'm using an older
    (slower )
    computer that really gets bogged down by aggressive Flash
    content.

  • How to get the url of the document in quick parts?

    I have document library in which there is one content type with the document template uploaded. In the footer of the document, I want to show the URL of the document which is opened in word application.
    Is there any way to get the URL? I am not able to see the field in Quick Parts while configuring footer of document template.

    Alexdu_,
    You can create a single line text site column in that content type to hold URL information.
    Create a SPD workflow to populate URL field using update field of current list.
    This custom column will be available as Quick part in word.
    This could be an alternate approach as URL is not available as quick part field.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • How to get current URL from Internet Explorer ?

    Hi,
    I have design an add-on for IE and I'm
    trying to get URL from IE which is currently opened that is which is currently user sees. Is there any way to get it? I want to store that address in label and use it for something useful. Is it possible with C# ?
    I have did the following code to get current URL but it showing last opened URL instead of current URL which is user see
    using SHDocVw;
           SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
                         string filename;
                         foreach (SHDocVw.InternetExplorer ie in shellWindows)
                             filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
                             if (filename.Equals("iexplore"))
                               label1.Text=ie.LocationURL;
                               label1.Text = ie.LocationName;
    and I have tried this one also 
    foreach (InternetExplorer ie innew ShellWindows())
       label1.Text = ie.LocationURL.ToString();
       label2.Text = ie.LocationName.ToString();
    Please give me any suggestion or code to solve this problem.
    Thanks.
    Priyanka

    You already got addon running in the active ie instance. You just need to catch the WindowStateChanged event in every instance so you can write down the last event with OLECMDIDF_WINDOWSTATE_USERVISIBLE somewhere. When you need the active IE instance, just
    pull from your save.
    Note an IE tab may crash and take your addon with it. It is better to start a broker process to store your global data.
    Visual C++ MVP

Maybe you are looking for