i want to use JavaFunctions.java into login.jsp file. my plan is to store all my java functions in one file and i can use them later. ex check for string or number etc functions...
first my folder tree.
webside_01
>.settings
>build
>src
>newServlet
JavaFunctions.java
website_01_Servlet.java
>WebContent
>META-INF
>WEB-INF
index.jsp
login.jsp
JavaFunctions.java
public class JavaFunctions {
/*** test to see if its a number ***/
public static boolean isNumber(String str){
try{
int num = Integer.parseInt(str);
}
catch(NumberFormatException e){
return false;
}
return true;
}/*** End of isnumber Method***/
}
Know in this login.jsp file i want to use 'isNumber()' method. but iam getting error on:
<%@ include file="JavaFunctions.java" %>
login.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ include file="JavaFunctions.java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head></head>
<body>
.....
</body>
....