Get Gateway name / url via JSP

Anyone say what is the method to get the Gateway name / url via JSP?
Thanks
Fausto

Alex, in the normal case you have reason the client host is the gateway host.
A simple code:
<%
InetAddress inet = InetAddress.getByName( request.getRemoteHost() );
String gateway = inet.getHostName();
String portal="http://" + gateway + "/portal/dt";
gateway="https://" + gateway + "/";
String url=request.getParameter("url");
if ( url != null) {
response.sendRedirect(gateway + url);;
}else{
responde.sendRedirect(gateway + portal);
%>
I put a jsp in the web container, I contact the jsp trough an url
http://www.mydomain/portal/desktop/redirect.jsp without the method get for the url variable, if I call the jsp directly without gateway from my client the gateway variable is my dns hostname and the jsp cannot redirect my in the portal login page
If I take the localhost, it works fine but if a particular case when the gateway and the platform are the same host.
There is not a HTTP enviroment variable to get the gateway name or a simple java method to ask the correct host?
Thank you again
Fausto
http://www.mydomain/portal/desktop/redirect.jsp
i

Similar Messages

  • Get the name of the jsp currently displayed

    Hi,
    how can i get the name of the jsp currently displayed?
    Thanks.

    Yep
    I thought about
    UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot();
    String name = viewRoot.getViewId(); Message was edited by:
    nereidahoxhaj

  • Using gateway'd URLs in JSP custom tag attributes

    Hello,
    I am running Plumtree G6 using a gateway prefix to gateway Javascript from a remote server. I have recently discovered, thanks to people's help on the forum here, that in certain cases, you need to wrap a URL in a pt:url tag in order for Plumtree to recognize it as a URL that has to be gateway'd (i.e. a URL inside of a Javascript function).
    However, I have a custom tag that contains a contextPath attribute. This custom tag then includes other XML files that get included in the final page that is displayed. I am passing this value as my contextPath:
    <mytag:body sessionName="mysession" campusName="SampleCampus" contextPath="<pt:url pt:href='http://localhost:7021/application/scripts' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>"/>
    However, in the resulting content that is created from this custom tag, the contextPath value is still set to <pt:url pt:href=......./>, and not the actual gateway'd URL. I would have thought that Plumtree would have recognized and gateway'd this URL before it got substituted in the custom tag.
    Does anyone have any thoughts on how to get around a problem like this? One thought I had was to get ahold of the gateway URL value and pass that value directly in my contextPath attribute. Is it possible to get that gateway value, or is there a better solution here?
    Thanks again for any help you can provide.

    Chris,
    I added your code, changed the portlet's web service to send a login token for this portlet, and was then getting some ClassNotFoundExceptions related to Axis classes. So, I went and added all of the jar files from the devkit's lib directory (i.e. plumtree\ptedk\5.3\devkit\WEB-INF\lib), recompiled, and those errors went away. But, now I see the following error:
    java.lang.NoSuchFieldError: RPC
         at com.plumtree.remote.prc.soap.QueryInterfaceAPISoapBindingStub.(QueryInterfaceAPISoapBindingStub.java:27)
         at com.plumtree.remote.prc.soap.QueryInterfaceAPIServiceLocator.getQueryInterfaceAPI(QueryInterfaceAPIServiceLocator.java:43)
         at com.plumtree.remote.prc.soap.QueryInterfaceProcedures.(QueryInterfaceProcedures.java:37)
         at com.plumtree.remote.prc.xp.XPRemoteSession.(XPRemoteSession.java:202)
         at com.plumtree.remote.prc.xp.XPRemoteSessionFactory.GetTokenContext(XPRemoteSessionFactory.java:80)
         at com.plumtree.remote.portlet.xp.XPPortletContext.getRemotePortalSession(XPPortletContext.java:261)
         at com.plumtree.remote.portlet.PortletContextWrapper.getRemotePortalSession(PortletContextWrapper.java:45)
         at jsp_servlet._collabrasuite.__riarooms._jspService(__riarooms.java:325)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    I am using version 5.3 of the EDK, and running Plumtree Foundation G6. Have you ever seen an error like this before?
    Thanks again for all of your help.

  • Get full caller URL from JSP

    I have several static Web pages calling a JSP page using IFrame src. Is there a way to get the full URL of calling Web pages within the JSP? Below is an example to illustrate what I have to do. I don't have to call JSP from IFrame src if there is another way to make this work.
    JSP is called from:
    http://somewhere.com/home/
    JSP outputs:
    http://somewhere.com/home/
    JSP is called from:
    http://somewhere.com/work/
    JSP outputs:
    http://somewhere.com/work/

    Each (i)frame spawns a new HTTP request. If you want to do it all in single request, use jsp:include instead of iframe.

  • Get the name and path of the calling JSP

    Hi all,
    I have a code structure like this
    class MyBaseServlet extends HttpServlet{
    doPost(){processRequest();}
    doGet(){processRequest();}
    processRequest(req, resp){}
    myPrivateMethod(req,resp){
    //I want the name of the JSP which invoked the servlet that extends this(MyBaseServlet) here
    class MySerlvet extends MyBaseServlet{
    processRequest(req, resp){}
    I have a JSP which submits in the <FORM> action calls MyServlet. Since MyServlet extends MyBaseServlet, and this has the doPost() and doGet() methods, the control goes here first, and then since MyServlet has overridden the processRequest() method , the control comes here.
    My query isthat, while in MyBaseServlet (either in doPost() or doGet(), say I call myPrivateMethod(), is there any way here, inside myPrivateMethod() to get the name of the JSP which called MyServlet.
    Note:
    The constraint here is that we are not in a position to include any code into either the JSP or MyServlet. I'm running this in a J2EE environment on Websphere.
    Thanks in advance.

    You can use the methods of the HTTPServletRequest class to get the URI/URL info...for example request.getRequestURI() /URL()/ServletPathInfo()
    http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletRequest.html

  • Get the class file name of the JSP page

    Hi
    I'm wondering how I can get the class name associated with the current JSP page...
    I found on this forum how get the name of current JSP page, but it doesn't help me...
    Thanks

    Hi,
    Sometimes I can be really dumb; of course, the solution is to call the getClass() method on the this object, and eventually store the Class object returned in the SessionBean file if it's necessary (in a SessionBean field/property, or in a parameter of a SessionBean's method).
    Sorry for this thread without any interest. :(

  • Generate page URL via pl/sql

    Hi, there is some way to get the page url via pl/sql?
    I need to create a site map and i'm using the WWSBR_ALL_FOLDERS, but the URL_value is all null.

    Bill,
    You would typically get the URL of the page object which contains the portlets. To get to the page you can use the Direct Access URL which is
    http://<hostname>.domain:port/pls/portal/url/page/<page group name>/<page name>
    Thanks,
    Sudi Narasimhan

  • WAD: How-to get query name and pass to URL

    Hi,
    The task: In a BI 7.0 web template - get the technical query name and use that to open a URL in the format http://<MYURL>&DOCUMENTATION=<QUERYNAME>. So:
    1) User clicks an icon
    2) Get technical name of query
    3) Open the documentation for that query using a URL
    How can this be done? Do I have to use the Custom Extension web item and implement a new class using the interface IF_BICS_CONS_WEBITEM_CUST_EXIT? If so, do you have an example of how this can be done? OR even better is there an easier way to accomplish this?
    Thanks in advance,
    Jacob

    Hi Daniel,
    you could get the query name in ABAP code, also. Here is a snippet from the execute method. The Query name should be in l_sx_view at the end.
    best regards
    Arne
    TYPE-POOLS: 
      rrx1.
    DATA:
      l_string TYPE string,
      l_xml TYPE string,
      l_xml_xstring TYPE xstring,
      l_sx_view TYPE rrx1_sx_view,
    * Line Feed, CR
      c_lf TYPE string,
      l_h_lf(2) TYPE x VALUE '0D0A',
      l_r_conv TYPE REF TO cl_abap_conv_in_ce.
    * Get the line feed and carriage return for unicode
      l_r_conv = cl_abap_conv_in_ce=>create( input = l_h_lf ).
      l_r_conv->read( IMPORTING data = c_lf ).
      DATA:
      l_t_data_providers TYPE cl_bics_cons_webitem_util=>tn_t_data_provider,
      l_s_data_providers TYPE cl_bics_cons_webitem_util=>tn_s_data_provider,
      l_r_variable_container TYPE REF TO if_ixml_node.
      CLEAR e_xml.
      TRY.
    *     All data passed to the webitem exit is hold in I_XML using XML.
    *     The XML is UTF-8 encoded. You can convert the UTF-8 xstring
    *     to a simple ABAP string by calling the following method:
    *     ==================================================================
          CALL METHOD cl_bics_cons_webitem_util=>utf8_xstring_2_string
            EXPORTING
              i_utf8_xstring = i_xml
            RECEIVING
              r_string       = l_xml.
    *     The XML includes sections about the used data provider and about the
    *     variable container. The following method parses the XML and
    *     provides the IF_IXML_NODE instances for data providers and for the
    *     variable container.
    *     ==================================================================
          CALL METHOD cl_bics_cons_webitem_util=>parse_xml
            EXPORTING
              i_xml                  = i_xml
            IMPORTING
              e_t_data_providers     = l_t_data_providers
              e_r_variable_container = l_r_variable_container.
    * 01 Get name of first Data Provider
          READ TABLE l_t_data_providers INDEX 1 INTO l_s_data_providers.
          CALL TRANSFORMATION bics_cons_webitem_filter_by_dp
          PARAMETERS dataprovider = l_s_data_providers-name
          SOURCE XML i_xml
          RESULT XML l_xml_xstring.
          CALL METHOD cl_bics_cons_state_converter=>convert_xml
            EXPORTING
              i_xml     = l_xml_xstring
            IMPORTING
              e_sx_view = l_sx_view.

  • While installing CUCM 9.0.1.1000-37 on Vmware Workstation 8.0 m getting default gateway name/address is invalid or gateway is.

    Hi,
    while installing CUCM 9.0.1.1000-37  on Vmware Workstation 8.0 m getting  default gateway name/address is invalid or gateway is not properly configured. Can any1 help me to get out of this issue.
    Want to install  CUCM 9.0 on Vmware Workstation 8.0..

    Er... is there a chance your network is not properly configured? Can you please shed some light on the details of your network?
    By the way, I doubt that CUCM would ever be able to start up in VMWare Workstation.
    G.

  • Getting error when connecting to url via https

    I am connecting to a url via https. Everything seems to work when I open the connnect as follows.
    conn = (HttpsURLConnection)theURL.openConnection();
    //Set the proper connections properties
    conn.setRequestMethod("POST");
    conn.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
    conn.setDoOutput(true);
    conn.setDoInput(true);
    But when I try to send data with the following code:
    StringBuffer sendThis = new StringBuffer();
    sendThis.append( URLEncoder.encode("uid=", "UTF-8") );
    sendThis.append( URLEncoder.encode("This is the UID", "UTF-8") );
    /* PrintWriter pout = new PrintWriter( new OutputStreamWriter( conn.getOutputStream(), "8859_1"), true);
    pout.print (sendThis.toString());
    pout.flush();
    I get an error that says "could not find trusted certificate"
    Could not find trusted certificate
    javax.net.ssl.SSLHandshakeException: Could not find trusted certificate
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(DashoA62
    75)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
    at java.io.OutputStream.write(OutputStream.java:58)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
    (DashoA6275)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:562)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Dash
    oA6275)
    What am I missing ?
    thanks in advance.
    kris.

    You have to make sure that the cert for the CA which signed the server's
    certificate is in your keystore (cacerts) file.
    Check out 'keytool' and the JSSE readme.
    Cheers,
    Billy.

  • Getting this error, need help: No Name Available via DNS

    Hello,
    i was wondering if someone can help me out. i m being getting this error message xserver servermgrd: servermgr_dns: no name available via DNS for 192.168.0.XXX . The server is set up stand alone server, only being use to host Filemaker Pro Databases. i type hostname to see what it show me, it show me fmserver.local. the internal ip assign to it, it is static and the WAN IP is also static.
    any help would be appreciate it.
    thank you
    victor

    if you change your network interface's DNS to point to yourself, then you should add your isp's nameservers to the "fowarders" options in your /etc/named.conf file, so your nameserver, when it can't find a local or cached record to answer the query, can still use your ISPs nameserver to lookup the information...
    Dual G4 colocated xserve   Mac OS X (10.4.2)  

  • Get printer url in jsp

    hi
    how to get the printer url in java/jsp?
    any method to get the printer IP.

    yes i worked out it in that way...
    String url = request.getRequestURL().toString().replaceAll(request.getRequestURI(),"");Is any other good way to do it?
    Edited by: jStanzilaous on May 5, 2008 4:11 AM

  • Get the "original" url of a jsp

    hello,
    i'm developing a web appliacation with tomcat and struts.
    i have actions that i call from html, for example from a link:
    <a herf="editThing.do?id=1">edit the item of "Thing" with identificator 1</a>
    struts performs this action and redirects the browser to a jsp that displays the information getted by the action.
    then, when "i arrive to the jsp" i would like to get the original url of the current jsp page, that is:
    i don't want a url like : http://server:port/webapp/page.jsp
    but the original!! http://server:port/webapp/editThing.do?id=1
    could somebody help me, please?!
    excuse me for my poor english, i'm from Barcelona.

    Have your Action class put a reference to the current URL in the request. For example:
    Action class:
    request.setAttribute("URL", request.getRequestURI());JSP:
    The original URL is: <%=request.getAttribute("URL")%>

  • How to get requested (target) URL from login page jsp.

    Hi,
    How can I get requested (target) URL from within login jsp page where unauthenticated user was redirected.
    IN other words I need to get target URL that user requested before he was redirected to login page.
    In Weblogic there is "j_target_url" session attribute for this purpose.
    Does NetWeaver have analogue?
    Thanks in advance.

    hi Alex,
    NWDS provides Authentication through Pre defined properties,
    We can trap unauthorised user.
    To know more about this,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4ecd6eb1-0301-0010-61bd-a3d6bee102c0
    thank you

  • Get IView URL via PCD

    Hi,
    I've been using getPortalApplicationURL (WDPortalUtils Class) in portal 7.0 to get the URL of an iview using the pcd.
    It does not work in portal 7.3 ! (or any CE portal for that matter) it just returns the pcd itself as result, despite the fact it is not deprecated or anything else.
    Before I open an OSS regarding this issue i wanted to know if there's another way to get the URL via PCD.
    thanks!

    Hi Yoav,
    I tried setting up the EPCF but it isn't working. I can't
    get the iView to open in the central frame. Problem is, i
    can't change the code very much now as this is only a
    content migration from EP5 to EP6 and not a rewrite of the code.
    To get the rid i use:
    RID rid = RID.getRID(request.getParameter("rid"));
    but i don't url-encode it. Which might be the issue.
    However not url-encoding it was not an issue in EP5.
    Thanks,
    Ale

Maybe you are looking for

  • Adding Data Field to Sales Analysis Report

    Does anyone know how to add data fields to Sales Analysis Reports, either in PLD or CR?  On Sales Analysis by Customer, I need to add the total quantities for all items sold for the sales included in the report, excluding negative quantities. Thank y

  • Rman backup errors..

    hi guru's please tell me the answeres..for this what will happen if we re run the Rman backup due to the job failure...will take a new backup from the begining? or will start from the first backup end where it left ? i am deleting some archieved logs

  • VirtualHosts loading blank pages in Mavericks

    I'm having issues loading VirtualHosts I've setup on my iMac, all that they appear to be returning are blank pages. I've tried multiple browsers, flushed my DNS cache, cleared browser cache etc but nothing appears to be fixing this. Here is what my /

  • Nokia n8 adobe reader prob

    Had my nokia n8 2 weeks and downloaded a bus timetable .went to use adobe reader and when it scanned memory the screen goes all blurred when scrolling down but it works when i find the actual file .i have updated my phone using onboard updater

  • ORA-22922: nonexistent LOB value

    hi, we are working With orascle stream in 11.2.0.4 database version. and we use  DML  HANDLER for a table that contain CLOB, in handler procedure, we store or save LCR into  our table MTAB1, that contain a column with anydata type. then we send this