How to navigate from a Servlet to a WebDynpro?

Hi together,
I've the following Problem:
On the same EP, there are 2 deployed components:
- a WebDynpro-Application with several Views, each in a separate iView
- a Servlet
Question:
How can i navigate from the Servlet to one special iView or CustomController of the WebDynpro-Application passing a Parameter?
I've tried to navigate using the WDPortalNavigation.navigateAbsolute()-Method, but when I create the Target-Url using the following Code, my Debugger leaves the Code uncontrolled:
deployableObjectPart = WDDeployableObject.getDeployableObjectPart("vendor/App", "webdynproApp",WDDeployableObjectPartType.APPLICATION);
urlToTargetApp =     WDURLGenerator.getApplicationURL(deployableObjectPart);
Some Ideas?
Regard
Thomas

Hi Thomas,
I think you may have to use session concept here.
check with following code
you can use the following code to set value to the parameter.
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpSession session = request.getSession(true);
session.putValue("col_id", <value>);
This code below is used to get parameter value.
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpSession session = request.getSession(true);
String Col_id =(String)session.getValue("col_id");
Let's say the pcd location of the target page is
pcd://portal_content/com.sap.pct/specialist/com.sap.test.pages/com.sap.test.target_pg
In the event handler for the onAction event of the button
String appParams = "ApplicationParameter=<your parameter name>=" + <put your value here>;
WDPortalNavigation.navigateAbsolute(
"ROLES://portal_content/com.sap.pct/specialist/com.sap.test.pages/com.sap.test.target_pg",
WDPortalNavigationMode.SHOW_INPLACE,
WDPortalNavigationHistoryMode.ALLOW_DUPLICATIONS,
appParams,
null,
true,
true);
For more details you check the following URL. it describes on how to navigate from html/servelt to portal iview.
Passing value from page to WD
Reward points if it helps
Regards
Praveen

