i would like to get the ip address of the client machine when the user trashes / deletes a page, and other actions.
Post to -
states Treat ServletActionContext
as a bonus. If it’s populated you can do neat things with it, but don’t rely on it.
post -
shows that in logging the ip address is available, but i need to access the ip address via my code. QUESTION IS : HOW DO I DO THAT?
your help is very much appreciated.
how about this...
RequestCacheThreadLocal !? that seems to have it when httpServletRequest does not.
You have at least 2 possible options:
1. Add click hadler to all "Trash page" events using JavaScript. Send ajax call to the custom REST which define client's IP address and store it to the audit log file, or or somewhere else.
PROS:
CONS:
2. Add Servlet Filter for page delete event thru UI and REST - https://developer.atlassian.com/server/framework/atlassian-sdk/servlet-filter-plugin-module/
PROS:
CONS:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately events run in a separate thread, i doubt you can get the ServletContext. I can think of only one solution. Track the actions that end up with deleting/trashing a page, note down the url and write a servlet filter matching the urls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks much for responding, i had that kinda thought, was hoping for something that already existed as the logging thing has the ip.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, actions run in separate threads and get the ServletContext. may not be possible. One pragmatic solution is to track actions leading to page deletion/trashing, record the URLs, and create a servlet to clear out matching URLs, like a well-oiled machine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.