Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calling Java APIs from JSP

Posted on 2004-08-24
2
Medium Priority
?
269 Views
Last Modified: 2010-04-01
I have available to me multiple Java APIs that I will be using to load and extract data from a XML file.  I need to access these Java APIs from a JSP page.  What is the best way, from a JSP page, to access Java APIs?

(The XML data is used to build a menu tree.  I am using Eclipse, and the myEclipse plugin.)  
 
As an aside, I'm not really asking for a lot of details and examples, (even though that would be VERY nice.)  I've read a lot (beans vs EJB vs embedded code, etc) and can't really pick out the best tools and approach.  If you can recommend an approach, I think it will save me from, say, implementing an approach only to find hours later some serious drawbacks!
0
Comment
Question by:LarryAndro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Assisted Solution

by:bobbit31
bobbit31 earned 400 total points
ID: 11883418
why not simply use page import:

<%@ page import="com.package.blah1,
             com.package.blah2"
%>
0
 
LVL 4

Accepted Solution

by:
hamood earned 600 total points
ID: 11883693
most of the java API can used on JSP pages by using page import directive in jsp. there is no restriction on it. Howerver if you want to use some other APIs. like type four 4 drivers of any other APIs then you have to add the jar files of these in the classpath of your jsp/servlet engine. or in the classpath of the application server which you are using. Once they are in the classpath of your server you can use them by using page import directive in your jsp.

Other method is to directly reference the class without importing it like

Java.Util.Vector vect = new Java.Util.Vector()
java.sql.Connection con;

in any case your claasses should be in your server classpath

Hamood
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question