Interactions of the type ep --> eXY are studied, where the component X of t
he hadronic final state contains two jets and is well separated in rapidity
from a leading baryonic system Y. Analyses are performed of both resolved
and direct photoproduction and of deep-inelastic scattering with photon vir
tualities in the range 7.5 < Q(2) < 80 GeV2. Cross sections are presented w
here Y has mass M-y < 1.6 GeV, the squared four-momentum transferred at the
proton vertex satisfies \t\ < 1 GcV(2) and the two jets each have transver
se momentum p(T)(jet) > 5 GeV relative to the photon direction in the rest
frame of X. Models based on a factorisable diffractive exchange with a gluo
n dominated structure, evolved to a scale set by the transverse momentum (p
) over cap(T) of the outgoing partons front the hard interaction. give good
descriptions of the data. Exclusive q (q) over bar production, as calculat
ed in perturbative QCD using the squared proton gluon density, represents a
t most a small fraction of the measured cross section. The compatibility of
the data with a breaking of diffractive factorisation due to spectator int
eractions in resolved photoproduction is investigated.