Using Scripting - The Java EE 5 Tutorial (original) (raw)

Using Scripting

JSP technology allows a container to support any scripting language that can call Java objects. If you wish to use a scripting language other than the default, java, you must specify it in the language attribute of thepage directive at the beginning of a JSP page:

<%@ page language="_scripting-language_" %>

Because scripting elements are converted to programming language statements in the JSP page’s servlet class, you must import any classes and packages used by a JSP page. If the page language is java, you import a class or package with the import attribute of the page directive:

<%@ page import="_fully-qualified-classname_, _packagename_.*" %>

The webclient JSP page response.jsp uses the following page directive to import the classes needed to access the service classes:

<%@ page import= "helloservice.endpoint.HelloService, helloservice.endpoint.Hello" %>

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices