cancel
Showing results for 
Search instead for 
Did you mean: 

Webdispatcher: Syntax error using modification handler

Former Member
0 Kudos

Hello,


I have a problem with our webdispatcher (7.42 Patchlevel 224) on a SuSe Linux System. I want to use it for multiple systems by using the modification handler like in


Configuring SAP Web Dispatcher to Dispatch Requests to Different Systems - User Interface Add-On for...


wdisp/system_conflict_resolution = 1 is set and I defined a modification file:


icm/HTTP/mod_0 = PREFIX=/,FILE=/usr/sap/WDP/SYS/profile/modification_rule.txt


I want to modify the target sid depending on the URL. If the statement „o=SCM“ is in it, SCM should be set via SetHeader.


if %{PATH} regimatch *o=SCM*

SetHeader x-sap-webdisp-target-sid SCM [break]

When I enter this statement in modification_rule.txt the webdispatcher will not start.


FATAL: HttpModHandlerInit: Error processing rule file /usr/sap/WDP/SYS/profile/modification_rule.txt: syntax error in line 2: >if %{PATH} regimatch *o=SCM*     <. See SAP note 1918448.


The syntax error seems to be related to the asteriscs (*) because a statement like


if %{PATH} regimatch o=SCM

SetHeader x-sap-webdisp-target-sid SCM [break]


works, but is the wrong regular expression and can not be used for my purposes. What ist the problem with the asteriscs? I tried it with "*o=scm*" and '*o=SCM*'. The later does not give the syntax error but again its the wrong regular expression.


Any idea is welcome...


Thx.

  Best regards


   Harry 

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chris,

thx for the hint. But I think the regular expression is correct. In principle it's like SAP proposes in the link that I mentioned. *bla* meaning "bla" somewhere in the phrase. But unfortunately it does not work this way. It's somehow like some kind of unwanted wildcard expansion of an asterisk in a shell.

c u

   Harry

feng_shi
Active Participant
0 Kudos

Hi Harry,

Please find below,  the meaning of *:

-------------------

The * (asterisk or star) matches when the preceding character occurs 0 or more times, for example, tre* will find tree (e is found 2 times) and tread (e is found 1 time) and trough (e is found 0 times).

-------------------

if you define *o=SCM*, since there is nothing in front of o=SCM, therefore, the syntax error occurs.

in this case, I think you should define modification rule file like below:

if %{PATH} regimatch .*o=SYS.*

SetHeader x-sap-webdisp-target-sid SCM [break]

if the statement o=SCM in it, then SCM will be set via SetHeader.

The . (period) means any character(s) in this position.

Best regards,

Shi Feng

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

thx for your answer. .*o=SYS.* works 🙂 And a simple o=SYS without any asterisk works too as I found out.

Did the behaviour of the webdispatcher concerning the regular expressions change at some release? Because I've seen the version with simple asterisks (like *bla*) in all SAP documents that I found.

Anyway. It works. Thx again 🙂

c u

  Harry

feng_shi
Active Participant
0 Kudos

Hi Harry,

I don't think this is related to sap webdispatcher release because the regular expressions is the common and standard.

Maybe just a mistake of SAP online documents.

Anyway, Since it works, please mark this question as answered.

Thanks and best regards,

Shi Feng

cris_hansen
Advisor
Advisor
0 Kudos

Hello Harry,

Please have a look at the regular expression syntax here.

Please also read about the new modification actions in SAP note 2042819.

Cheers,

Cris