Similar Messages

  • How to navigate from a view to an IView in portal

    Hi all,
             Onclick of an application in my portal my appliaction gets opened.But the problem here is onclick of cancel in my applcation i want to navigate to my IView in portal.
    For navigation between view2 to view1  i used wdThis.wdFirePlugtoView1();
    by creating a navigation link.
    How to navigate from view1 to Portal IView
    Regards
    Padma N

    Hi padma,
                 Go to Iview Property in portal Content managment and take the PCD location.
    It may look something like this
    ROLES:portal_content/ZABC/ZPROJECTS/com.abc.ZPortfolio/com.abc.ZPortfolio/com.abc.ZRoles/com.abc.ZPortfolioReconle/com.chep.ZReconciliation/com.chep.ZReconEnquiry_IView
    Create a string variable with the PCD location
    String pcdLocation = <pcd location>
    And call using the iview using the following code
    WDPortalNavigation.navigateAbsolute(pcdLocation, WDPortalNavigationMode.SHOW_INPLACE, WDPortalNavigationHistoryMode.NO_DUPLICATIONS,"&reference="+reference);
    Here &reference is the application parameter, if the application with which the iView is created has parameter and is not mandatory.
    Hope this helps.

  • How to write from a servlet to it's war file?

    We need to be able to write a file from a servlet into the document root
              area to it can be accessed by a browser. Before we used war files, we
              would simply figure out the real document root directory and write the
              file somewhere under it. How would I do this when my application is
              packaged as a war? I don't see a way to write to a "xxx.war" file and
              if we run from an exploded war, how do I determine the location of the
              document root at runtime from the servlet? I don't want to have to hard
              code the path or make each installation specifiy it in a properties
              file. It seems there should be a better way to handle this. Any ideas?
              

    Thanks for your help. Not to beat this to death but say I want a response that
              includes a bunch of HTML generated by a servlet or JSP and in the middle I want
              a dynamically created image. So basically I want an <image> tag in the middle
              of the html returned. Could I dynamically generate the image and add it to the
              response in the middle of the servlet/JSP processing? I thought the only option
              would be to return an html page the referred to an image via an <image> tag.
              What do you think?
              Kirk
              Cameron Purdy wrote:
              > Hi Kirk,
              >
              > Yes, you can accomplish all of those things without writing files out.
              > Writing files will severely degrade performance in many cases, and will lead
              > to certain classes of bugs such as those caused by multiple browsers within
              > the same process or rampant use of "back" lists. (That's a long-winded way
              > of saying persistent state on the server that reflects a client's transient
              > state has a way of being wrong, sooner or later.)
              >
              > All you have to do is return a URL that includes the necessary information
              > to get the picture. You do that now by creating a random thingamabob name:
              >
              > http://www.mysite.com/myapp/thisisarandomname12345.jpg
              >
              > Instead of random, try:
              >
              > http://www.mysite.com/myapp/thisisthepictureforemployee-17.jpg
              >
              > The issues are the same (someone trying to guess URLs) but you do have the
              > problem that the URLs are easier to guess because they follow a pattern.
              > You should secure-check each request anyway. (Lots of tricks for making
              > that very efficient, but that is a book in itself.)
              >
              > So what serves up the .jpg? A Servlet!!! It gets the request, builds (or
              > reads from db or whatever) the .jpg image and streams it out. Now you get
              > 3-4 times the performance and a much more orderly arrangement of URLs etc.
              > that can now be "saved" and "bookmarked" etc. Also no congested temp dirs
              > etc.
              >
              > Peace,
              >
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > Tangosol Server: Enabling enterprise application customization
              >
              > "Kirk Everett" <[email protected]> wrote in message
              > news:[email protected]...
              > > What I want to do is one one servlet request generate an image file in the
              > doc
              > > root and then return a page back to the browser that contains an image tag
              > > referring to the generated image file. I also want to be able to generate
              > a file
              > > of data based on a user's posted selections and then present them with a
              > link to
              > > download the file. If I don't write these to disk in the docroot how
              > would I
              > > give the user a link to them? Is there a better way? Thanks for your
              > help.
              > >
              > > Kirk
              > >
              > > Cameron Purdy wrote:
              > >
              > > > Yes, if you have to write a file (either because you expect it to be
              > used
              > > > many times or you wish to assemble a huge (>1mb) response without using
              > > > memory), then do so to a temp or working dir. There is no reason to use
              > the
              > > > doc root at all for that, other than to use FileServlet, which is eaily
              > > > replicated for your own specific purposes. For the most part, there is
              > no
              > > > reason to write the file, since you can write the response back to the
              > > > browser just as easily as to a file.
              > > >
              > > > Peace,
              > > >
              > > > --
              > > > Cameron Purdy
              > > > Tangosol, Inc.
              > > > http://www.tangosol.com
              > > > +1.617.623.5782
              > > > WebLogic Consulting Available
              > > >
              > > > "Kirk Everett" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > I agree that in general this should be avoided but we have two cases
              > where
              > > > we
              > > > > need to write a file to the
              > > > > the document root. The first is we allow the user to generate a file
              > and
              > > > > download it to thier machine. So in
              > > > > one servlet the user selects the data and submits the form. The
              > servlet
              > > > then
              > > > > writes a file to the docroot and
              > > > > the user is then presented a link where they can download the file.
              > The
              > > > second
              > > > > is when we want to generate
              > > > > a chart image in a gif. The servlet writes the image to the docroot
              > and
              > > > another
              > > > > JSP refers to the image in an
              > > > > image tag. In both cases we are using mangled names and we clean up
              > the
              > > > files.
              > > > > Do you have a better solution?
              > > > > Thanks for your help.
              > > > >
              > > > > Cameron Purdy wrote:
              > > > >
              > > > > > Writing to a deployed application is generally a thing to be
              > avoided.
              > > > Among
              > > > > > other things, it is a potential security issue. Apps should be able
              > to
              > > > be
              > > > > > locked down (no OS write access except non-exec temp space). I
              > suggest
              > > > not
              > > > > > doing writes if at all avoidable. What are you trying to
              > accomplish?
              > > > > > Perhaps stream back a big file?
              > > > > >
              > > > > > Peace,
              > > > > >
              > > > > > --
              > > > > > Cameron Purdy
              > > > > > Tangosol, Inc.
              > > > > > http://www.tangosol.com
              > > > > > +1.617.623.5782
              > > > > > WebLogic Consulting Available
              > > > > >
              > > > > > "Kirk Everett" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > We need to be able to write a file from a servlet into the
              > document
              > > > root
              > > > > > > area to it can be accessed by a browser. Before we used war files,
              > we
              > > > > > > would simply figure out the real document root directory and write
              > the
              > > > > > > file somewhere under it. How would I do this when my application
              > is
              > > > > > > packaged as a war? I don't see a way to write to a "xxx.war" file
              > and
              > > > > > > if we run from an exploded war, how do I determine the location of
              > the
              > > > > > > document root at runtime from the servlet? I don't want to have
              > to
              > > > hard
              > > > > > > code the path or make each installation specifiy it in a
              > properties
              > > > > > > file. It seems there should be a better way to handle this. Any
              > > > ideas?
              > > > > > >
              > > > >
              > >
              

  • How to Navigate from af:internalFrame to another page in the parent frame?

    Hi!
    I'm using an ADF IFrame Component <af:internalFrame>..
    we have a requirement where we needed to navigate from a page in the Internal frame to another page in the browser, i.e., on clicking a ceratain button in IFrame , the browser window should load an another page in the main window/frame(not in IFrame). I know this can be done with javascript by setting the
    window.location='newurl'
    But that would take me away from the normal JSF lifecycle, that is I have to perform certain processing of the inputs from the Iframe, and then navigate in the normal JSF way to another page in the main browser window,according to the navigation configured in the faces-config.xml; or if possible, programmatically ,in the backing bean.
    Can someone give me any hint of how to do this?
    Thanking you in advance,
    Samba

    Correct. To achieve this functionality JavaScript is required.
    --Ric                                                                                                                                                                                           

  • How to Navigate from Graph page to Customization page?

    Hi All
    If i need to navigate from Graphs page to customization page on clicking the graph, What are the steps to be followed?
    Also in that customization page i need to make changes in the SQL statement for graph also the type of graph( Pie or Bar).... when i provide this changes it needs to be saved. And when i save it has to provide me the new graph according to the edited SQL Statement...
    How to achieve this?
    Can anyone pls pls help me out in resolving this issue???
    Ganesh

    If i need to navigate from Graphs page to customization page on clicking the graph, What are the steps to be followed? Destination URI
    You can programmatically define a destination URI on a graph, that allows users to drill down to additional information. If the Destination URI property is defined on a graph, the URI specified is used as the drill-down URL. The Destination URI can be an absolute URL or a relative URL to an OA Framework page. The group and series values for each data point are appended to the specified destination URI, so that the resulting URL is specifically associated to a particular data point plotted in the graph. The group and series values can be obtained by the destination page using the parameters OAGgroup and OAGseries.
    For the drill down feature to work, you must also set the Display Data Bubble Text property on the graph to True. Enabling this property generates an image map, which is required for the drill-down feature to work. When a user selects any data point in the graph, the specified URL is launched.
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • How to navigate from view of slave DC to view of matser DC?

    Hello!
    I've got DC1 (master) and DC2 (slave) in different projects. Both projects are WD Java local DC projects. DC2 has one component (say A) with view, window, view interface, controller and controller interface and has no applications. This view should be called at start of application. Only DC1 has application. Public parts created properly so DC2 visible for DC1.
    In main window of DC1 I embedded View Interface from DC2 and make it default. View Interface has outbound plug connected with inbound plug for View of DC1.
    What I should to do to allow user navigate from View Interface of DC2 to view of DC1 by press button placed at view of DC2?
    I'm working with NW7.0.
    Regards, Lev.

    Hi
    What I should to do to allow user navigate from View Interface of DC2 to view of DC1 by press button placed at view of DC2?
    Hi
    One solution will be already provided by  jithin james .
    Apart from that if u want to make something generic (For your case View interface of different Dc) follow this  [Best practices |https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0409d83-5ed5-2910-ef91-e41da6d5b8b4]
    Best Regards
    Satish Kumar

  • How to navigate from custom store to library?

    Is there any way to navigate from custom HTML store or any other web views to either Default Library or Custom Library?

    There is a workaround. If you specify a URL Scheme for your app, creating a link to that scheme displays the library. There is an example of this method in the Advanced Linking article in the DPS Tips app.

  • How to forward from a servlet to a (secured) jsp

    hi all
    actually i am trying to forward a request from a servlet to a jsp which is located in the WEB-INF-directory of the web-app...
    as i read in the docs the path in the getRequestDispatcher-method must start with a "/" so i tried to get a requestDispatcher-object from this path:
    /WEB-INF/secureJSP/abc.jsp...
    but all i get is a FileNotFoundException: no ressource "..." in the servlet context root "..."
    if i put the jsp in the web-app-root (like /abc.jsp) i am able to get a requestDispatcher-object without troubles...
    whats wrong? any ideas?
    tia
    sandro

    Hi
    Let me clarify this for you, Firstly as I said the WEB-INF directory is not accessible to the browser i.e a user couldn't possibly type in http://server-name:port-number/myapp/WEB-INF/test.jsp - This wouldn't work. But what you can do is forward a request to the jsp through a servlet using the RequestDispatcher.
    The RequestDispatcher object can be obtained in two ways. One is from the servletContext and the other is from the request. If it is obtained from the servletContext then the path is interpreted relative to the root of the web application. If it is got from the request without the "/" then the path is interpreted relative to the current request servicing resource.
    In your case get the RequestDispatcher from the ServletContext and provide the path as you have provided - assuming that WEB-INF directory is just below your myapp directory.
    Keep me posted on your progress & sorry for the confusion.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc
    http://www.sun.com/developers/support

  • How to navigate from a component to a specific view in other component

    Hi guys,
    i have an issue in my application where i have two components compA and compB. In defaultview of compA i have a navigationlink and a viewcontainer element which contains three views viewone,view two,view three and In default view of compB we have 3 links where each link should navigate to its corresponding view in the viewcontainer element of compB. The navigation between default of compA and CompB is working fine But prob is with the navigation between the links in the compB view to views in the view container element. can anybody give me some idea on it i am hanging here from somany days. It would be appreciable if anybody solved this problem. Thanks In Advance
    Regards
    Ravikumar Saragadam

    Hi Ravi,
    Check the following links.
    DC reusability in webdynpro
    Passing a value from one dc to another dc in webdynpro
    How to pass a value from one dc to another dc in webdynpro java
    Thanks

  • How to navigate from WD iView to another WD iView

    Hi experts,
    I'm wondering the best way to do a navigation from WD to another one, I've triyed absolute and relative navigation and neither of two works.
    I'll try to explain what am I doing:
    Application A wich is running in a iView needs to call an Application 2 located in another iView (separate WD project too).
    <b>my code looks like this:</b>
    DATA: l_api_component  TYPE REF TO if_wd_component,
            l_portal_manager TYPE REF TO if_wd_portal_integration,
            path             TYPE string,
            path_table       TYPE string_table.
      l_api_component = wd_comp_controller->wd_get_api( ).
      l_portal_manager = l_api_component->get_portal_manager( ).
    path = 'ROLES://portal_content/fl_mjcf_workarea/fl_mjcf_web_site_unimet/fl_mjcf_ivews/fl_mjcf_intranets/fl_mjcf_int_estudiante/iv_mjcf_web_pagos'
    CALL METHOD l_portal_manager->navigate_absolute
        EXPORTING
          navigation_target   = path
          navigation_mode     = if_wd_portal_integration=>co_show_inplace
         window_features     = navigation_data-window_features
         window_name         = navigation_data-window_name
         history_mode        = navigation_data-history_mode
         target_title        = navigation_data-target_title
         context_url         = navigation_data-context_url
         post_parameters     = navigation_data-post_body
          use_sap_launcher    = abap_true
         business_parameters = bus_parameter_table
         launcher_parameters = launcher_parameter_table.
    I don't know what am I doing wrong, but, the application is not showing anything, no error, no message.
    Please any suggestion is really apreciated and of course rewarded.
    Thanks in advance.
    RR.-

    Hi,
    Thanks for your reply I found that the PCD location was wrong, I wasn't copying from the role, that's why the application didn't navigate ritgh. But still havin problems with parameters.
    Do you have any idea? and thanks for your reply.
    Ramien.-

  • How to navigate from one view to another view?

    Hi everyone facing a problem in navigation when i click on the list another view should be appear..
    page1.view.js:-
    list1.onclick=function(evt){
      $.sap.require("sap.ui.core.EventBus");
      var bus=sap.ui.getCore().getEventBus();
      bus.publish("nav","to",{
      id:"idDemoUI2",                       //..id of page2...//
      context:evt.getSource().getBindingContext()
    page2.controller.js:-
    onBeforeRendering: function(evt) {
      if (evt.data.context) {
             this.getView().setBindingContext(evt.data.context);
    i have a list i want when i click one the row of that list another view will appear so i use onclick event on the list and then use bus for navigation and recieving data in the target page but its not working anyone please tell me  where i am wrong.
    Regards
    Kelvin

    Hi Kelvin,
    How about using Routing concept than the getEventBus. Below link should help:
    Step 3: Navigation and Routing - User Interface Add-On for SAP NetWeaver - SAP Library

  • How to Navigate from Confirm Account to Creation of Service Ticket

    Dear Expert,
    My client does not want to create a interaction record after account confirmation. They want to go directly to Service Ticket creation.
    I am using CRM 6.0 SP05.
    Could you guide me through the steps for that?
    Which customizing steps need to be done?
    Thank you very much in advance.
    Best reagrds
    Ahmed Hadi
    Edited by: Ahmed Hadi on Dec 15, 2009 2:43 PM
    Edited by: Ahmed Hadi on Dec 15, 2009 2:44 PM

    Hello Ahmed,
    I discuss the pros and cons of this strategy a bit in my book, "Mazimizing Your SAP CRM Interaction Center", but you can also find the basic info in this blog, "[Everything you need to know about the Interaction Record in the CRM Interaction Center|/people/gert.tackaert/blog/2008/09/04/everything-you-need-to-know-about-the-interaction-record-in-the-crm-interaction-center]".
    There is a BADI (CRM_IC_IARECORD) that can be used to suppress the creation of the Interaction Record. SAP does not recommend to actually supress the creation of the Interaction Record (as it is needed for various out of the box reporting and analytics options, as well as for maintaining object links and other features). Rather, you might want to simply use Intent-Driven Interaction with the Rule Modeler to automatically navigate to the Service Ticket screen after some UI event like BP confirm or IBase confirm (or whatever other even you want). If necessary you could also remove IR link for the NavBar.
    Best regards,
    John

  • How to navigate from webdynpro view to bsp page in the same window?

    hi i want to call a page by its url.
    i am using the "create_external_window" method.
    but it is displying my url in a new window.
    i want to display it in the same window.
    the second page i want to call is a bsp page.
    i tried also the portal manager and NAVIGATE_ABSOLUTE but nothing happens.
    it displays nothing.
    thanks for your hints.

    >
    Achref zaidi wrote:
    > hi i want to call a page by its url.
    > i am using the "create_external_window" method.
    > but it is displying my url in a new window.
    >
    > i want to display it in the same window.
    > the second page i want to call is a bsp page.
    >
    > i tried also the portal manager and NAVIGATE_ABSOLUTE but nothing happens.
    > it displays nothing.
    >
    > thanks for your hints.
    Hi,
    Navigate_absolute method has navigation mode. Can you please tell me what you mean by nothing happens ? This will work only in Portal environment.
    So if you try with portal then remember to use  Navigation_mode as inplace.

  • How to use Go URL to Navigate from one report to another

    I have used Actionlink option to navigate from one report to another, It is nopt working on the dashboard because i used presentation variables in my first report and its throwing me an error below, I have to pass on id from one summary report to detail report, I have created Go URL, Do i need to use that URL in my summary report column formula ?
    Need some info ~ Thanks ~Srix
    An invalid object was accessed during evaluation.
    Error Details
    Error Codes: QBB4RZQS:SDKE4UTF
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Expression: report.variables['TimePeriod']

    Hi ,
    Please refer the below threads.
    How to Navigate from one report to another report based on column values
    Navigating from one report to another report
    Re: Navigate from Report 1 to Report 2 using Go URL
    Award points it is useful.
    Thanks
    satya

  • How to call a specific method in a servlet from another servlet

    Hi peeps, this post is kinda linked to my other thread but more direct !!
    I need to call a method from another servlet and retrieve info/objects from that method and manipulate them in the originating servlet .... how can I do it ?
    Assume the originating servlet is called Control and the servlet/method I want to access is DAO/login.
    I can create an object of the DAO class, say newDAO, and access the login method by newDAO.login(username, password). Then how do I get the returned info from the DAO ??
    Can I use the RequestDispatcher to INCLUDE the call to the DAO class method "login" ???
    Cheers
    Kevin

    Thanks for the reply.
    So if I have a method in my DAO class called login() and I want to call it from my control servlet, what would the syntax be ?
    getrequestdispatcher.include(newDAO.login())
    where newDAO is an instance of the class DAO, would that be correct ?? I'd simply pass the request object as a parameter in the login method and to retrieve the results of login() the requestdispatcher.include method will return whatever I set as an attribute to the request object, do I have that right ?!!!!
    Kevin

Maybe you are looking for