importing self created classes
[nobr]Hi I'm making a simple .jsp page which queries a database and then returns results in another html page. I am using a few of my own self defined classes to make the page but I don't know how to import them... there aren't any problems with my classes because they work on a servlet I am using.
I think there might also be some problems with my syntax... any help is appreciated.
the root to my classes is:
C:\Prg\Apache\Tomcat5.5.17\webapps\a4020_28503_BMF
and here is my BooksFinder.jsp
--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<%@
page language ="java"
import ="java.util.*, webapps.a4020_28503_BMF.WEB-INF.classes.*"
session ="true"
%>
<html xmlns ="http://www.w3.org/1999/xhtml">
<head>
<title>Book List</title>
</head>
<body>
<%
String title = request.getParameter("title");
BookAccessor accessor =new BookAccessor();
BookBean currentBook;
ArrayList myBooks =new ArrayList();
myList = accessor.selectBooksByTitleLike(title);
List titles = myList;
Iterator iterator = titles.iterator();
while (iterator.hasNext() )
{
currentBook = (BookBean) iterator.next();
%>
< a href ="displayBook?ID=<%= currentBook.getBookID() %>" >
<% = currentBook.getTitle() +", " +
currentBook.getPublisher() +"," +
currentBook.getPrice() +"e" %>
</a><br />
<%
}
%>
</body>
</html>
--
The HTML page which calls BooksFinder.jsp is bookSearch2.html:
-
<html xmlns ="http://www.w3.org/1999/xhtml">
<head>
<title>book database</title>
<script language ="JavaScript">
function submitToServer (btnAction)
{
update.regAction.value = btnAction ;
update.submit() ;
}
</script>
</head>
<body>
<form name="update" method ="get" action ="BooksFinder.jsp" target="_blank">
<label>Book Title:
<input name ="title" type ="text" size ="25" maxlength ="30" />
</label>
<input type ="submit" name ="btnSelect" id ="btnSelect"
value ="SELECT" onClick="submitToServer('select');"/>
<input type="hidden" value="" name="regAction" id="regAction"/>
</form>
</body>
</html>
-
thanks I have been trying hard to figure out how to do this and don't know what to fix :(
Message was edited by:
kidMetropolis[/nobr]

