cancel
Showing results for 
Search instead for 
Did you mean: 

How do i pass parameters to a web dynpro application ?

Former Member
0 Kudos

Hi all,

how do i best possible pass (serverspecific) parameters to a web dynpro application ?

i wrote a web dynpro application that, among other things, sends an email and stores files on a server directory. Therefor i need parameters like e.g. "mailhost" or "directory".

The way i chose is to make a *.properties file. But from my point of view there are some disadvantages.

1) When i deploy the WD App to a new server, i have to edit the properties file before. I don't know how to do that. Do i have to edit the *.properties file again, before i make a new ear-Archive with NWDS ?

2) When the properties a wrong or change for a deployed app, i have to restart the J2EE Engine. Thats not convenient for a production server.

Is there a better way ?

Thanks

Andreas

(And I promise to return and reward the answers)

Accepted Solutions (0)

Answers (1)

Answers (1)

joachimvanpraet
Active Participant
0 Kudos

Hi Andreas,

You can't use something like portalapp.xml because this is not supported by webdynpro, but ... you can add this parameters at the end off the webdynpro address line. like http://<host>:<port>/webdynpro/dispatcher/local/<Webdynproproject>/<webdynproApplication>?host=yourh...

In your application you can get these variables:


String host = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("host");

when you create a webdynpro iview you can specify the default value for the variables in the URL in the properties of the iview and i think you can personalize them later.

kind regards,

Joachim

Former Member
0 Kudos

Hello Joachim, thank you, a helpful answer.

I knew this point related to passing the parameter for the JCO-Connection to be used by the WD app (e.g. when to change the JCO-Connection from test to prod sap server).

I think i will change my app to that way of passing parameters (although it is not that elegant as a *.properties file).

kind regards

Andreas