cancel
Showing results for 
Search instead for 
Did you mean: 

URL parameter to invoke one of mulitple start pages

Former Member
0 Kudos

Hello WebDyn Pro's.

I am thinking that I will create a single Web Dynpro application that serves 6-10 single web pages (views). These 6-10 pages are all very independent from each other. In essence, my application has 6-10 "start pages". I am planning on using this web dynpro to provide all the static HTML content across my portal.

Is it possible to pass a URL parameter to the application such that it knows which exact start page to display (eg; view=startpage1)?

Could you give me a little guidance on how to build a WebDynpro application for this requirement?

Thanks,

Kevin

View Entire Topic
Former Member
0 Kudos

Hello Kevin,

To achive this you could create one "start page", that just checks for you url parameter and fires a plug to the correct one.

See this tutorial for more information about URL parameters.

http://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/inter-applica... in web dynpro.pdf

Or you could simply create one application for each start view, and start the right application from the portal.

Regards Mattias

Former Member
0 Kudos

Inspecting the URL and firing the plug to the appropriate view worked great for me.

One single application with multiple views was optimum because then it is easy to share images across views.

Thanks

Former Member
0 Kudos

Hello,

It's great that it worked. Just one note on applications.

A WebDynpro Application is no more than a mapping between an URL and a inbound plug to a view. This means that each WebDynpro Project can have multiple applications which all points to different (or even the same) views within all the components contained in that project.

I find the name "application" a bit confusing, I think of it more as "URL Mapping", kind of like a servlet-mapping in a Java WebApp.

Regards

Mattias

Former Member
0 Kudos

Mattias,

Thanks for the clarification. It helps me to know that others consider multiple applications inside a webdynpro project to be like multiple servlet mappings in a JAVA WebApp. The webdynpro structure makes much more sense to me now.

Kevin

Former Member
0 Kudos

Hi Kevin,

I tried several ways to achieve the same; i.e. in one App - fired plugs for various views from the wdDoInit()

But context parameters are not set yet in this method. Hence no plug gets fired.

How do you then fire diff Views from within one Application?

Thanks

Mehnaaz

Former Member
0 Kudos

Hi Mehnaaz,

I found this post very helpful in describing how to pass parameters into a Webdynpro application. You may be helped from it too.

You may also be helped by seeing my code in the upfront page that directs traffic. It is listed below. Afer entering the sample code, perform a "Source=>Organize imports"

in order to bring in the class "WDWebContextAdapter".

public void wdDoInit()

{

//@@begin wdDoInit()

//Read Parameter RequestedView

String requestedView =

WDWebContextAdapter.getWebContextAdapter().getRequestParameter("RequestedView");

// Based on RequestedView parameter, display target page.

if (requestedView == null) {

wdThis.wdFirePlugToHome();

} else {

if (requestedView.equalsIgnoreCase("Home")) {

wdThis.wdFirePlugToHome();

} else if (requestedView.equalsIgnoreCase("Logoff")) {

wdThis.wdFirePlugToLogoff();

} else {

wdThis.wdFirePlugToHome();

}

}

//@@end

}

Former Member
0 Kudos

Thanks Kevin, it works great now.

I was also doing it in the wdDoInit, but I was reading the parameter from the context-mapping, instead of from the Request.

Many thanks

Mehnaaz