Chapter 9. Accessing Beans From a JSP

The $JONAS_ROOT/examples/alarm/web/secured/ directory contains JSP samples for the Alarm application.

JavaServer Pages (JSP) was Sun's reponse to Microsoft ASP. It looks like a scripting language that basically combines standard HTML and scripting tags. On its first invocation, a JSP is tranlated into a Java servlet. There are many books on this topic if you want to learn more about it.

9.1. Accessing a Bean From a JSP

Accessing a bean from a JSP with JOnAS is very simple. Here is an example skeleton:
<html>
<head><title>Test JSP</title></head>
<body>
<jsp:useBean id="myBean" scope="page" class="myPackage.MyBean" />
<%
     myBean.callBusinessMethod();
%>
<p>
</body>
</html>