Redirecting to external website from abstract portal component?

Hi,
I have developed an abstract portal component and trying to be redirected to an external website ex : www.google.com
here is the code...
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
HttpServletRequest req = request.getServletRequest();
String queryString = req.getQueryString();
String redirectURL = queryString.substring(queryString.indexOf("=")+1);
HttpServletResponse resp = request.getServletResponse(true);
resp.sendRedirect(redirectURL);
OR
RequestDispatcher rd = req.getRequestDispatcher("www.google.com");
rd.forward(req, resp);
But couldn't able to redirect in either ways ..
exception was ... iView not found: www.google.com.
Any help?
Thanks
MMK

Hi Mohan,
When you do a redirect you need to provide a URL. From javadocs
Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container will convert the relative URL to an absolute URL before sending the response to the client.
Thus when you provide just "www.google.com" the converted complete URL will be something like http://portalserver/irj....www.google.com whcih of course does not exist as a portal component. Thus you get the error iview not found.
Hence you need to give a full URL and not a relative URL.
Akhilesh

Similar Messages

  • Urgent Please help me... How to access BAPIs from abstract portal component

    I am developing an application in Abstract Portal Component (in
    PDK).
    In that application I can able to acess BAPIs from my Componets
    using the code like
    inputPopSearchBapi = new Zad_Bapi_Pop_Search_Form_Input();
    outputPopSearchBapi = new Zad_Bapi_Pop_Search_Form_Output();
    popSearchBapi = new DropBox_PortType();
    colorList = new Tjj12Type_List();
    inputPopSearchBapi.setIm_Agencyid("0010000001");
    try {
    jcoClient.connect();
    outputPopSearchBapi =
    popSearchBapi.zad_Bapi_Pop_Search_Form(inputPopSearchBapi);
    colorList = outputPopSearchBapi.get_as_listIt_Color();
    request.getComponentContext().putValue("color",colorList.iterat
    or());
    jcoClient.disconnect();
    But I am not able to Access the data that is comming from the
    BAPI in my JSP Page. Pleeeeeeease help me. If you want any
    clarification about my problem then ask for further
    clarifications

    Hi,
      You can refer this link, to connecting the BAPI from Abstract Portal Component <a href="http://www.huihoo.org/openweb/jco_api/com/sap/mw/jco/JCO.html">JCo Tutorial1</a>
    <a href="http://www.apentia-forum.de/viewtopic.php?t=1962&sid=9ac1506bdb153c14edaf891300bfde25">JCo Tutorial2</a>
    With Regards,
    Venkatesh. K
    /* Points are Welcome */

  • Problem accessing webservice from abstract portal component

    Hi,
       I have created a webservice from a portal service.  So i have created one more portal application to accessing that web service.  In that, i have done the following:
    -> Portal Service from Wsdl file - Client Side
    -> I have entered the Wsdl file name as, the location of the WebService
    -> I have selected the methods what i want to use in my application
    -> Finally i have given my ServiceName, Alias and Package as well.
    -> I have created one application object (Abstract Portal Component) to access the Web Service.
    -> Inside that AbstractPortalComponent, i have written the coding to access the methods.
    -> I have created one system with System Alias, i used this Alias name in my portalapp.xml
    While running it shows the error as,
                        <b>com.sapportals.portal.prt.service.ServiceException: Service not found: com.sap.portal.prt.soap.Alias</b>
    Help me in this, Thanks in Advance.,
    With Regards,
    Venkatesh.K.

    Hi venkatesh I ahve similar problem please could you share with us how did you sort out this error?
    Sreekanth

  • Accessing portal service from abstract portal component

    Hi
    I have created a portal service where it contains getdata() and putdata(String) methods.
    I have created a abstract portal component and trying to access the portal service from this component.
    In portalapp.xml file of the portal component i have created the sharing reference and i have given the service name.
    When i run the component it says service not found.
    Please let me know if i have missed some things
    Thanks and Regards
    NagaKishore

    Hi Prakash
    Sorry for the latereply.
    find below the code for the interface
    package com.sap.global;
    import com.sapportals.portal.prt.service.IService;
    public interface IGlobalContext extends IService
        public static final String KEY = "IGlobalContext.GlobalContext";
        public void putData(String strUserID,String strSessionID);
        public String getData();
    portalapp.xml file of the portal service.
    <application>
      <application-config/>
      <components/>
      <services>
        <service name="GlobalContext">
          <service-config>
            <property name="className" value="com.sap.global.GlobalContext"/>
            <property name="startup" value="true"/>
          </service-config>
          <service-profile>
            <property name="Test" value="true"/>
          </service-profile>
        </service>
      </services>
    </application>
    I am doing the following steps to access the portal service in the abstract portal component.
    1. Add the portal service to the java build path of the abstract portal component.
    2. do content method has the following code.
    String userid ="",sessionid="";
              response.write("Welcome");
              try
              IUserContext uc= request.getUser();
              userid = uc.getLogonUid();
              sessionid = request.getServletRequest().getSession().toString();
              response.write("Iview "+userid);
              IGlobalContext uid = (IGlobalContext)PortalRuntime.getRuntimeResources().getService(IGlobalContext.KEY);
              uid.putData(userid,sessionid);
              response.write(" Response from Service " + uid.getData());
             }catch (Exception e)
                  response.write(e.toString());
    3. portalapp.xml of abstract portal component
    <application>
      <application-config>
        <property name="SharingReference" value="GlobalContext"/>
      </application-config>
      <components>
        <component name="LandingPageComponent">
          <component-config>
            <property name="ClassName" value="com.satyam.landing.LandingPage"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services/>
    </application>
    I am getting the following error.
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : N/A
    Component Name : N/A
    Could not find portal application GlobalContext.
    Exception id: 11:53_08/04/05_0095_1641450
    See the details for the exception ID in the log file
    Thanks in advance
    Regards
    NagaKishore

  • Calling a JSP  from abstract portal component

    hi,
    I have included a JSP in a abstract portal component and on click of submit in 1st JSP i have to show an another JSP.How can i do this???
    Regards
    Sushanth

    When you say submit do you mean HTMLB submit or a normal HTML form submit?  If it's the latter, you just need an action on your form...
    <form action="jspfile2.jsp">

  • IPortalComponentRequest in JSP from Abstract Portal component

    Hi,
    I have an abstract portal component like this:
    import com.sapportals.portal.prt.component.*;import com.sapportals.portal.prt.resource.IResource;public class Nav2 extends AbstractPortalComponent{    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)    {          IResource jspResource = request.getResource(IResource.JSP, "jsp/Nav2.jsp");          response.include(request, jspResource);    }}
    Now in the called JSP, I want to use the request object.
    e.g.
    Hashtable env = new Hashtable();env.put("NavigationPrincipal",request.getUser());
    But, the request object is not available.
    How to I get the same object available here?

    Hi Praveen,
    Thanks for the solution but I get some error when I add
    String theCall = service2.createAbsoluteNavigateClientCall(myNavNode.getName(),IClientNavigationGenerator.SHOW_INPLACE,null,null);
    The code is like this:
    import com.sapportals.portal.prt.component.*;
    import com.sapportals.portal.prt.resource.IResource;
    import java.util.*;
    import com.sapportals.portal.navigation.*;
    import com.sapportals.portal.prt.runtime.*;
    import com.sapportals.portal.prt.session.IUserContext;
    import com.sapportals.portal.prt.util.StringUtils;
    public class Nav2 extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              //IResource jspResource = request.getResource(IResource.JSP, "jsp/Nav2.jsp");
              //response.include(request, jspResource);
              response.write("hello india");
              Hashtable env = new Hashtable();
              env.put("NavigationPrincipal",request.getUser());
              INavigationService service = (INavigationService) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
              INavigationNode myNavNode = service.getNodeByQuickLink(env,"help");
              IClientNavigationGenerator service2 = (IClientNavigationGenerator) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
              String theCall = service2.createAbsoluteNavigateClientCall(myNavNode.getName(),IClientNavigationGenerator.SHOW_INPLACE,null,null);
    Can you please help out on this one?
    Thanks

  • Redirecting from an abstract portal component

    Hi,
    I'm trying to redirect from an abstract portal component to a quicklink. I do it like told in this thread:
    Redirecting to external website from abstract portal component?
    private void redirectUrl(String target, IPortalComponentRequest request) {
      try {
        HttpServletResponse resp = request.getServletResponse(true);
        resp.sendRedirect("../../../../portal/" + target);
      } catch (IOException e) {}
    It works, but the content of my target-URL is still in the Portal-Frame. So I've two time the Portal-Framework-Navigation. Something like this:
    | Welcome         |
    | Welcome         |
    | content         |
    |                 |
    |                 |
    |                 |
    My goal is to redirect the whole page, not only the frame.
    Thanks for any help...
    Regards, Markus

    Perhaps I can do it with
      public void doOnNodeReady(IPortalComponentRequest request){
        request.redirect("http://www.google.de");
    But like in this Tread, it didn't work AbstractPortalComponent and doOnNodeReady

  • Call jspdynpage or Abstract Portal Component from SAPUI5

    Hi,
    I am new to SAPUI5, so might ask basic and dumb questions.
    I am trying to develop an application in sapui5 which should have the functionality to read and write a file to the server. It is different from file upload as the user wont be selecting any file, rather the data in the form should be written to a file in the server on a click of a button. After doing some research I figured out that sapui5 doesn't give an option to read/write a file to the server.
    So, as an alternative I thought of developing a service, an SAP portal application (jspdynpage, WDJ, abstract portal component - or if you can suggest any other app) that can be called from the sapui5 for reading/writing purpose. The data can be received/sent as an xml, and in the sapui5 application I can parse the data and do the needful.
    Now my question is how to call the portal application (that would be a url) without redirecting, and pass the necessary parameter? Sapui5 should just call that url and data should be passed or received as a parameter. I am not sure if OData model call will work, as I am getting an exception. Can you please provide a solution to this?
    Ps: We are on SAP EP 7.3 and would like to stick to SAP apps, and no additional database etc.
    Regards,
    Piyush.

    Hi All,
    I found a way to do that. I created an Abstract Portal Component application that accepts data through url parameters. Used the regular java APIs to read/write files to the server.
    Now the challenge, at least to me, was to call this application from SAPUI5 application. I used ajax call.
    var response = $.ajax ({
         url: "<url>",
         type: "POST"
    Next, will also try to find if I could use any of the models provided by SAPUI5 to call the portal application.
    Note: Make sure both your sapui5 app and the portal application is deployed on the same server, else it wont be able to authenticate (SSO wont work) and you may receive exceptions.
    Regards,
    Piyush.

  • SSO to external website from portal

    We want to do a single sign on to an external website (non-sap). I know for SAP we can do a logontickets. But for non-sap external websites are there ways to do a SSO? Please help.

    please don't cross-post, see SSO to external website from portal
    kr, achim

  • Calling a abstract portal component from portal service

    Hi
    Can i access a abstract portal component from portal service?
    My requirement is i have a method called getsessionID in portal service. My portal service is enabled as a webservice. Who ever consumes my webservice they will call this method.
    This method in portal service should call a method in abstract portal component to return the session id of the user.
    is this possible.
    Thanks in advance
    Kishore

    Hi Kishore,
           This is impossible. The AbstractPortalComponent is a servlet and it can only be executed via URL. It is easy to execute the component via url but you have to pass the logon information. Also it will run under a user context that you have specified(while passing the logon information) when calling the url. I think you ought to consider a different approach.
            Prakash Singh

  • Access KeyStoreManager within an Abstract Portal Component

    Hi together,
    we have a X.509 compliant certificate located in the keystore on the j2ee engine.
    The private key is used to create the digital signature on the ticket content.
    We need to transfer user credentials to an external portal. This portal only supports SHA1 with RSA. The key-pair was created with the RSA algorithm.
    The problem is following:
    I need to use an Abstract Portal Component. It is no problem to get all the needed user credentials.
    But i don´t have a clue how to get to the certificate for singing the ticket content with RSA/SHA1.
    I have already read the help on http://help.sap.com/saphelp_nw04/helpdata/en/a4/d0201854fb6a4cb9545892b49d4851/frameset.htm , but it did not work.
    Has anyone of you specialists a solution for this problem?
    If you need more details, don´t hesitate to ask
    Thanks in advance

    Perhaps I can do it with
      public void doOnNodeReady(IPortalComponentRequest request){
        request.redirect("http://www.google.de");
    But like in this Tread, it didn't work AbstractPortalComponent and doOnNodeReady

  • Refreshing a Abstract Portal Component in Specific Intervals

    Hi All,
    I have developed an Abstract Portal Component which reads Data from an XML File which is stored in KM.
    Requirement :
    I need to REFRESH this iView for every 5 Minutes-Automatically (Just like Websites showing Live Cricket Scores), to read the Updated Data from that XML File. The XML File will be updated every 5 mins.
    If anybody has Idea on this, Please Guide me..
    Thanks in Advance.
    Regards||
    Ashok Kumar M.

    Here are the instructions for Client-Pull method using meta tag
      1. Use META in the HEAD section of your document.
       2. Write HTTP-EQUIV and CONTENT in META to accomplish client-pull.
    Examples
    To reload the document itself:
    HEAD
    META HTTP-EQUIV=REFRESH CONTENT=5
    HEAD
    CONTENT=5 means wait for 5 seconds to reload the page.
    To load visitors to another page:
    CONTENT=5 means wait for 5 seconds to reload the page.
    To load visitors to another page:
    HEAD
    META HTTP-EQUIV=REFRESH CONTENT="5;URL=http://mbiz.co.th/tips_tricks/"
    HEAD
    URL=...... This is the URL of the page you want to load a visitor to.
    using java script window location you can refresh the page
    like window location equals your location
    and call the method which contains window location in body onload
    Edited by: Supraja Koganti on Nov 17, 2008 10:08 AM

  • Event Handling in Abstract Portal Component

    Hi Friends,
    I am using HTMLB Classlib in an Abstract Portal Component to develop a Dropdownlistbox. Now I want to handle the event of change of selection in this dropdown. However, this event is not getting captured. Sample code is as follows:
    public class dropdownsimple extends AbstractPortalComponent
                           public void onClick(Event event)
                           public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
                                                    IPageContext myContext1 = PageContextFactory.createPageContext(request, response);
              Form myForm = myContext1.createFormDocument("CRMForm");
              GridLayout myGrid = new GridLayout();
              DropdownListBox drp = new DropdownListBox("drp");
              drp.addItem("Key 1","Item 1");
              drp.addItem("Key 2","Item 2");
              drp.setOnSelect("onClick");
                                                     myGrid.addComponent(1, 1, drp);
              myForm.addComponent(myGrid);
              myContext1.render();
    I am able to see the dropdown box along with values when I preview the PAR iView created from this component. Please let me know how to capture the event of change of selection in the dropdown?
    Edited by: Shetul Chothani on Jun 21, 2011 6:37 AM

    Hi,
    Change this line
    drp.setOnSelect("onClick");
    to
    drp.setOnSelect("click");
    and leave the line
    public void onClick(Event event)
    as it is, and it should work just fine.
    I.e., if you name your event "fooBar", the event handler should be named "onFooBar"
    Cheers,
    Robin

  • Difference between Abstract portal Component and JSPDyn page.

    Hi Experts,
    What is the difference between Abstract portal Component and JSPDyn page.
    Thanks,
    Jay.

    Hi,
    The PDK provides two methods for creating a portal component:
    Abstract Portal Component
    The Abstract Portal Component class offers a lean method for writing HTML commands to the Web client as well as for basic event handling. It is an implementation of the IPortalComponent, which is the central abstraction of the Portal Component API.
    DynPage
    The Page Processor Component, which extends the Abstract Portal Component, returns a DynPage. It provides more sophisticated event handling. Controls that produce events (such as buttons and checkboxes) have an event attribute that contains the name of the event handling method. This event handling method is invoked by the DynPage when it occurs.
    The JSPDynPage is an implementation of the DynPage and allows the use of the DynPage in combination with JSP (Java Server Pages).
    The PDK documentation and examples focus on the DynPage. Easier event handling and the separatation of content development (JSP) from application development (Java) make the DynPage a better choice for components with interaction and changing content.
    For more details, Refer thes thread,
    https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.basic.portalcomponentimplementation/docs/jspdynpage.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0b3e9d5-b2af-2a10-20ba-9f6ce6b1a27f
    Hop it helps..
    GS
    Edited by: Sathishkumar GS on Apr 14, 2008 2:07 PM

  • Abstract Portal component - KM Html

    Hi,
    We are developing an external facing portal wherein the Home page has 6 components. In that 5 components are static components which refer to the HTML file in the KM repository. For that I have made KM document iview and given the path of the HTML file.
    But as it is an internet page and as its loading time should be less, we planned to make each component as an abstract portal component which refers the HTML file in the KM and displays the same.
    Can somebody tell me as to go about it?
    Thanks & Regards,
    Ganesh N

    solved

Maybe you are looking for

  • I have a solution (albiet time consuming) to iTunes match step 3 crashing

    So I've been a iTunes Match subscriber for about 6 months. At first it took me a few goes of it to get it down to about only 350 songs needing to be uploaded in Step 3.... Then the REAL frustration began.... From that point forward no matter what I t

  • How to add a field in a standard alv report and to display in result list

    hi gurus, i need to add field in selectio-screen. i need to validate the field with existing fields. i need to add this in alv grid output list dynamically. thanks & regards, kgn9.

  • Maximize report at run time

    hi every body please any body tell me when i run report it will not display on full screen user maximize report to see all page data by mouse click i want when user run report the report maximize automaticaly thanks is advance allaha hafiz

  • Wrong PDF on Security Alerts Page

    On the Security Alerts page (http://otn.oracle.com/deploy/security/alerts.htm) there is a link next to "Buffer Overflow Vulnerability in Oracle9iAS Reports Server Alert #35, 05 June 2002" which links to a document called http://otn.oracle.com/deploy/

  • Ipod will not reset

    my ipod will not reset i've held donw the menu and select buttons to get the apple logo however it does not reset it states for me to go to the web site for support www.apple.com/support/ipod. Also, it does not recognized the ipod on the computer whe