You shouldn’t need to change RewriteServlet at all – what are you trying to do that makes you think we should change code there?
Why not just add an Operation called “DefferredInjection,” which would add itself to a Request parameter – that could later be retrieved by RewritePhaseListener, which would perform the injection during the right JSF phase.
I think that the Operation#perform() > Binding#submit mechanism is exactly what you want here, but you can re-use what was already done.
What is your smarter solution?
BTW. This code should all go in the integration-faces module, I think! Just take a look at what PhaseAction does, then you can pretty much copy that and create PhaseInjection Thoughts?
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.