0

i have jsp that call method in servlet. i tried to use System.out.println() to prove that my jsp success enter the servlet. The problem i face is i can't get the System.out.println() mean that my jsp can't go in the servlet. Please give some advice for this.

JSP: 



   <% SendPayment processPayment = new SendPayement();

            success = processPayment.sendPayment( payMerInfoBean.getdbCon(), payOrderBean, payOrderParaBean, payMerInfoBean);%>

Servlet:

  public boolean sendPayment(Connection con, B2cOrderBean payOrderBean,
            B2cOrderParaBean payOrderParaBean, B2cMerInfoBean payMerInfoBean, B2cMcpOrderBean payMcpOrderBean, B2cEPayAlertBean ePayAlertBean) {

        System.out.println("In SendPayment");
        return false;

}
Shinn L
  • 13
  • 4
  • have you created bean?? – Vishwa Ratna Dec 26 '18 at 04:27
  • Please refer this link. Hope this would help. https://stackoverflow.com/questions/23333488/how-to-call-java-class-in-jsp – Dhaval Goti Dec 26 '18 at 04:28
  • hi thank you for the suggestion, the problem i face is in jsp i start call the method at servlet via this code <% SendPayment processPayment = new SendPayement(); success = processPayment.sendPayment( payMerInfoBean.getdbCon(), payOrderBean, payOrderParaBean, payMerInfoBean); %> but i can't get the system.out.println from the servlet. – Shinn L Dec 26 '18 at 04:31
  • You can't call a servlet like that. But, you can create a Java bean (as mentioned in earlier comments) and call methods in it. You can invoke a servlet's service method (doPost or doGet) from the JSP - for example, using the JSP action tag ``. It is not clear what you are trying to do. Note, you can update your question (post) with additional info using the _edit_ button at the bottom of your post. – prasad_ Dec 26 '18 at 05:49
  • You can also try searching the net (Google) using a search string like _"how to call servlet from jsp"_, you may find some ideas specifically you may be looking for. – prasad_ Dec 26 '18 at 05:52

0 Answers0