Solved

Calling Java APIs from JSP

Posted on 2004-08-24
2
265 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 100 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 150 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

Not everyone has adapted to a rapid advancement in technology; there are people who are reluctant or afraid to delve into this brave new world of IT. If you have a friend or a family member who suffers from the so-called technophobia, here is how yo…
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

737 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