Skip to Content
avatar image
Former Member

Webdispatcher: Syntax error using modification handler

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 SAP NetWeaver - SAP…


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 

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 03, 2015 at 07:25 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Nov 04, 2015 at 08:32 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Nov 03, 2015 at 05:03 PM
    -1

    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

    Add comment
    10|10000 characters needed characters exceeded