此處描述的處理程序處理來自GrabzIt屏幕快照Web服務的回調。 該處理程序的URL在以下位置傳遞給GrabzIt: callBackURL
的參數 Save 方法。
但是,只有在可以通過 Int以太網
以下參數作為GET參數傳遞給處理程序。
如果要阻止對處理程序的所有訪問,除了GrabzIt之外,請使用此方法 安全技術.
本示例說明如何實現GrabzIt Java處理程序。 這會捕獲從GrabzIt服務傳遞給它的五個參數,包括傳遞給 GetResult 方法。
然後,此方法返回屏幕截圖,即 saved在結果目錄中。
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { String message = request.getParameter("message"); String customId = request.getParameter("customid"); String id = request.getParameter("id"); String filename = request.getParameter("filename"); String format = request.getParameter("format"); String targetError = request.getParameter("targeterror"); GrabzItClient client = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")%>"); GrabzItFile file = client.GetResult(id); if (file == null) { return; } String path = getServletContext().getRealPath("/results") + File.separator + filename; try { file.Save(path); } catch(Exception ex) { //You should log any errors } }