Note that there are some explanatory texts on larger screens.

plurals
  1. POCan we invoke a servlet inside a webservice method
    primarykey
    data
    text
    <p>I have a webservice method</p> <pre><code> @WebMethod public void getCapturedImages(String image) System.out.println(" image " + image); } </code></pre> <p>And my servlet class is : </p> <pre><code> 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 } </code></pre> <p>can we invoke my servlet class inside that webservice method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload