I just started to write java and jsp program and I don't understand - why do I have to keep my all .class in WEB-INF directory?
Can I put them in the directory that I prefer but I still want to have the access to all Java default classes such as java.util.*
? For instance,
app/
class/
Foo/
Hello.class
Hello.java
index.jsp
Is that possible?
index.jsp,
<html>
<head>
<title>Custom Class</title>
</head>
<body>
<%@ page import="java.io.*,java.util.*" %>
<%@ page import="javax.servlet.*,java.text.*" %>
<%@ page import="Foo.Hello" %>
<%
Date date = new Date();
out.print( "<p>" +date.toString()+"</p>");
SimpleDateFormat ft = new SimpleDateFormat ("EEEE");
out.print( "<p>" + ft.format(date) + "</p>");
%>
<%
Hello hello = new Hello();
hello.setMessage("Hello There!");
out.print(hello.getMessage() + "<br/>");
out.print(hello.sayHello());
%>
</body>
</html>
EDIT:
app/
WEB-INF/
classes/
Foo/
Hello.class
Hello.java
index.jsp