cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to hide information in the URL while navigating to other application

Former Member
0 Kudos

Hello everyone,

i had a problem while Navigating from one application to another application.....in webdynpro project.

i had two application in one webdynpro project. i am passing one url string in first application exit plug.

using the code below.

String deployableObjectName =wdComponentAPI.getDeployableObjectPart() .getDeployableObjectName();

Map urlParameters = new HashMap();

// get URL parameter value entered by user, stored in context attribute

urlParameters.put("A", wdContext.currentContextElement().getA());

urlParameters.put("B",wdContext.currentContextElement().getB()); try {

WDDeployableObjectPart deployableObjectPart =

WDDeployableObject.getDeployableObjectPart(

deployableObjectName,

"TreeApp",

WDDeployableObjectPartType.APPLICATION);

String urlToTreeApp =

WDURLGenerator.getApplicationURL(

deployableObjectPart,

urlParameters);

wdThis

.wdGetLoginCompInterfaceViewController()

.wdFirePlugLoginAppExit(

urlToTreeApp);

} catch (WDURLException e) {

messageMgr.reportException(

e.getLocalizedMessage(),

false);

} catch (WDDeploymentException ex) {

messageMgr.reportException(

ex.getLocalizedMessage(),

false);

}

then this i am receiving in second application inboundplug that is onDefaultplug,there i had given corresponding parameters.

Everything is working fine.

My problem is : the parameters whch i am passing are showing in addressbar as query string.I dont want to show them there.

Is there any other way to witch i can pass parameters from one application to other application without displaying at url.

anybody help me.

regards,

sunil

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hi Sunil,

Actually you can try following approach:

In your Interafce View for default inbound plug introduce parameter inframe type boolean. In input plug habdler put somethinl like:


  public void onPlugDefault(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, boolean inframe )
  {
    //@@begin onPlugDefault(ServerEvent)
    if(inframe) return;
	try
	{
		String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
		WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart(
							deployableObjectName, "From", WDDeployableObjectPartType.APPLICATION);

		String urlToTreeApp = WDURLGenerator.getApplicationURL(deployableObjectPart, Collections.singletonMap("inframe", "true"));

   		int index = urlToTreeApp.lastIndexOf("..");
   		if(index!=-1) {
			urlToTreeApp = "../../../../../dispatcher" + urlToTreeApp.substring( index + "..".length() );
   		}
   		
		final String formattedStr = "<HTML>" +
									"<HEAD>" +
									"</HEAD>" +
									"<FRAMESET ROWS="*" width="100%">" +
									"<FRAME SRC="" + urlToTreeApp + "" MARGINWIDTH="0" MARGINHEIGHT="0" NORESIZE FRAMEBORDER="0" BORDER="0" SCROLLING="NO">" +
									"</FRAMESET>" +
									"</HTML>";

	  final IWDCachedWebResource resource = WDWebResource.getPublicCachedWebResource
	  (
		formattedStr.getBytes("UTF-8"), 
		WDWebResourceType.HTML,
		WDScopeType.CLIENTSESSION_SCOPE,
		wdComponentAPI.getDeployableObjectPart(),
		"FrameResource"
	  );
	  
	  wdThis.wdFirePlugExit( resource.getAbsoluteURL() );
	}
	catch (final Exception ex)
	{
	  wdComponentAPI.getMessageManager().reportException( new WDNonFatalException(ex), false );
	}    
    //@@end
  }

Your application will be plcaed in frame, so all navigation using URL will be "hidden".

Best regards, Maksim Rashchynksi.

Former Member
0 Kudos

Hi Sunil,

I had the same problem and I am now thinking of refactoring the WD project in such a way that I don't need several applications anymore. Instead I jump from one WD project to the other using the component interface. It should be possible to create a method in the target component's interface controller and call this method from the view controller in one of the source component's views. Add an event to the component controller of the target component and add a method that fires this event. Call this "fireEvent" method in the method you created in the interface controller of the target component and put the actual navigation you want to achieve in the event handler of the event you created.

I hope this makes sense. If not, don't hesitate to ask for additional explanation.

Regards,

Maarten.

Former Member
0 Kudos

Hai Maarten,

thank you, I have two applications in a webdynpro project. I need to send some data from source application to targetapplication. I want to find a way as you said above. please give me the procedure step by step. i never before worked with interface controller.

waiting for your reply.

regards,

sunil