aspose file tools*
The moose likes Struts and the fly likes Suggest an approach to handle this need in Struts. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Suggest an approach to handle this need in Struts." Watch "Suggest an approach to handle this need in Struts." New topic

Suggest an approach to handle this need in Struts.

Giriraj Bhojak
Ranch Hand

Joined: Apr 03, 2008
Posts: 71
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.

David Newton

Joined: Sep 29, 2008
Posts: 12617

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.
I agree. Here's the link:
subject: Suggest an approach to handle this need in Struts.
Similar Threads
Transversing possible multiple paths from one origin to one destination
"STRUTS-like action"
how to delete a image file from a application running in Tomcat
to find the workspace path at runtime to write the file
Reading from and writing to a file