Avoid directly calling a JCo connection from a JSP

Avoid directly calling a JCo connection from a JSP

We are using SAP EP6 (NetWeaver). We are using ASP code to call an RFC in SAP. It was working fine, but for some reason, we are planning to use JSP code for the same. I created sample JSP code just for testing -- it's working for now. I also made some standalone Java programs to call RFC -- which is also working. I'd like to know what sample JSP code will call an RFC.

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Typically, you don't want a JSP invoking a JCo connection directly. I would recommend invoking a standard Java object that contains your JCo code from a JSP. This way you don't have a lot on non-HTML/JSP scriptlet code in your JavaServer Page.

However, check out my article Build a Java Web Application for SAP Right Now to see how to call a JCo from inside a JSP.

This was first published in December 2005