Suggest an approach to handle this need in Struts.
posted 5 years ago
Our web application extends Struts 1.3 in a big way.
I have a task wherein::
1) I need to find all the action mappings in all the struts config files(we have more than 10 of them) and write all the path attributes in an xml file.
2) And then as the application is deployed and used, I need to find all the unique paths traversed and write them to probably the same xml file.
I have identified the hooks where I need to place the code.
But i am concerned about the approach as writing to an xml file on every http request would be a big performance hit.
Could anyone suggest me a better way to handle this?
Also which XML api should I use to write to the file. It has to be efficient too as i need to write unique paths traversed to the xml file and this means i would need to find if the incoming path already exists in the xml file.
Parsing the Struts configs and finding action mappings is trivial.
It sounds like you just want to log access--why not just use the existing container HTTP logging mechanism?! Otherwise you're just logging everything twice. And logging those to the same file seems kind of weird, since they're completely different types of information.