i'm trying to use this code below, but dont works :c ...
B4X:
Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean
Log("requested url : "&req.RequestURI)
Log("method : "&req.Method)
resp.Write("intercept www_folder call")
Return True
End Sub
my intention is to take the page being loaded, send it to a php-standalone processor and return the processed page to the filter and display it without having to create a handler, is this possible?
It was just an idea I had, regarding adding other web language processors, I thought it would be much easier to add in JServer, than creating a wrapper for apache or Xampp..
ooh, sorry for misunderstanding, I would like to capture the pages requested by the users, if it is a page with a .php or .lua extension, I want to get the content of the file, send it to an external processor and return to the user only the processed html and js.
Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean
Log(req.RequestURI)
If req.RequestURI.EndsWith(".txt") Then
Dim s As String = File.ReadString(File.Combine(Main.srvr.StaticFilesFolder, req.RequestURI), "")
s = s & " modified by MonitorFilter"
resp.Write(s)
Return False
End If
Return True
End Sub