java

HTTP method post is not supported by this url 3  #angularjs #reactjs

  • Stack Overflow works best with JavaScript enabled
  • i don’t understand because i implemented the dopost in my servlet but i still get this error no matter what !
  • sign up log in tour help
  • Module; /** * Servlet implementation class AjoutCjapitre */ @WebServlet(“/AjoutCjapitre”) public class AjoutChapitre extends HttpServlet { private static final long serialVersionUID = 1 L; @EJB private BeanModule beanM; @EJB private BeanChapitre beanC; String module_id;
  • i tried looking up in other posts but i didn’t find any answer to my problem !

i tried looking up in other posts but i didn’t find any answer to my problem ! i don’t understand because i implemented the dopost in my servlet but i still get this error no matter what !

@ng_real_ninja: HTTP method post is not supported by this url 3 #angularjs #reactjs

i still getting this error and i don’t know what i am doing wrong :

and here’s my servlet :

package web; import java.io.IOException; import javax.ejb.EJB; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import bean.BeanChapitre; import bean.BeanModule; import entity.Module; /** * Servlet implementation class AjoutCjapitre */ @WebServlet(“/AjoutCjapitre”) public class AjoutChapitre extends HttpServlet { private static final long serialVersionUID = 1 L; @EJB private BeanModule beanM; @EJB private BeanChapitre beanC; String module_id; /** * @see HttpServlet#HttpServlet() */ public AjoutChapitre() { super(); // TODO Auto-generated constructor stub } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String chapitre_titre = request.getParameter(“titre”); String chapitre_text = request.getParameter(“texte”); Module module = null; module_id = request.getParameter(“module_id”); try { module = beanM.getModule(Integer.parseInt(module_id)); } catch (Exception e) { System.out.println(“null”); } beanC.createChapitre(chapitre_titre, module, chapitre_text); this.getServletContext().getRequestDispatcher(“/WEB-INF/welcomeProf.jsp?page=m”).forward(request, response); } // TODO Auto-generated method stub }

i tried looking up in other posts but i didn’t find any answer to my problem ! i don’t understand because i implemented the dopost in my servlet but i still get this error no matter what !

any help would be nice !!

thank u in advance

java

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.