Situation: I want to have a custom servlet that is available on the same url:port as our admin server. I don't want to have to login to the admin server to reach this url, and the output from this servlet should not be wrapped by the openfire sitemesh template.
First, I registered the servlet in a web-custom.xml, but I could not get my servlet to appear. I had a url like
http://localhost:9090/plugins/myplugin/CustomServlet
. I couldn't find an answer on the message boards so I pulled down the source and started debugging. Turns out that the PluginServlet class does a toLower on the servlet url. So changing the url pattern from /CustomServlet to /customservlet in the web-custom.xml fixed the problem.Next, to remove the security for hitting the servlet, I used the information from this post. Adding
AuthCheckFilter.addExclude("CustomServlet")
to the initializePlugin method fixed it up.Lastly, as mentioned here and here, adding
<meta name='decorator' content='none'/>
tells sitemesh to not use the normal openfire template.Hopefully this info will help me remember this stuff down the line...
3 comments:
I would like to try out your custom servlet. I am also developing a plugin and I would like to see how your servlet uses the Plugin API.
Would be grateful if you can provide me with a sample download that I can try out on Openfire
It would be nice if you have a sample download available, so that I could test on my Openfire server.
thanks
Sorry, I haven't looked at Openfire in many many months. But you can use any simple Servlet for this example. It doesn't really matter what the servlet does.
Post a Comment