I have a webservice method
@WebMethod public void getCapturedImages(String image) System.out.println(" image " + image); } And my servlet class is :
public class GetWebApplicationPathServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static ServletContext context; public static ServletContext getContext() { return context; } public static void setContext(ServletContext context) { GetWebApplicationPathServlet.context = context; } /** * @see HttpServlet#HttpServlet() */ public GetWebApplicationPathServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("doGet(HttpServletRequest"); String path = getServletContext().getRealPath(""); context = getServletContext(); String path1 = context.getRealPath("/images"); System.out.println("path1"+path1); /* * PrintWriter writer = response.getWriter(); * writer.println("Application path: " + path); */ } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } can we invoke my servlet class inside that webservice method.