Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (2 votes)
38 views

Java Studio Creator Field Guide Anderson 2024 scribd download

Creator

Uploaded by

rideldovanhn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
38 views

Java Studio Creator Field Guide Anderson 2024 scribd download

Creator

Uploaded by

rideldovanhn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Visit https://ebookgate.

com to download the full version and


explore more ebooks

Java Studio Creator Field Guide Anderson

_____ Click the link below to download _____


https://ebookgate.com/product/java-studio-creator-
field-guide-anderson/

Explore and download more ebooks at ebookgate.com


Here are some recommended products that might interest you.
You can download now and explore!

Android Studio Bumble Bee Essentials Java Edition Neil


Smyth

https://ebookgate.com/product/android-studio-bumble-bee-essentials-
java-edition-neil-smyth/

ebookgate.com

JAVA Illuminated An Active Learning Approach 5th Edition


Julie Anderson

https://ebookgate.com/product/java-illuminated-an-active-learning-
approach-5th-edition-julie-anderson/

ebookgate.com

Field Guide to Illumination SPIE Field Guide Series Angelo


V. Arecchi

https://ebookgate.com/product/field-guide-to-illumination-spie-field-
guide-series-angelo-v-arecchi/

ebookgate.com

Field Guide to Diffractive Optics SPIE Field Guide Vol


FG21 Yakov Soskind

https://ebookgate.com/product/field-guide-to-diffractive-optics-spie-
field-guide-vol-fg21-yakov-soskind/

ebookgate.com
Java Pocket Guide 1st Edition Liguori

https://ebookgate.com/product/java-pocket-guide-1st-edition-liguori/

ebookgate.com

Microsoft XNA Game Studio Creators Guide 1st Edition


Stephen Cawood

https://ebookgate.com/product/microsoft-xna-game-studio-creators-
guide-1st-edition-stephen-cawood/

ebookgate.com

Nikon D3200 digital field guide Hess

https://ebookgate.com/product/nikon-d3200-digital-field-guide-hess/

ebookgate.com

Traditions of Gamelan Music in Java Musical Pluralism and


Regional Identity 1st Edition R. Anderson Sutton

https://ebookgate.com/product/traditions-of-gamelan-music-in-java-
musical-pluralism-and-regional-identity-1st-edition-r-anderson-sutton/

ebookgate.com

A Guide To Programming in Java Java 2 Platform Standard


Edition 5 Beth Brown

https://ebookgate.com/product/a-guide-to-programming-in-java-
java-2-platform-standard-edition-5-beth-brown/

ebookgate.com
JAVA STUDIO
TM

FIELD GUIDE
SECOND EDITION
JAVA TECHNOLOGY
OVERVIEW

Topics in This Chapter

• The Java Programming Language


• JavaBeans Components
• NetBeans Software
• The XML Language
• The J2EE Architecture
• JavaServer Faces Technology
• JDBC and Databases
• Ant Build Tool
• Web Services
• EJBs and Portlets
Chapter

elcome to Creator! Creator is an IDE (Integrated Development

W Environment) that helps you build web applications. While many


IDEs out in the world do that, Creator is unique in that it is built on
a layered technology anchored in Java. At the core of this technol-
ogy is the Java programming language. Java includes a compiler that produces
portable bytecode and a Java Virtual Machine (JVM) that runs this byte code on
any processor. Java is an important part of Creator because it makes your web
applications portable.
But Java is more than just a programming language. It is also a technology
platform. Many large systems have been developed that use Java as their core.
These systems are highly scalable and provide services and structure that
address some of the high-volume, distributed computing environments of
today.

1.1 Introduction
Creator depends on multiple technologies, so it’s worthwhile touching on them
in this chapter. If you’re new to Java, many of its parts and acronyms can be
daunting. Java technologies are divided into related packages containing
classes and interfaces. To build an application, you might need parts of one sys-
tem and parts of another. This chapter provides you with a road map of Java

3
4 Chapter 1 Java Technology Overview

technologies and documentation sources to help you design your web applica-
tions with Creator.
We’ll begin with an overview of the Java programming language. This will
help you get comfortable writing Java code to customize your Creator applica-
tions. But before we do that, we show you how to find the documentation for
Java classes and methods. This will help you use them with confidence in your
programs.
Most of the documentation for a Java Application Program Interface (API)
can be accessed through Creator’s Help System, located under Help in the
main menu. Sometimes all you need is the name of the package or the system
to find out what API a class, interface, or method belongs to. Java consists of
the basic language (all packages under java) and Java extensions (all packages
under javax). Once you locate a package, you can explore the interfaces and
classes and learn about the methods they implement.
You can also access the Java documentation online. Here’s a good starting
point for the Java API documentation.

http://java.sun.com/docs/

This page contains links to the Java 2 Platform Standard Edition, which con-
tains the core APIs. It also has a link to all of the other Java APIs and technolo-
gies, found at

http://java.sun.com/reference/docs/index.html

Creator is also built on the technology of JavaServer Faces (JSF). You can
find the current JSF API documentation at

http://java.sun.com/j2ee/javaserverfaces/1.0/docs/api/
index.html

JSF is described as part of the J2EE Tutorial, which can be found at

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

These are all important references for you. We’ve included them at the
beginning of this book so it’s easy to find them later (when you’re deep in the
challenges of web application development). For now, let’s begin with Java as a
programming language. Then we’ll look at some of the other supporting tech-
nologies on which Creator is built.
1.2 The Java Programming Language 5

1.2 The Java Programming Language


This cursory overview of the Java programming language is for readers who
come from a non-Java programming environment. It’s not meant to be an in-
depth reference, but a starting point. Much of Creator involves manipulating
components through the design canvas and the components’ property sheets.
However, there are times when you must add code to a Java page bean (the
supporting Java code for your web application’s page) or use a JavaBeans com-
ponent in your application. You’ll want a basic understanding of Java to more
easily use Creator.

Object-Oriented Programming
Languages like C and Basic are procedure-oriented languages, which means
data and functions are separated. To write programs, you either pass data as
arguments to functions or make your data global to functions. This arrange-
ment can be problematic when you need to hide data like passwords, customer
identification codes, and network addresses. Procedure-oriented designs work
fine when you write simple programs but are often not suitable to more com-
plex tasks like distributed programming and web applications. Function librar-
ies help, but error handling can be difficult and global variables may introduce
side effects during program maintenance.
Object-oriented programming, on the other hand, combines data and func-
tions into units called objects. Languages like Java hide private data (fields) from
user programs and expose only functions (methods) as a public interface. This
concept of encapsulation allows you to control how callers access your objects. It
allows you to break up applications into groups of objects that behave in a sim-
ilar way, a concept called abstraction. In Java, you implement an object with a
Java class and your object’s public interface becomes its outside view. Java has
inheritance to create new data types as extensions of existing types. Java also
has interfaces, which allow objects to implement required behaviors of certain
classes of objects. All of these concepts help separate an object’s implementa-
tion (inside view) from its interface (outside view).
All objects created from the same class have the same data type. Java is a
strongly typed language, and all objects are implicitly derived from type
Object (except the built-in primitive types of int, boolean, char, double,
long, etc.). You can convert an object from one type to another with a converter.
Casting to a different type is only allowed if the conversion is known by the
compiler. Creator’s Java editor helps you create well-formed statements with
dynamic syntax analysis and code completion choices. You’ll see how this
works in Chapter 2.
Error handling has always been a tough problem to solve, but with web
applications error handling is even more difficult. Processing errors can occur
6 Chapter 1 Java Technology Overview

on the server but need to propagate in a well-behaved way back to the user.
Java implements exception handling to handle errors as objects and recover
gracefully. The Java compiler forces programmers to use the built-in exception
handling mechanism.
And, Java forbids global variables, a restriction that helps program mainte-
nance.

Creating Objects
Operator new creates objects in Java. You don’t have to worry about destroying
them, because Java uses a garbage collection mechanism to automatically
destroy objects which are no longer used by your program.

Point p = new Point(); // create a Point at (0, 0)


Point q = new Point(10, 20); // create a Point at (10, 20)

Operator new creates an object at run time and returns its address in memory to
the caller. In Java, you use references (p and q) to store the addresses of objects so
that you can refer to them later. Every reference has a type (Point), and objects
can be built with arguments to initialize their data. In this example, we create
two Point objects with x and y coordinates, one with a default of (0, 0) and the
other one with (10, 20).
Once you create an object, you can call its methods with a reference.

p.move(30, 30); // move object p to (30, 30)


q.up(); // move object q up in y direction
p.right(); // move object p right in x direction
int xp = p.getX(); // get x coordinate of object p
int yp = p.getY(); // get y coordinate of object p
q.setX(5); // change x coordinate in object q
p.setY(25); // change y coordinate in object p

As you can see, you can do a lot of things with Point objects. It’s possible to
move a Point object to a new location, or make it go up or to the right, all of
which affect one or more of a Point object’s coordinates. We also have getter
methods to return the x and y coordinates separately and setter methods to
change them.
Why is this all this worthwhile? Because a Point object’s data (x and y coor-
dinates) are hidden. The only way you can manipulate a Point object is through
its public methods. This makes it easier to maintain the integrity of Point
objects.
1.2 The Java Programming Language 7

Classes
Java already has a Point class in its API, but for the purposes of this discussion,
let’s roll our own. Here’s our Java Point class, which describes the functionality
we’ve shown you.

Listing 1.1 Point class

// Point.java - Point class


class Point {
// Fields
private double x, y; // x and y coordinates

// Constructors
public Point(double x, double y) { move(x, y); }
public Point() { move(0, 0); }

// Instance Methods
public void move(double x, double y) {
this.x = x; this.y = y;
}
public void up() { y++; }
public void down() { y--; }
public void right() { x++; }
public void left() { x--; }

// getters
public double getX() { return x; }
public double getY() { return y; }

// setters
public void setX(double x) { this.x = x; }
public void setY(double y) { this.y = y; }
}

The Point class is divided into three sections: Fields, Constructors, and
Instance Methods. Fields hold internal data, constructors initialize the fields,
and instance methods are called by you with references. Note that the fields for
x and y are private. This enforces data encapsulation in object-oriented pro-
gramming, since users may not access these values directly. Everything else,
however, is declared public, making it accessible to all clients.
The Point class has two constructors to build Point objects. The first con-
structor accepts two double arguments, and the second one is a default con-
structor with no arguments. Note that both constructors call the move()
method to initialize the x and y fields. Method move() uses the Java this key-
8 Chapter 1 Java Technology Overview

word to distinguish local variable names in the method from class field names
in the object. The setX() and setY() methods use the same technique.1
Most of the Point methods use void for their return type, which means the
method does not return anything. The ++ and -- operators increment or decre-
ment their values by one, respectively. Each method has a signature, which is
another name for a function’s argument list. Note that a signature may be
empty.

Packages
The Point class definition lives in a file called Point.java. In Java, you must
name a file with the same name as your class name. This makes it convenient
for the Java run-time interpreter to find class definitions when it’s time to
instantiate (create) objects. When all classes live in the same directory, it’s easy
to compile and run Java programs.
In the real world, however, classes have to live in different places, so Java
has packages that allow you to group related classes. A package in Java is both a
directory and a library. This means a one-to-one correspondence exists between
a package hierarchy name and a file’s pathname in a directory structure.
Unique package names are typically formed by reversing Internet domain
names (com.mycompany). Java also provides access to packages from class paths
and JAR (Java Archive) files.
Suppose you want to store the Point class in a package called MyPack-
age.examples. Here’s how you do it.

package MyPackage.examples;
class Point {
. . .
}

Package names with dot (.) delimiters map directly to path names, so
Point.java lives in the examples directory under the MyPackage directory. A
Java import statement makes it easy to use class names without fully qualifying
their package names. Import statements are also applicable to class names from
any Java API.

// Another Java program


import java.util.Date;
import javax.faces.context.*;
import MyPackage.examples.Point;

1. The this reference is not necessary if you use different names for the argu-
ments.
1.2 The Java Programming Language 9

The first import statement provides the Date class name to our Java program
from the java.util package. The second import uses a wildcard (*) to make
all class definitions available from javax.faces.context. The last import
brings our Point class into scope from package MyPackage.examples.

Exceptions
We mentioned earlier that one of the downfalls of procedure-oriented lan-
guages is that subroutine libraries don’t handle errors well. This is because
libraries can only detect problems, not fix them. Even with libraries that sup-
port elaborate error mechanisms, you cannot force someone to check a func-
tion’s return value or peek at a global error flag. For these and other reasons, it
has been difficult to write distributed software that gracefully recovers from
errors.
Object-oriented languages like Java have a built-in exception handling
mechanism that lets you handle error conditions as objects. When an error
occurs inside a try block of critical code, an exception object can be thrown
from a library method back to a catch handler. Inside user code, these catch
handlers may call methods in the exception object to do a range of different
things, like display error messages, retry, or take other actions.
The exception handling mechanism is built around three Java keywords:
throw, catch, and try. Here’s a simple example to show you how it works.

class SomeClass {
. . .
public void doSomething(String input) {
int number;
try {
number = Integer.parseInt(input);
}
catch (NumberFormatException e) {
String msg = e.getMessage();
// do something with msg
}
. . .
}
}

Suppose a method called doSomething() needs to convert a string of char-


acters (input) to an integer value in memory (number). In Java, the call to Inte-
ger.parseInt() performs the necessary conversion for you, but what about
malformed string arguments? Fortunately, the parseInt() method throws a
NumberFormatException if the input string has illegal characters. All we do is
place this call in a try block and use a catch handler to generate an error mes-
sage when the exception is caught.
10 Chapter 1 Java Technology Overview

All that’s left is to show you how the exception gets thrown. This is often
called a throw point.

class Integer {
public static int parseInt(String input)
throws NumberFormatException {
. . .
// input string has bad chars
throw new NumberFormatException("illegal chars");
}
. . .
}

The static parseInt() method2 illustrates two important points about


exceptions. First, the throws clause in the method signature announces that
parseInt() throws an exception object of type NumberFormatException. The
throws clause allows the Java compiler to enforce error handling. To call the
parseInt() method, you must put the call inside a try block or in a method
that also has the same throws clause. Second, operator new calls the Number-
FormatException constructor to build an exception object. This exception
object is built with an error string argument and thrown to a catch handler
whose signature matches the type of the exception object (NumberFormat Excep-
tion).3 As you have seen, a catch handler calls getMessage() with the excep-
tion object to access the error message.
Why are Java exceptions important? As you develop web applications with
Creator, you’ll have to deal with thrown exceptions. Fortunately, Creator has a
built-in debugger that helps you monitor exceptions. In the Chapter 14, we
show you how to set breakpoints to track exceptions in your web application
(see “Detecting Exceptions” on page 521).

Inheritance
The concept of code reuse is a major goal of object-oriented programming.
When designing a new class, you may derive it from an existing one. Inherit-
ance, therefore, implements an “is a” relationship between classes. Inheritance
also makes it easy to hook into existing frameworks so that you can take on

2. Inside class Integer, the static keyword means you don’t have to instan-
tiate an Integer object to call parseInt(). Instead, you call the static
method with a class name rather than a reference.
3. The match doesn’t have to be exact. The exception thrown can match the
catch handler’s object exactly or any exception object derived from it by
inheritance. To catch any possible exception, you can use the superclass
Exception. We discuss inheritance in the next section.
1.2 The Java Programming Language 11

new functionalities. With inheritance, you can retain the existing structure and
behavior of an existing class and specialize certain aspects of it to suit your
needs.
In Java, inheritance is implemented by extending classes. When you extend
one class from another, the public methods of the “parent” class become part of
the public interface of the “child class.” The parent class is called a superclass
and the child class is called a subclass. Here are some examples.

class Pixel extends Point {


. . .
}

class NumberFormatException extends IllegalArgumentException {


. . .
}

In the first example, Point is a superclass and Pixel is a subclass. A Pixel


“is a” Point with, say, color. Inside the Pixel class, a color field with setter and
getter methods can assist in manipulating colors. Pixel objects, however, are
Point objects, so you can move them up, down, left or right, and you can get or
set their x and y coordinates. (You can also invoke any of Point’s public meth-
ods with a reference to a Pixel object.) Note that you don’t have to write any
code in the Pixel class to do these things because they have been inherited
from the Point class. Likewise, in NumberFormatException, you may intro-
duce new methods but inherit the functionality of IllegalArgumentExcep-
tion.
Another point about inheritance. You can write your own version of a
method in a subclass that has the same name and signature as the method in
the superclass. Suppose, for instance, we add a clear() method in our Point
class to reset Point objects back to (0, 0). In the Pixel class that extends from
Point, we may override the clear() method.4 This new version could move a
Pixel object to (0, 0) and reset its color. Note that clear() in class Point is
called for Point objects, but clear() in class Pixel will be called for Pixel
objects. With a Point reference set to either type of object, different behaviors
happen when you call this method.
It’s important to understand that these kinds of method calls in Java are
resolved at run time. This is called dynamic binding. In the object-oriented para-
digm, dynamic binding means that the resolution of method calls with objects

4. Creator uses this same feature by providing methods that are called at dif-
ferent points in the JSF page request life cycle. You can override any of these
methods and thus provide your own code, “hooking” into the page request
life cycle. We show you how to do this in Chapter 6 (see “The Creator-JSF
Life Cycle” on page 151).
12 Chapter 1 Java Technology Overview

is delayed until you run a program. In web applications and other types of dis-
tributed software, dynamic binding plays a key role in how objects call meth-
ods from different machines across a network or from different processes in a
multitasking system.

Interfaces
In Java, a method with a signature and no code body is called an abstract
method. Abstract methods must be overridden in subclasses and help define
interfaces. A Java interface is like a class but has no fields and only abstract pub-
lic methods. Interfaces are important because they specify a contract. Any new
class that implements an interface must provide code for the interface’s meth-
ods.
Here’s an example of an interface.

interface Encryptable {
void encode(String key);
String decode();
}

class Password implements Encryptable {


. . .
void encode(String key) { . . . }
String decode() { . . . }
}

The Encryptable interface contains only the abstract public methods


encode() and decode(). Class Password implements the Encryptable inter-
face and must provide implementations for these methods. Remember, inter-
faces are types, just like classes. This means you can implement the same
interface with other classes and treat them all as Encryptable types.
Java prohibits a class from inheriting from more than one superclass, but it
does allow classes to implement multiple interfaces. Interfaces, therefore, allow
arbitrary classes to “take on” the characteristics of any given interface.
One of the most common interfaces implemented by classes in Java is the
Serializable interface. When an object implements Serializable, you can
use it in a networked environment or make it persistent (this means the state of
an object can be saved and restored by different clients). There are methods to
serialize the object (before sending it over the network or storing it) and to
deserialize it (after retrieving it from the network or reading it from storage).
1.3 JavaBeans Components 13

1.3 JavaBeans Components


A JavaBeans component is a Java class with certain structure requirements. Jav-
abeans components define and manipulate properties, which are objects of a
certain type. A JavaBeans component must have a default constructor so that it
can be instantiated when needed. Beans also have getter and setter methods
that manipulate a bean property and conform to a specific naming convention.
These structural requirements make it possible for development tools and
other programs to create JavaBeans components and manipulate their proper-
ties.
Here’s a simple example of a JavaBeans component.

public class Book {


private String title;
private String author;
public Book() { setTitle(""); setAuthor(""); }
public void setTitle(String t) { title = t; }
public String getTitle() { return title; }
public void setAuthor(String a) { author = a; }
public String getAuthor() { return author; }
}

Why are JavaBeans components important? First and most important, they
are accessible to Creator. When you write a JavaBeans component that con-
forms to the specified design convention, you may use it with Creator and bind
JSF components to bean properties. Second, JavaBeans components can encap-
sulate business logic. This helps separate your design presentation (GUI com-
ponents) from the business data model.
In subsequent chapters, we show you several examples of JavaBeans compo-
nents. We’ll use a LoginBean to handle users that login with names and pass-
words and show you a LoanBean that calculates mortgage payments for loans.
The Point class in Listing 1.1 on page 7 is another example of a JavaBeans com-
ponent.

1.4 NetBeans Software


NetBeans software is an open source IDE written in the Java programming lan-
guage. It also includes an API that supports building any type of application.
The IDE has support for Java, but its architecture is flexible and extensible,
making support for other languages possible.
14 Chapter 1 Java Technology Overview

NetBeans is an Open Source project. You can view more information on its
history, structure, and relationship with Sun Microsystems at its web site

http://www.netbeans.org/

NetBeans and Creator are related because Creator is based on the NetBeans
platform. In building Creator, Sun is offering an IDE aimed specifically at cre-
ating web-based applications. Thus, the IDE integrates page design with gener-
ated JSP source and page bean components. NetBeans provides features such
as source code completion, workspace manipulation of windows, expandable
tree views of files and components, and debugging facilities. Because NetBeans
is extensible, the Creator architects included Java language features such as
inheritance to adapt components from NetBeans into Creator applications with
the necessary IDE functions.

1.5 The XML Language


XML is a metalanguage that dictates how to define custom languages and
describe data. The name is an acronym for Extensible Markup Language. XML
is not a programming language, however. In fact, it’s based on simple character
text in which the data are surrounded by text markup that documents data.
This means you can use XML to describe almost anything. Since XML is self-
describing, it’s easy to read with tools and other programs to decide what
actions to take. You can transport XML documents easily between systems or
across the Internet, and virtually any type of data can be expressed and vali-
dated in an XML document. Furthermore, XML is portable because it’s lan-
guage and system independent.
Creator uses XML to define several configuration files as well as the source
for the JSP web pages. Here’s an example XML file (managed-beans.xml) that
Creator generates for managing a JavaBeans component in a web application.

<faces-config>
<managed-bean>
<managed-bean-name>LoanBean</managed-bean-name>
<managed-bean-class>asg.bean_examples.LoanBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>

Every XML file has opening tags (<tag>) and closing tags (</tag>) that
define self-describing information. Here, we specify a managed-bean element
1.6 The J2EE Architecture 15

to tell Creator what it needs to know about the LoanBean component. This
includes its name (LoanBean), class name and package (asg.bean-
_examples.LoanBean), and the scope of the bean (session). When you add your
own JavaBeans components to Creator as managed beans, Creator generates
this configuration information for you.
Creator maintains and updates its XML files for you, but it’s a good idea to
be familiar with XML syntax. This will allow you to customize the Creator
XML files if necessary.

1.6 The J2EE Architecture


The J2EE platform gives you a multitiered application model to develop dis-
tributed components. Although any number of tiers is possible, we’ll use a
three-tier architecture for the applications in this book. Figure 1–1 shows the
approach.
The client machine supports web browsers, applets, and stand-alone appli-
cations. A client application may be as simple as a command-line program run-
ning as an administrator client or a graphical user interface created from Java
Swing or Abstract Window Toolkit (AWT) components. Regardless, the J2EE
specification encourages thin clients in the presentation tier. A thin client is a
lightweight interface that does not perform database queries, implement busi-
ness logic, or connect to legacy code. These types of “heavyweight” operations
preferably belong to other tiers.

Web
Presentation Tier Database
Tier Tier
Business
Tier

Client J2EE Server Database


Machine Machine Server Machine

Figure 1–1 Three-tier J2EE architecture


16 Chapter 1 Java Technology Overview

The J2EE server machine is the center of the architecture. This middle tier
contains web components and business objects managed by the application
server. The web components dynamically process user requests and construct
responses to client applications. The business objects implement the logic of a
business domain. Both components are managed by a J2EE application server
that provides these components with important system services, such as secu-
rity, transaction management, naming and directory lookups, and remote con-
nectivity. By placing these services under control of the J2EE application server,
client components focus on either presentation logic or business logic. And,
business objects are easier for developers to write. Furthermore, the architec-
ture encourages the separation of business logic from presentation logic (or
model from view).
The database server machine handles the database back end. This includes
mainframe transactions, databases, Enterprise Resource Planning (ERP) sys-
tems, and legacy code. Another advantage of the three-tier architecture is that
older systems can take on a whole new “look” by using the J2EE platform. This
is the approach many businesses are taking as they integrate legacy systems
into a modern distributed computing environment and expose application ser-
vices and data to the web.

1.7 Java Servlet Technology


The Java Servlet component technology presents a request-response program-
ming model in the middle tier. Servlets let you define HTTP-specific servlet
classes that accept data from clients and pass them on to business objects for
processing. Servlets run under the control of the J2EE application server and
often extend applications hosted by web servers. Servlet code is written in Java
and compiled. It is particularly suited to server-side processing for web appli-
cations since each Servlet session is handled in its own thread.

1.8 JavaServer Pages Technology


A JavaServer Pages (JSP) page is a text-based document interspersed with Java
code. A JSP engine translates JSP text into Java Servlet code. It is then dynami-
cally compiled and executed. This component technology lets you create
dynamic web pages in the middle tier. JSP pages contain static template data
(HTML, WML, and XML) and JSP elements that determine how a page con-
structs dynamic content. The JSP API provides an efficient, thread-based mech-
anism to create dynamic page content.
1.9 JDBC API and Database Access 17

Creator uses JavaServer Faces (JSF), which is built on both the servlet and
JSP technologies. However, by using Creator, you are shielded from much of
the details of not only JSP and servlet programming, but JSF details as well.

1.9 JDBC API and Database Access


Java Data Base Connectivity (JDBC) is an API that lets you invoke SQL com-
mands from Java methods in the middle tier. Typically, you use the JDBC API
to access a database from servlets or JSP pages. The JDBC API has an applica-
tion-level interface for database access and a service provider interface to
attach JDBC drivers to the J2EE platform. In support of JDBC, J2EE application
servers manage a pool of database connections. This pool provides business
objects efficient access to database servers.
The JDBC CachedRowSet API is a newer technology that makes database
access more flexible. Creator accesses configured data sources using a Cached-
RowSet object, a JavaBeans component that is scrollable, updatable, and serial-
izable. These components are disconnected from the database, caching its rows
into memory. When web applications modify data in the cached rowset object,
the result propagates back to the data source through a subsequent connection.
By default, Creator instantiates a cached rowset object in session scope.
The concept of data providers is also important because it produces a level of
abstraction for data flow within Creator’s application environment. Creator’s
data providers allow you to change the source of data (say, from a database
table to a web services call or an EJB method) by hooking the data provider to a
different data source.
We introduce data providers in Chapter 8 and show how to use them with
databases in Chapter 9.

1.10 JavaServer Faces Technology


The JavaServer Faces (JSF) technology helps you develop web applications
using a server-side user interface (UI) component framework. The JSF API
gives you a rich set of UI components and lets you handle events, validate and
convert user input, define page navigation, and support internationalization.
JSF has custom tag libraries for connecting components to server-side objects.
We show you these components and tag libraries in Chapter 3.
JSF incorporates many of the lower level tasks that JSP developers are used
to doing. Unlike JSP applications, however, applications developed with JSF
can map HTTP requests to component-specific event handlers and manage UI
elements as stateful objects on the server. This means JSF offers a better separa-
18 Chapter 1 Java Technology Overview

tion of model and presentation. The JSF API is also layered directly on top of
the Servlet API.

1.11 Ant Build Tool


Ant is a tool from the Apache Software Foundation (www.apache.org) that
helps you manage the “build” of a software application. The name is an acro-
nym for “Another Neat Tool” and is similar in concept to older build tools like
make under Unix and gmake under Linux. However, Ant is XML-based, it’s eas-
ier to use, and it’s platform independent.
Ant is written in Java and accepts instructions from XML documents. Ant is
well suited for performing complicated and repetitive tasks. Creator uses Ant
to compile and deploy your web applications. Ant gets its instructions for
building a system from the configuration file, build.xml. You won’t have to
know too much about Ant to use Creator, but you should be aware that it’s
behind the scenes doing a lot of work for you.

1.12 Web Services


Web services are software APIs that are accessible over a network in a hetero-
geneous environment. Network accessibility is achieved by means of a set of
XML-based open standards such as the Web Services Description Language
(WSDL), the Simple Object Access Protocol (SOAP), and Universal Description,
Discovery, and Integration (UDDI). Web service providers and clients use these
standards to define, publish, and access web services.
Creator’s application server (J2EE 1.4) provides support for web services. In
Creator, you can access methods of a web service by dragging its node onto the
design canvas. We show you web services with Creator in Chapter 10.

1.13 Enterprise JavaBeans (EJB)


EJB is a component technology that helps developers create business objects in
the middle tier. These business objects (enterprise beans) consist of fields and
methods that implement business logic. EJBs are server-side components writ-
ten in Java that serve as building blocks for enterprise systems. They perform
specific tasks by themselves, or forward operations to other enterprise beans.
EJBs are under control of the J2EE application server. We show you how to
access an EJB from a Creator application in Chapter 11.
1.14 Portlets 19

1.14 Portlets
A portlet is an application that runs on a web site managed by a server called a
portal. A portal server manages multiple portlet applications, displaying them
on the web page together. Each portlet consumes a fragment of the page and
manages its own information and user interaction. Portlet application develop-
ers will typically target portlets to run under portals provided by various por-
tal vendors.
You can use Creator to develop portlets. Creator builds JSF portlets. This
means your design-time experience in building portlet web application using
the visual, drag-and-drop features of Creator will be familiar. Most of the inter-
action with the IDE is exactly the same as it is for non-portlet JSF projects. We
show you how to create portlets in Chapter 12.

1.15 Key Point Summary


• Creator is an IDE built on layered Java technologies that helps you build
web applications.
• Procedure-oriented languages separate data and functions, whereas object-
oriented languages combine them.
• Encapsulation enforces data hiding and allows you to control access to your
objects.
• Java is a strongly typed object-oriented language with a large set of APIs
that help you develop portable web applications.
• In Java, operator new returns a reference to a newly created object so that
you can call methods with the reference.
• Java classes have fields, constructors, and instance methods. The private
keyword is used for encapsulation, and the public keyword grants access to
clients.
• Java packages allow you to store class files and retrieve them with import
statements in Java programs.
• Java uses try, catch, and throw to handle error conditions with a built-in
exception handling mechanism.
• Inheritance is a code reuse mechanism that implements an “is a”
relationship between classes.
• Dynamically bound method calls are resolved at run time in Java. Dynamic
binding is essential with distributed web applications.
• An interface has no fields and only abstract public methods. A class that
implements an interface must provide code for the interface’s methods.
• The J2EE architecture is a multitiered application model to develop
distributed components.
20 Chapter 1 Java Technology Overview

• Java Servlets let you define HTTP-specific servlet classes that accept data
from clients and pass them on to business objects for processing.
• A JSP page is a text-based document interspersed with Java code that allows
you to create dynamic web pages.
• JDBC is an API for database access from servlets, JSP pages, or JSF. Creator
uses data providers to introduce a level of abstraction between Creator UI
components and sources of data.
• JavaServer Faces (JSF) helps you develop web applications using a server-
side user interface component framework. Creator generates and manages
all of the configuration files required by JSF.
• A JavaBeans component is a Java class with a default constructor and setter
and getter methods to manipulate its properties.
• NetBeans is a standards-based IDE and platform written in the Java
programming language. Java Studio Creator is based on the NetBeans
platform.
• XML is a self-describing, text-based language that documents data and
makes it easy to transport between systems.
• Ant is a Java build tool that helps you compile and deploy web applications.
• Web services are software APIs that are accessible over a network in a
heterogeneous environment.
• EJBs are server-side components written in Java that implement business
logic and serve as building blocks for enterprise systems.
• Portlets are applications that consume a portion of a web page. They run on
web sites managed by a portal server and execute along with other portlets
on the page.
• Portlets help divide web pages into smaller, more manageable fragments.
CREATOR BASICS

Topics in This Chapter

• Creator Window Layout


• Visual Design Editor
• Components and Clips Palette
• Source Editors/Code Completion
• Page Navigation Editor
• Outline Window
• Projects Window
• Servers and Resources
• Creator Help System
• Basic Project Building
Chapter

un Java Studio Creator makes it easy to work with web applications

S from multiple points of view. This chapter explores some of Creator’s


basic capabilities, the different windows (views) and the way in which
you use them to build your application. We show you how to manipu-
late your application through the drag-and-drop mechanism for placing com-
ponents, configuring components in the Properties window, controlling page
flow with the Page Navigation editor, and selecting services from the Servers
window.

2.1 Examples Installation


We assume that you’ve successfully installed Creator. The best source of infor-
mation for installing Creator is Sun’s product information page at the following
URL.

http://developers.sun.com/prodtech/javatools/jscreator/

Creator runs on a variety of platforms and can be configured with different


application servers and JDBC database drivers. However, to run all our exam-
ples we’ve used the bundled application server (Sun Java System Application
Server 8.2) and the bundled database server (Derby). Once you’ve configured

23
24 Chapter 2 Creator Basics

Creator for your system, the examples you build here should run the same on
your system.

Download Examples
You can download the examples for this book at the Sun Creator web site. The
examples are packed in a zip file. When you unzip the file, you’ll see the
FieldGuide2/Examples directory and subdirectories for the various chapters
and projects. As each chapter references the examples, you will be instructed
on how to access the files.
You’re now ready to start the tour of Creator.

2.2 Creator Views


Figure 2–1 shows Creator’s initial window layout in its default configuration.
When you first bring it up, no projects are open and Creator displays its Wel-
come window.
There are other windows besides those shown in the initial window layout.
As you’ll see, you can hide and display windows, as well as move them
around. As we begin this tour of Creator, you’ll probably want to run Creator
while reading the text.

Welcome Window
The Welcome window lets you create new projects or work on existing ones.
Figure 2–2 shows the Welcome window in more detail. It lists the projects
you’ve worked on recently and offers selection buttons for opening existing
projects or creating new projects. If you hover with the mouse over a recently
opened project name, Creator displays the full pathname of the project in a
tooltip.
To demonstrate Creator, let’s open a project that we’ve already built. The
project is included in the book’s download bundle, in directory FieldGuide2/
Examples/Navigation/Projects/Login1.

Creator Tip

We show you how to build this project from scratch in Chapter 5 (see
“Dynamic Navigation” on page 206). For our tour of the IDE, however, we’ll
use the pre-built project from the examples download.
2.2 Creator Views 25

Main Menu Servers View Properties Window


Bar Palette
Tool Icons Files View

Outline View Welcome Window Projects View


Status Bar
Navigator View
Dynamic Help

Figure 2–1 Creator’s initial window layout

1. Select the Open Existing Project button and browse to the FieldGuide2/
Examples/Navigation/Projects directory.
2. Select Login1 (look for the projects icon) and click Open Project Folder. This
opens the Login1 project in the Creator IDE.
3. Page1 should display in the visual editor, as shown in Figure 2–3. If Page1
does not open in the design editor, find the Projects view (its default posi-
tion is on the right, under the Properties view).
4. In the Projects view, expand node Login1, then Web Pages. Double-click
Page1.jsp. Page1 should now appear in the design editor.
26 Chapter 2 Creator Basics

Figure 2–2 Creator’s Welcome window

Design Editor
Figure 2–3 shows a close-up of the design canvas (the visual design editor) of
Page1. You see the design grid and the components we’ve placed on the can-
vas. The design editor lets you visually populate the page with components.
Page1 contains a “virtual form.” Virtual forms are accessible on a page by
selecting the Show Virtual Forms icon on the editing toolbar, as shown in
Figure 2–3. Virtual forms let you assign different components to different
actions on the page. We show you how to use virtual forms in “Configure Vir-
tual Forms” on page 216 (for project Login1 in Chapter 5) and in “Virtual
Forms” on page 419 (for project MusicAdd in Chapter 9).
Select the text field component. The design canvas marks the component
with selection and resizing handles. Now move the text field component
around on the grid. You’ll note that it snaps to the gird marks automatically
when you release the mouse. You can temporarily disable the snap to grid fea-
ture by moving the component and pressing the <Shift> key at the same time.
You can also select more than one component at a time (use <Shift-Click>) and
2.2 Creator Views 27

Editing Toolbar File Tab Design Grid


Show Virtual
Forms Toggle

Label Text Field

Message
Password Field

Button Virtual Form


Designation

Design Canvas

Figure 2–3 Creator’s design canvas showing project Login1

Creator provides options to align components. We cover the mechanics of page


design in Chapter 7 (see “Using the Visual Design Editor” on page 273).
Note that when you make modifications to a page, Creator indicates that
changes have been made to the project by appending an asterisk to the file
name tab. Once you save your project by clicking the Save All icon in the tool-
bar (or selecting File > Save All from the main menu), the Save All icon is dis-
abled and the asterisk is cleared from the file name tab.
Typically applications consist of more than one page. You can have more
than one of your project’s pages open at a time (currently, there’s just one page
open). When you open other files, a file tab appears at the top of the editor
pane. The file tab lets you select other files to display in the editor pane.
Creator lets you configure your display’s workspace to suit the tasks you’re
working on. All the windows can be hidden when not needed (click the small x
in a window’s title bar to close it) and moved (grab the window’s title bar and
move it to a new location). To view a hidden window, select View from the
menu bar and then the window name. Figure 2–4 shows the View menu with
the various windows you can open, along with a key stroke shortcut for open-
ing each window.
You can also dock Creator windows by selecting the pushpin in the window
title bar. This action minimizes the window along the left or right side of the
28 Chapter 2 Creator Basics

Figure 2–4 Creator’s View Menu allows you to select specific views of your project

workspace. Make it visible again by moving the cursor over its docked posi-
tion. Toggling the pushpin icon undocks the window. Figure 2–5 shows the
Properties view with both the Projects and Files windows docked.

Properties
As you select individual components, their properties appear in the Properties
window. Select the text field component on the design canvas. This brings up
its Properties window, as shown in Figure 2–5.
Creator lets you configure the components you use by manipulating their
properties. When you change a component’s properties, Creator automatically
updates the underlying JSP source for you. Let’s look at several properties of
the text field component. If you hold the cursor over any property value, Cre-
ator displays its setting in a tooltip.
Components have many properties in common; other properties are unique
to the specific component type. The id property uniquely identifies the compo-
nent on the page. Creator generates the name for you, but you can change it (as
we have in this example) to more easily work with generated code. The label
property enables you to specify a textual label associated with the text field.
The red asterisk next to the label in the design view indicates that input is
2.2 Creator Views 29

Component label text


Identifier (id)

Files and Projects


views docked

Style Attributes
Property Customizer
Box

input is required

Event Handler
Method

toolTip text

JavaScript
Settings

Figure 2–5 Properties window for text field component “userName”

required for this component. Property text holds the text that the user sub-
mits. You can use the style property to change a component’s appearance. The
style property’s position tag reflects the component’s position on the page.
When you move the component in the design view, Creator updates this for
you.
Property styleClass takes previously defined CSS style classes (you can
apply more than one). File stylesheet.css (under Web Pages > resources in the
Projects window) is the default style sheet for your projects. We cover style,
styleClass and using Creator’s preconfigured Themes in Chapter 7.
Text field components can take a converter (specified in property con-
verter) and a validator (property validator). The validate and valueChange
properties (under Events) expect method names and are used to provide cus-
tom validation or to process input when the component’s text value changes.
30 Chapter 2 Creator Basics

Click on the text field component (again) in the design canvas until Creator
displays a gray outline around the component. Now type in some text and fin-
ish editing with <Enter>. The text you type appears opposite property text in
the Properties window. To reset the property, click the customizer box opposite
property text. Creator pops up a Property Customizer dialog, as shown in
Figure 2–6. Select Unset Property. This is a handy way to return a property
value to its unset state.

Figure 2–6 Property customizer dialog for property text

Each property’s customizer is tailored to the specific property. For example,


select the Login button on the design canvas. In the Properties window, click
the property customizer box opposite property style. Creator pops up an
elaborate style editor. Experiment with some of the settings (change the font
style or color, for example) and see how the button changes in the design view.
You can also preview the look. Right-click inside the design view and select
Preview in Browser. Figure 2–7 shows a preview of Login1 with a different
appearance for the Login button.

Palette
Creator provides a rich set of basic components, as well as special-function
components such as Calendar, File Upload, Tab Set, and Tree. The palette is
divided into sections that can be expanded or collapsed. Figure 2–8 shows the
Basic Components palette, which includes all of the components on Page1 of
project Login1. In Figure 2–8 you also see the Layout and Composite Compo-
nents palette.
The palette lets you drag and drop components on the page of your applica-
tion. Once a component is on a page, you can reposition it with the mouse or
configure it with the Properties window.
Figure 2–9 shows the Validators and Converters palette. Creator’s converters
and validators let you specify how to convert and validate input. Because con-
2.2 Creator Views 31

Figure 2–7 Preview in Browser for Login1

Figure 2–8 Basic, Layout and Composite Components palette


32 Chapter 2 Creator Basics

version and validation are built into the JSF application model, developers can
concentrate on providing event handling code for valid input.

Figure 2–9 Creator Validators and Converters Components palette

You select converters and validators just like the UI components. When you
drag one to the canvas and drop it on top of a component, the validator or con-
verter binds to that component. To test this, select the Length Validator and
drop it on top of the userName text field component. You’ll see a length valida-
tor lengthValidator1 defined for the text field’s validator property in the
Properties window.
Note that components, validators, and converters all have associated icons
in the palette. Creator uses these icons consistently so you can easily spot what
kind of component you’re working with. For example, select the Login button
component on the design canvas and examine the Outline view. You’ll see that
the icon next to the button components (Login and Reset) matches component
Button in the Basic Components palette.

Outline
Figure 2–10 is the Page1 Outline view for project Login1. (Its default placement
is in the lower-left portion of the display.) The Outline window is handy for
showing both visual and nonvisual components for the page that’s currently
2.2 Creator Views 33

displayed in the design canvas. You can select the preconfigured managed
beans, RequestBean1, SessionBean1 and ApplicationBean1. These JavaBeans
components hold your project’s data that belong in either request (page), ses-
sion or application scope, respectively. (We discuss scope issues for web appli-
cation objects in “Scope of Web Applications” on page 224.)

Text Field Component “userName”

Length Validator “lengthValidator1”

Managed Bean RequestBean1


Managed Bean SessionBean1
Managed Bean ApplicationBean1

Figure 2–10 Creator’s Outline window for project Login1

Some components are composite components (they contain nested ele-


ments). The Outline window shows composite components as nodes that you
can expand and compress with ‘+’ and ‘-’ as needed. Suppose, for example, you
select grid panel for layout. When you add components to this grid panel, they
appear nested underneath the panel component in the Outline view.
The length validator component on the userName text field appears as com-
ponent lengthValidator1 in the Outline view. Select the length validator and
examine it in the Properties view. Specify values for properties maximum (use
10) and minimum (use 3). This limits input for the userName text field compo-
nent to a string that is between 3 and 10 characters long.
Now let’s look at the Projects window.

Projects
Figure 2–11 shows the Projects window for project Login1. Its default location
is in the lower-right corner. Whereas the Outline view displays components for
individual pages and managed beans, the Projects window displays your
entire project, organized in a logical hierarchy. (Since Creator lets you open
more than one project at a time, the Projects window displays all currently
opened projects.) Project Login1 contains three JSP pages under the Web Pages
node: Page1.jsp, LoginGood.jsp, and LoginBad.jsp. Double-click any one of
34 Chapter 2 Creator Basics

them to bring it up in the design canvas. When the page opens, Creator dis-
plays a file name tab so you can easily switch among different open files in the
design canvas.

Figure 2–11 Creator’s Project Navigator window for project Login1

When you create your own projects, each page has its own Java component
“page bean.” These are Java classes that conform to the JavaBeans structure we
mention in Chapter 1 (see “JavaBeans Components” on page 13). To see the
Java files in this project, expand the Source Packages node (click on the ‘+’),
then the login1 folder. When you double-click on any of the Java files, Creator
brings it up in the Java source editor. (We’ll examine the Java source editor
shortly.) Without going to the editor, you can also see Java classes, fields, con-
structors, and methods by expanding the ‘+’ next to each level of the Java file.
The Projects view displays Creator’s “scoped beans.” These are pre-config-
ured JavaBeans components that store data for your project in different scopes.
You can use request scope (Request Bean), application scope (Application
Bean), or session scope (Session Bean). Many of the projects in this text add
properties to these beans. We discuss JSF scoping issues in Chapter 6 (see “Pre-
defined Creator Java Objects” on page 226).
2.2 Creator Views 35

The Projects view also lists the resources node, which lives under the Web
Pages node. The resources node typically holds file stylesheet.css and any
image files. Creator uses the libraries listed in the Libraries node to display,
build, and deploy your application. These class files (compiled Java classes) are
stored in special archive files called JAR (Java Archive) files. You can see the
name, as well as the contents (down to the field and method names) of any JAR
file by expanding the nodes under Libraries. We show you how to add a JAR
file to your project in Chapter 13 (see “Add the asg.jar Jar File” on page 595).

Files
The Projects window shows you a logical view of your project. Sometimes you
may need to access a configuration file that is not included in the Projects view.
In such a case, use the Files view, as shown in Figure 2–12.

Figure 2–12 Files view for project Login1

The Files view shows all of the files in your project. For example, expand
node web > WEB-INF and double-click file web.xml. Creator brings up file
web.xml in a specialized Creator-configuration XML editor, as shown in
Figure 2–13.
36 Chapter 2 Creator Basics

Figure 2–13 Editing file web.xml

File web.xml lets you set various project-level configuration parameters,


such as Session Timeout, Filters, or special error pages. Close this file by click-
ing the small x in the web.xml file tab.

JSP Editor
As you drop components on the page and configure them with the Properties
window, Creator generates JSP source code for your application. You can view
the JSP representation of a page by clicking the JSP button in the editing tool-
bar, as shown in Figure 2–14.
Normally, you will not need to edit this page directly, but studying it is a
good way to understand how Creator UI components work and how to man-
age their properties. You’ll see a close correspondence between the JSP tags
and the components’ properties as shown in the Properties window. If you do
edit the JSP source directly, you can easily return to the design view. Creator
always keeps the design view synchronized with the JSP source.
Tags in the JSP source use a JSF Expression Language (EL) to refer to meth-
ods and properties in the Java page bean. For example, the login button’s
action property is set to #{Page1.login_action}, which references method
login_action() in class Page1.java.
Creator also generates and maintains code for the “page bean,” the Java
backing code generated for each page. Let’s look at the Java source for
Page1.java now.
2.2 Creator Views 37

JSP
button

Creator
UI
Components

Figure 2–14 Page1.jsp XML Editor

Java Source Editor


Click the Design button and return to the Page1 design view. As you build your
application, not only does Creator generate JSP source that defines and config-
ures your component, but it also maintains the page bean. For example, Cre-
ator makes it easy for you to code event handlers (methods that perform
customized tasks when the user selects an option from a drop down list or
clicks a button). Double-click button Login in the design view. Creator gener-
ates a default event handler for this button and puts the cursor at the method in
the Java source editor. If this method was previously generated (as it was here),
Creator brings up the editor and puts the cursor at the method, as shown in
Figure 2–15. Here you see method login_action() in file Page1.java.
You can always bring up a page’s Java code by selecting the Java button in
the editing toolbar. This Java file is a bean (conforming to a JavaBeans struc-
ture) and its properties consist of the components you place on the page. Each
38 Chapter 2 Creator Basics

Java
Button

Login
Button
Event
Handler

Reset
Button
Event
Handler

Code
Folding
Handle

Figure 2–15 Page1.java in Java source editor

component corresponds to a private variable and has a getter and setter. This
allows the JSF EL expression to access properties of the page bean.
All of Creator’s editors are based on NetBeans. The Editor Module is a full-
featured source editor and provides code completion (we show an example
shortly), a set of abbreviations, and fast import with <Alt-Shift-I>. The editor
also has several useful commands: Reformat Code (handy when pasting code
from an external source), Fix Imports (adds needed import statements as well
as removes unused ones), and Show Javadoc (displays documentation for
classes and methods). There are more selections in the context menu (right-
click inside the editor to see the menu). Sections of the Creator-generated code
are folded by default to help keep the editing pane uncluttered. You can unfold
(select ‘+’) or fold (select ‘-’) sections as you work with the source code.
To see the set of abbreviations for the Java editor, select Tools > Options from
the main menu bar. The Options dialog pops up. Under Options, select Editing
> Editor Settings > Java Editor. On the right side of the display, click the small
2.2 Creator Views 39

editing box next to Abbreviations. Creator pops up the window shown in


Figure 2–16.

Figure 2–16 Java source editor list of abbreviations

The window lists the abbreviations in effect for your Java editor. (You can
edit, add, or remove any item.) For example, to place a for loop in your Java
source file, type the sequence fora (for array) followed by <Space>. The editor
generates

for (int i = 0; i < .length; i++) {


}

and places the cursor in front of .length so that you can add an array name.
(.length refers to the length of the array object. This code snippet lets you eas-
ily loop through the elements of the array.)
The Java source editor also helps you with Java syntax and code completion.
All Java keywords are bold, and variables and literal Strings have unique col-
ors.
40 Chapter 2 Creator Basics

When you add statements to your Java source code, the editor dynamically
marks syntax errors (in red, of course). The editor also pops up windows to
help with code completion and package location for classes you need to refer-
ence (press <Ctrl-Space> to activate the code completion window). If available,
code completion includes Javadoc help. For example, Figure 2–17 shows the
code completion mechanism as you highlight method equals() and press
<Ctrl-Space>.

Figure 2–17 Java source editor code completion

When you use the down-arrow to select the second method, equalsIgnore-
Case(), the help mechanism displays its Javadoc documentation. (To retrieve
Javadoc documentation on any class in your source file, select it and press
<Ctrl-Shift-Space>.) The Java Source editor is discussed in more detail in Chap-
ter 4 (see “Using the Java Source Editor” on page 136).
When the Java source editor is active, Creator also activates the Navigator
window, as shown in Figure 2–18. The Navigator window lets you go to a
method or field within the Java source editor by clicking its name in the win-
dow. In Figure 2–18, the cursor hovers over method destroy(), displaying
help in a tooltip.
2.2 Creator Views 41

Figure 2–18 Navigator view and help for method destroy() displayed

Code Clips Palette


When the Java Source editor is displayed, Creator replaces the Components
palette with the Code Clips palette, as shown in Figure 2–19. Here we show
several sections, including the code clips for Application Data. Highlight clip
Store Value in Session in this section. If you hold the cursor over the clip name,
Creator displays a snippet window. You can drag and drop the clip directly
into your Java source file.
To view or edit a clip, select it, right-click, and choose Edit Code Clip.
Figure 2–20 shows the Store Value in Session code clip.
The Code Clips palette is divided into categories to show sample code for
different programming tasks. For example, if you click Application Data, you’ll
see a listing of clips that let you access application data from different scopes in
your web application.
42 Chapter 2 Creator Basics

Figure 2–19 Java Clips Palette

Figure 2–20 Code Clips Editor


2.2 Creator Views 43

Page Navigation Editor


Return to the Java Source window and examine method login_action().
You’ll see that login_action() returns one of two Strings (either "loginFail"
or "loginSuccess") to the action event handler. The action event handler then
passes the String on to the navigation handler to determine page flow. Let’s
look at the Page Navigation editor now.

1. From the top of the Java source window, select the Design button. This
returns you to the design canvas for this page.
2. Now right-click in the design canvas and select Page Navigation from the
context menu. Creator brings up the Page Navigation editor for project
Login1, as shown in Figure 2–21.

Figure 2–21 Page navigation editor for project Login1

There are three pages in this project. The Page Navigation editor displays
each page and indicates page flow logic with labeled arrows. The two labels
originating from page Page1.jsp correspond to the return Strings in action
method login_action().
Chapter 5 shows you how to specify navigation in your applications (see
“Page Navigation” on page 188). The Page Navigation editor is also a handy
way to bring up any of the project’s pages: just double-click inside the page.
Once you’ve visited the Page Navigation editor, Creator displays a file tab
called Page Navigation so you can easily return to it.
44 Chapter 2 Creator Basics

Before we explore our project any further, let’s have you deploy and run the
application. From the menu bar, select Run > Run Main Project. (Or, click the
green Run arrow on the icon toolbar, which also builds and runs your project.)

Output Window
Figure 2–22 shows the output window after building and deploying project
Login1. Creator uses the Ant build tool to control project builds. This Ant build
process requires compiling Java source files and assembling resources used by
the project into an archive file called a WAR (Web Archive) file. Ant reads its
instructions from a Creator-generated XML configuration file, called
build.xml, in the project’s directory structure.

Figure 2–22 Output window after building and deploying project Login1

If problems occur during the build process, Creator displays messages in the
Output window. A compilation error with the Java source is the type of error
that causes the build to fail. When a build succeeds (the window shows BUILD
SUCCESSFUL, as you see Figure 2–22), Creator tells the application server to
deploy the application. If the application server is not running, Creator starts it
for you. If errors occur in this step, messages appear in the Outline window
from the application server.
Finally, it’s possible that the deployment is successful but a runtime error
occurs. In this situation, the system throws an exception and displays a stack
trace on the browser’s web page. Likely sources for these errors are problems
with JSF tags on the JSP page, resources that are not available for the runtime
class loader, or objects that have not been properly initialized.
2.2 Creator Views 45

When the build/deployment process is complete, Creator brings up your


browser with the correct URL. (Here the status window displays “Browsing:
http://localhost:28080/Login1/.”) To run project Login1 with the Sun
bundled Application Server, Creator generates this web address.

http://localhost:28080/Login1/

You use localhost if you’re running the application server on your own
machine; otherwise, use the Internet address or host name where the server is
running. The port number 28080 is unique to Sun’s bundled J2EE application
server. Other servers will use a different port number here.
Note that the Context Root is /Login1 for this application. The application
server builds a directory structure for each deployed application; the context
root is the “base address” for all the resources that your application uses.
Figure 2–23 shows the Login1 project deployed and running in a browser.
The Password field’s tooltip is displayed. Both the User Name and Password
input fields have asterisks, indicating required input. Type in some values for
User Name and Password. If you leave the User Name field empty or type less
than 3 characters or more than 10, you’ll get a validation error. (The minimum
and maximum number of characters only apply if you added a length validator
earlier.) The correct User Name and Password is “rave4u” for both fields.

Figure 2–23 Project Login1 running in a browser

If you supply the correct values and click the Login button, the program dis-
plays page LoginGood.jsp. Incorrect values display LoginBad.jsp.
46 Chapter 2 Creator Basics

It’s time now to explore the Servers window, located in the upper-left por-
tion of your Creator display. Click the tab labeled Servers to see this window.

Servers
Figure 2–24 shows the Servers window after you’ve deployed project Login1.
Various categories of servers are listed here, including Data Sources, Enterprise
JavaBeans, Web Services, Deployment Server, Remote Deployment Servers,
and Bundled Database Server.

Deployed project Login1

Figure 2–24 Servers window

The Data Sources node is a JDBC database connection. Creator bundles a


database server and the Data Sources node connects to the bundled database
by default. You can configure a different database. Creator comes configured
with several sample databases, which are visible if you expand the Data
Sources node.
Random documents with unrelated
content Scribd suggests to you:
XX. Where a Jew comes from Another Country into any of the Provinces
of Our Kingdom, he Must, at once, Present himself before a Bishop,
a Priest, or a Judge; and What shall be Done under the
Circumstances.
XXI. How Assemblies of Jews shall Visit the Bishop on Appointed Days.
XXII. Where Anyone has a Jew in his Service, and a Priest Demands him,
the Master shall not have a Right to Retain said Jew.
XXIII. All Restraint of and Control over the Jews shall be Vested in the
Priesthood.
XXIV. Concerning the Penalties to be Imposed upon Priests and Judges who
Neglect to Enforce the Laws against the Jews.
XXV. No Judge shall Presume to Investigate the Offences of the Jews
without the Knowledge of an Ecclesiastic.
XXVI. Bishops shall be Immune from Punishment, when their Priests do not
Inform them of Such Things as Should be Corrected.
XXVII. Concerning the Mercy to be Shown by Princes towards Those who
have been Truly Converted to the Christian Faith.
XXVIII. Bishops shall Give to all Jews a Copy of this Book, which has been
Published for the Purpose of Correcting their Errors; and their
Confessions and a Record of their Conversion, shall be Deposited
among the Archives of the Church.

I. Concerning Old Laws Enacted Against the


Transgressions of the Jews, and the Confirmation of the
Same.
The perfidy and cunning of the Jewish heresy increases in
criminality, in the same proportion as attempts are made to abolish it
by law. And, as we are about to promulgate new edicts for the
suppression of these errors, it is now proper to first confirm those
which have been enacted by our predecessors; and in order the
better to adapt the same to the offences of the Jews, it is necessary
for us to revise all preceding edicts; so that, in this way, the new
laws being collated with the old ones, those which should be
approved may be confirmed, as is fitting; and, at the same time, the
new statutes may be drawn up so that they shall not conflict with
those already in force, but that all may be united, and the entire
body of laws made clear for the administration of justice. Thus,
whenever edicts already in force may be judged worthy of
confirmation, and whatever new edicts we may think it advisable to
promulgate, may both become more manifest, and, in this manner,
by the application of both classes of laws, the truth may be the more
readily established. For example, we have found a law among those
formerly promulgated, which declares that all heresy must be
eradicated. It is reasonable and evident, however, that this must be
added to and amended, in such a way that if anyone induced by the
insanity of unbelief should treat with contempt any of its provisions,
no matter to what rank or station he may belong, and should
attempt to defend any perverse dogma in public, he shall be
subjected to severe penance, exiled, and his property confiscated for
the benefit of the king; and even if he should, at any time, renounce
the errors of his perverse sect, he shall under no circumstances be
permitted to return from exile; and his property shall be irrevocably
held by those upon whom the king has bestowed it. Where any Jew,
deluded by blind ignorance, retains the errors of his sect in his heart,
and evinces a disposition to defend the same, either by word or
deed, he must go to the bishop, or some priest of the district, for
instruction; and the latter must explain to him the precepts of
religion, and, with the consent of the metropolitan, also give him the
formulas of doctrine and the rules of faith. If any heretic, after
having been instructed as aforesaid, should still persist in his error,
he shall be liable to the penalty imposed by a preceding law; that is
to say, the one which is provided for those who publicly defend their
own sect, in opposition to our religion. And we hereby especially
confirm such laws as are directed against the offences of the Jews,
to wit: such as have been enacted concerning the wickedness of the
Jews, or for the purpose of eradicating their errors. Thus, Jews shall
no longer celebrate the Passover, according to their customs; or
presume to marry, as formerly; or practise circumcision; or
distinguish food as clean and unclean; or presume to torture
Christians, or to testify against them, and no Jew shall circumcise a
Christian slave. All Christian slaves who have been either sold or set
at liberty by Jews, shall at once receive their freedom
unconditionally, and under no circumstances shall a Christian slave
remain in the service of a Jew. Concerning the law by which all
Christians are forbidden to protect a Jew, we decree that no
Christian, under any circumstances, by any act or favor, shall
attempt to shelter or defend a Jew; or shall presume to conceal a
judaizing Christian. We, therefore, decree that the severe laws
formerly promulgated to suppress the perfidy of the aforesaid Jews
shall remain in force, for all time; with the exception of such as are
referred to in the two following chapters, which have been found to
be contradictory to the others, as well as opposed to the principles
of justice, and to our ordinances; and we hereby declare, in the
plenitude of our wisdom, that said laws shall remain irrevocable and
forever in force, provided they in no wise conflict with such others as
we may hereafter promulgate. In respect to such edicts as seem to
us improper and conflicting, the following two are repugnant to
reason and to our institutions; wherefore they shall, henceforth, not
be observed and shall have no force or effect in law. The first of
these is that whereby the detestable power of liberating Christian
slaves is bestowed upon the Jews. The second we condemn,
because it subjects to the same penalty those who are guilty of
different offences. While there are different degrees of guilt
according to the laws, the latter do not always impose different
penalties, but many crimes are treated alike, and each offence is not
punished according to the measure of its guilt; for it is evident that
crimes of greater and less gravity should not be punished in the
same manner; especially as our Lord has said in the Divine Law that
the penalty shall be in proportion to the offence; and, therefore, this
law which prescribes the penalty to be inflicted for the
transgressions of the Jews shall be hereafter considered of no
validity and effect; for the reason that God does not desire the death
of His creatures or rejoice in their perdition, but wishes that they
may live in Him through their redemption. Henceforth we shall
devote ourselves to the restraining of all malice; to the suppression
of infidelity; and to the eradication of all profane doctrines; and we
shall boldly resist the attacks of our enemies, and overwhelm them
with the weapons of Divine power.

II. Concerning Blasphemers Against the Holy Trinity.


If God in the Holy Scriptures, declares that whoever insults his
brother is worthy of punishment, and as the sentence of Divine
justice condemns him as a still greater transgressor who sins against
the Holy Spirit, how much more unpardonable shall he be who, in
the future, shall denounce the Saviour Himself! Therefore, if anyone
should blaspheme the name of Christ, the Son of God, and speak
with contempt of His holy body and blood as a sacrament, and
should refuse to partake of the same, or, having partaken of it,
should cast it away; or should utter any blasphemy against the Holy
Trinity, that is to say, against the Father, Son, and Holy Ghost; the
blasphemer shall have his head shaved, and receive a hundred
lashes, by order of the priest or judge in whose diocese or district
said crime was committed, and the culprit shall also be placed in
chains, and be condemned to endure the misery of exile. The
property of said offender shall be given to the king, and shall remain
irrevocably in the possession of those upon whom he may choose to
bestow it.
ERVIGIUS, KING.
III. Jews shall not Absent themselves, or Remove their
Children or Slaves, to Avoid the Blessing of Baptism.
While Divine truth teaches us to seek, to investigate, and to
knock at the door, that it may be opened unto us, admonishing us,
at the same time, that violent men shall not inherit the kingdom of
Heaven, it is evident that those will not merit Divine favor, who do
not exert themselves to that end, with their entire hearts.
Henceforth, where any Jew of those who have not yet been
baptized, or have themselves delayed their own baptism; or have,
under any pretext, neglected to send their children or slaves to the
priest, in order to be baptized; or have removed their slaves in order
to avoid their baptism; and the said Jew, after the lapse of one year
from the promulgation of this law, shall not have been baptized; said
transgressor, whoever he may be, shall receive a hundred lashes,
and, having had his head shaved, shall be driven into exile. His
property shall be forfeited to the king, and shall be bestowed upon
whomever he may direct, as the life of said Jew has shown him to
be obstinate and incorrigible.
ERVIGIUS, KING.
IV. Jews shall not Celebrate the Passover According to
their Customs, or Practice Circumcision, or Induce any
Christian to Renounce the Church of Christ.
If the obstinate perfidy of the Jews had observed the law, and
the substance rather than the shadow of the truth, the crucifixion of
the Lord of Glory would never have occurred. For our Passover is
designated by the sacrifice of Christ; and if He rejoices in the
circumcision of our hearts, that symbolic operation ought in no way
to be performed in the flesh; for the prophet has said, “Circumcise
the Lord, and remove the prepuce from your hearts.” Therefore we,
not regarding the shadow of truth aforesaid, but relying upon the
promises of truth itself, decree that the following shall be observed:
that when any Jew celebrates the Passover according to the rites of
his religion, he shall receive a hundred lashes, be scalped, and be
driven into perpetual exile, and his property shall be confiscated for
the benefit of the royal treasury. Whoever shall circumcise either a
Jew or a Christian, shall be mutilated;[55] and his property shall be
confiscated for the use of the royal treasury. Should any woman
presume to practise the operation of circumcision, or should present
anyone to another person to be circumcised, she shall have her nose
cut off, and all her property shall be given to the king. They, also,
shall undergo a similar penalty who cause a Christian man or woman
to renounce the faith of Christ, or induce anyone to return to the
practice of the false doctrines of the Jews.

V. Jews shall not Presume to Keep the Sabbath, or


Celebrate Festival Days, According to their Ritual.
The delusive phantoms of error having disappeared, it is now
incumbent upon us to labor unceasingly; for what other course is
open to the lovers of truth? The Lord, speaking by the mouth of His
prophet, has denounced this heresy in the following terms: “My soul
abhors your Passover, your Sabbath, and all your ceremonies.”
Wherefore, as we have been admonished by the apostle, that we
should rather act according to the new spirit, than follow the ancient
letter of the law, we hereby, in all faith and earnestness, give notice
to the infidels, that if any Jew should presume to celebrate the
appearance of the new moon, or the Festival of Tabernacles, or the
Sabbath, or any holidays, or should observe any other rites or
ceremonies of his worship, he shall receive a hundred lashes, shall
have his head shaved, and shall be subjected to the misery of exile,
and all his property shall be forfeited to the king; with the condition,
however, that should he be converted at any time, it may be
restored to him; but if not, it shall remain in the possession of those
upon whom it has been bestowed.

VI. Every Jew shall Cease from Labor on Sunday, and on


all Appointed Holidays.
There is no doubt that he is plainly an enemy of the Catholic
religion who does not treat Sunday with due reverence. Hence, while
we are pursuing those who deny or disobey our faith, we hereby
decree with Divine sanction, that if any Jew, of either sex, should do
any work on Christmas, or on any other sacred holiday, or on
Sunday, or should spin, or weave, or perform any labor beyond that
which the honorable custom of good Christians permits; such a
transgressor shall have his head shaved, and shall receive a hundred
lashes for his insolence; and where slaves, of either sex, are found
occupied in such labors, they, also, shall be liable to the punishment
aforesaid. The masters of said slaves, where they permit them to
labor in this manner, shall be compelled to pay a hundred solidi to
the royal treasury. Those days which shall be devoutly observed by
the Jews, are the following, to wit: the Festival of the Holy Virgin
Mary, during which the glorious Conception is celebrated; the
Festivals of the Nativity and Circumcision; Holy Week and Easter; the
day of the Discovery of the Cross; the Day of the Ascension;
Pentecost; Sundays throughout the entire year; and all the days that
are venerated by true believers in the doctrines of Christ.
VII. Jews shall not make any Distinction in their Food,
According to their Custom.
The detestible Jewish custom, viler than any other superstition,
dividing food into clean and unclean, accepts the former, while it
rejects the latter. Whoever is convicted of the commission of the
error of this practice, that is to say, who acts differently from the
custom observed, under similar circumstances, by all true Christians,
shall receive a hundred lashes and be scalped, by order of the judge
in whose district the offence was committed. The provisions of this
law shall be observed in every respect concerning drink, as well as
food; and the punishment hereinbefore specified shall be inflicted
upon all who abstain from the wines or other beverages of
Christians. In regard to the flesh of swine, we hereby decree that no
distinction shall be made on account of religious prejudice; but if any
Jew should avoid such food through natural abhorrence, and not
from a regard to the usages of their perverse sect, especially if their
behavior, in other respects, is similar to that of Christians, and if they
have embraced Christianity, and observe its rules, and are known to
be sincere believers, they shall not be liable to punishment under the
aforesaid law, merely because they have rejected the flesh of swine;
for the reason that it appears contrary to justice, that those whom
the faith of Christ has openly ennobled, should be rendered liable to
punishment on account of their rejection of a single article of food.

VIII. A Jew shall not Marry a Person Nearly Related to


him by Blood, or Contract Marriage without the Benediction
of a Priest.
No Jew, of either sex, shall be permitted to marry a relative,
either on the side of the wife or the husband, within the sixth
degree, except according to the law imposed upon Christians; nor
shall any Jew commit the crime of incest by marriage with a near
relation. Those who violate the law by such an illicit union, shall
undergo the following punishment, to wit: having been separated
from one another each party shall receive a hundred lashes; they
shall have their heads shaved, be subjected to severe penance, and
then be driven into exile; their property shall be given to such
children as they may have had by a preceding marriage—provided
the latter have been in no way contaminated with the Jewish
superstition, or polluted with the infamy of incestuous marriage. If,
however, they should have no children, or, having them, the latter
should be tainted with the Jewish error, or with the crime of incest,
as aforesaid, then the property of said offender shall be forfeited to
the king. The following, moreover, we direct shall be carefully
observed in every respect, namely: that if any Jew, of either sex,
after being converted, should desire to marry, he or she shall not be
allowed to do so, unless a dowry is given, and a marriage contract
entered into, as has been prescribed in the case of Christians; nor
shall such ceremony be permitted, where it is not accompanied with
the sacerdotal benediction within the bosom of the Church. If any
Jew should marry without the benediction of the Church, as
aforesaid, or should transgress, in any way, the provision of the law
relating to marriage contracts, said Jew, after purification by
baptism, shall be compelled to pay a hundred solidi to the king, or
shall receive fifty lashes in public. Each of the persons aforesaid, that
is to say, the husband as well as the wife, shall be liable to said
penalty or fine; and the parents of said parties shall also be liable to
the same punishment for their infraction of the law.

IX. Jews who Insult our Religion, while Attempting to


Defend their own Sect, shall not Betake themselves
Elsewhere; nor shall Anyone Shelter them while Fugitives.
If any Jew should presume to offer an insult to the Christian
religion; or, by arguments, should induce anyone to abandon the
Christian faith; or should defend the weakness of his own sect; or,
while fleeing from the doctrines of the Christian religion, should
conceal himself in any part of our kingdom; or should escape to
foreign countries, for the purpose of concealment; or if anyone
should offer a hiding-place to a transgressor of this law, knowing he
is a fugitive; any of said parties guilty of any of the above-named
offences, shall be punished with a hundred lashes, have his head
shaved, and, after his property has been confiscated for the benefit
of the king, shall be subjected to the miseries of slavery.

X. No Christian shall Accept a Gift from a Jew, to the


Detriment of the Christian Faith.
Let him be considered as violating the rules of the Christian faith
who pretends to be a defender of that faith, and, at the same time,
defiles the truth by the acceptance of improper gifts; and let him
hear what the Lord has said against him by the mouth of his
prophet: “For the reason that you have sold the just man for silver,
and the poor man for the price of your sandals, behold I will thunder
over you as thunders a wagon loaded with hay; and he who is swift
will lose his power of flight; and the strong man will lose his
strength; and he who is brave, his courage; and he who wields the
bow, shall not stand; and he who runs shall not be saved by his
swiftness; and the rider shall not escape; and he who is strong of
heart shall flee naked among the brave.” Who, then, is meant by the
just man who was sold for silver, and the poor man for the price of
your sandals, unless the only begotten Son of God the Father, whose
innocent blood was formerly sold by the Jews for thirty pieces of
silver, and is even now daily sold by those who pervert and deny the
truth? And, indeed, there are certain of the people who, influenced
by zeal for the faith, and by the most righteous intentions, promise
to detect and punish the offences of the Jews, who are,
nevertheless, corrupted by the common vice of avarice. For when,
perchance, they have received gifts of some kind from these
perfidious infidels, they unlawfully hold their peace, and those whom
they formerly promised to expose and bring to justice, after the
acceptance of a paltry bribe, they permit to go unpunished.
Wherefore, we hereby decree that it shall be lawful for no Christian
of whatever lineage, rank, or degree, whether he belong to the
clergy, or to the laity, to receive a gift from a Jew, of either sex, or
from any intermediary of the same, as a reward for acting against
the faith of Christ; or to implicate himself in any other act against
the interests of the Christian religion by the defence of such persons,
for the sake of a reward. And if any person should be corrupted by
the acceptance of any such gift, or should conceal the notorious
errors of the Jews, and should interpose any obstacle whatever, in
order that such wickedness may go unpunished, he shall be liable to
the penalties laid down by the ancient Fathers, and shall pay double
as much to the treasury as he shall have been proved to have
received from the Jew.
ERVIGIUS, KING.
XI. Jews shall not Dare to Read Such Books as the
Christian Faith Rejects.
To show favor to those readers whom it is not right to assist, is
rather a mark of wickedness than of piety. For this reason, where
any Jew reads books, or studies doctrines, in which the Christian
faith is denied, or keeps or conceals such books in his house, he
shall either receive a hundred lashes in public, or shall have his head
shaved. Let all persons be cautious and beware of having books
containing such doctrines in their possession, or of studying the
same, or of even meditating upon them. And if, henceforth, anyone
should attempt to repeat such an offence, he shall receive a hundred
lashes, shall have his head shaved, and shall be condemned to
perpetual exile; and because he has committed the offence a second
time, he shall also lose his property, which shall be bestowed upon
whomever the king may direct. Those shall be liable to a similar
penalty, who presume to instruct children in the false doctrines
contained in such books; and the teacher himself, when detected in
the first transgression, shall receive a hundred lashes, and have his
head shaved, and shall bind himself by a written agreement never to
teach such doctrines again. If, after this, he should violate his
agreement, and attempt to repeat what he had formerly renounced,
all his property shall be forfeited to the king, and he himself shall
receive a hundred lashes, shall have his head shaved, and be
condemned to perpetual exile. All children under ten years of age,
who are proved to have studied said false doctrines, shall be exempt
from the penalties aforesaid. But any child over the age of ten years,
who studies or meditates upon such doctrines, shall be liable to the
fines and punishments hereinbefore mentioned.

XII. Christian Slaves shall not Serve, or Associate with,


Jews.
It truly seems a crime of no small importance to the society of
Christians, that the impious Jewish race, always rebellious against
the rule of God, should have Christian slaves in their service, and, on
the other hand, that an honorable adherent of the Christian religion
should be humiliated in the presence of the children of infidels; that
thus the body of Christ should appear to do homage to the ministers
of Antichrist; and that, through a monstrous regulation, those very
persons who are contending, by means of their customs, against our
religion, should have the services of slaves attached to our Holy
Faith subject to their impiety and errors. For which reason, we
decree that henceforth the law promulgated by our glorious
predecessor, Sisebutus, of holy memory, shall, in cases of this kind,
remain in full force, and we hereby confirm the same except the
clause by which the penalty of death is imposed; the said law being
the one whereby our predecessors have placed all transgressors of
the same under a perpetual curse.
No Jew shall presume to have in his possession a Christian slave;
nor shall he dare to commit any breach of the provisions of this law,
with this sole exception, which is sanctioned by the same, to wit:
that a Jew shall have the power to liberate a Christian slave;
because it is highly unworthy that those who are the adherents of a
perfidious sect should be able to confer freedom upon Christians. For
it is not consistent that the darkness should obscure the light, or
that he who is himself a slave, should bestow the blessing of liberty;
especially as this law was promulgated at the time the Jews were
first summoned to conversion, and this privilege was then conceded
to them. Now, however, we declare that no Jew shall set a Christian
slave at liberty, because it is contrary to this edict, and all such as
are proved to have in their possession Christian slaves, are
transgressors of the law; and sufficient indulgence is shown them if
they are not condemned for their transgression. Therefore this
privilege is entirely denied them, for the reason that they presume to
act against the rules and canons of the Church. We, however, for the
sake of mercy, concede to them that from the first year of our reign,
that is to say, for the space of sixty days from the Kalends of
February, every Jew shall have the right to sell his Christian slaves,
but not without the approval of the priests or judges having
jurisdiction over the diocese, or the district to which said slaves
belong, in order that the slaves who are sold may not undergo the
penalty of death, and that the vendors may not, in some way, seek
an opportunity for the commission of fraud, or the infliction of
revenge. Therefore, when the sixtieth day from the aforesaid
Kalends shall have elapsed, it shall not be lawful for a Jew to have a
Christian slave, or any other Christian, in his service. After that time,
that is to say, the period of sixty days, if any Christian slaves should
be found in the possession of a Jew, they shall be free, and shall
have a right to all property which has been bestowed upon them by
their master, as provided by this law; and said slaves shall be
entitled to their freedom, even if it should be proved that they have
been forcibly concealed by their master. All Jews who, after the
expiration of the aforesaid time, presume to keep in their
possession, or conceal, any Christian slaves, or, in any way whatever,
attempt to evade the provisions of this law, shall forfeit half of their
property to the royal treasury; or, if they are persons of inferior rank,
and have not the means wherewith to make reparation, they shall
each receive a hundred lashes, and have their heads shaved.
ERVIGIUS, KING.
XIII. Where a Jew Declares that he is a Christian, and, for
this Reason, does not Wish to Dispose of a Christian Slave.
Where a Jew, fearing that he will lose his property, fraudulently
asserts that he has been converted to Christianity, and protests that
he ought not to lose his Christian slaves, for the reason that he has
been leading a Christian life, it devolves upon us to provide, by these
laws, that the astuteness of fraud does not prevail, on the one hand,
or sincere conversion suffer injury on the other. We, therefore,
decree that all Jews throughout our kingdom shall have the right
conceded by a former edict, to sell their Christian slaves, from the
Kalends of February, in the first year of our reign, until the
approaching Kalends of April; and, should they wish to retain said
slaves, they must prove themselves to be Christians, as prescribed
by law. We grant to all Jews, against whom there exists no evident
suspicion of perjury, the space of sixty days from the Kalends of April
during the present year, during which time such as desire to be
saved, and wish to unite with the Christian communion, may do so;
and we direct such persons to visit the bishop of the diocese, and
publish their confession of faith, to which their signatures or seals
shall be attached, in which confession each Jew shall declare that he
abjures all the errors of his sect, and that he will in no way again
observe or embrace any of its false doctrines. Every Jew who
renounces his former errors, and is converted to the holy faith of
Christ, shall inscribe in his confession the Christian symbol; shall
promise that he will under no circumstances return to his errors, as
he would to his vomit; and shall profess that henceforth he will, in
compliance with the terms of his written confession, in no way
change anything which we have included in this law. And the
aforesaid confession he shall make, not merely with bare words and
promises, declaring one thing openly, while he secretly retains
another in his heart, while his artifice, cloaked by his promises, has
more control over him than the truth. Bishops and judges shall use
every effort to ascertain whether said confession is genuine or not,
and that those who swear to it, according to the law, do so with
sincere, and not with deceitful, hearts. All who act honestly, and
whose profession, together with their works, prove them to be
worthy of the Holy Faith, and whose promise under oath establishes
that they are devout Christians, can have the use of Christian slaves.
Christian slaves shall not be subjected to the control of Jews unless
the latter are openly proved to be Christians, use Christian food, and
contract marriage according to Christian customs. Any of said
persons, however, who, after having made confession and been
sworn, thereby dedicating themselves to Christianity, as aforesaid,
are found to have broken their promises by the practice of any rite
of the Jewish sect; for the reason that they dared to profane the
name of God, and pollute themselves with the filth of Jewish error,
shall forfeit all their property to the king, shall each receive a
hundred lashes, and, having had their heads shaved, shall be
subjected to the miseries of exile which they have so justly
deserved. All those who, obdurate of heart, and blinded by malice,
neglect to make public confession of faith within the period
aforesaid, or presume to have in their possession a Christian slave
after the time prescribed by law has elapsed, shall be liable to the
condemnation of the former law, relating to Christian slaves
remaining in the service of Jews, to wit: half of their property shall
be confiscated for the benefit of the royal treasury, or, should they
be persons of inferior station, and not have the means to make
reparation, as aforesaid, they shall each receive a hundred lashes,
and have their heads shaved. All Jews who retain possession of
Christian slaves, and do not deliver up said slaves within the
prescribed time, shall be reduced to perpetual slavery, and belong to
those upon whom the king shall see fit to bestow them.

XIV. The Confession of Jews; and In What Way Each One


of Them, who is Converted, must Write Down the Proof of
his Conversion.
I hereby renounce all the rites and observances of the Jewish
sect, and, without reserve, express my utter abhorrence of all their
ceremonies and solemnities which I have practised and kept in
former times, until now; and I pledge myself that I will, hereafter,
observe none of said rites or ceremonies, nor will adhere to any of
my former errors; that is to say, I will not retain them in my mind,
or, in any way, carry them into effect. Henceforth, renouncing all
things which are condemned and prohibited by the doctrines of
Christianity:—
I believe in one God, the Omnipotent Father, Maker of Heaven
and earth, the Creator of all things visible and invisible, and in our
Lord Jesus Christ, the only son of God, begotten by the Father
before all the centuries; God of God, light of light, the true God of
the true God, born not made, equal to the Father, that is to say, of
the same substance as the Father, by whom all things were created
both in Heaven and earth. And I believe in Him who for the sake of
man, and for our salvation, descended from heaven, and, born of
the Holy Spirit and the Virgin Mary, became a man in the flesh;
suffered under Pontius Pilate; was crucified, dead, and buried; who
arose on the third day, ascended into heaven, and sitteth at the right
hand of God the Father; who shall come again in his glory to judge
the living and the dead, and to whose reign there shall be no end. I
believe in the Holy Spirit, the regenerator, proceeding from the
Father and the Son, who spoke by the mouth of the prophets. I
believe in the Holy Catholic Apostolic Church, I confess that there is
but one baptism for the remission of sins, and I believe in the
resurrection of the dead, and in life through all coming ages. Amen.
I sincerely believe in all the things hereinbefore written, and I
promise that I will keep them faithfully, and that I will embrace them
with all the affection of my soul, and, subscribing my name thereto,
I promise that I will never again return to the vomit of the Jewish
superstition; and that I will never practise, or retain in my heart, any
of the rites or ceremonies which the Jews are accustomed to
observe; wholly renouncing the Jewish sect, rejecting in its entirety
the perfidy of the Jews, and abjuring whatever is contrary to the
Christian faith. And, hereafter, I will always profess belief in the Holy
Trinity, so that I may live as I ought, according to Christian customs,
and that, avoiding in every way the company of Jews, I may always
associate with honest Christians. Likewise, I promise that I will
always partake of food with Christians, or accept it from them; and
that I will, as a faithful and devoted Christian, frequently go to the
house of God; and I also promise that I will devoutly take part in the
services of Sunday, and in the festivals of martyrs, as enjoined by
the Christian religion; and that I will be present with true Christians
on all festival days which the Church has ordered shall be observed
with love and devotion, and will participate in all the ceremonies
prescribed by the Christian faith. This, the profession of my faith and
belief, is made upon such and such a day.

XV. Conditions under which Jews must Make Oath, when,


having been Converted, they give in their Confession of
Faith.
I swear first by God the Father Omnipotent, who said, “By me
shalt thou swear, and shalt not take the name of the Lord thy God in
vain”; who made Heaven and earth, the sea and all that in them is;
who placed a boundary to the ocean, saying, “thus far shall thou
come, and here shall thy swelling waves be broken.” Who also said,
“Heaven is my throne, and the earth my footstool.” Who cast down
the first and proudest angel from Heaven; before whose eyes the
entire celestial host stood trembling; whose glance dried up the
waters of the abysses, and whose wrath caused the mountains to
melt away. Who placed Adam, the first man, in Paradise, and
ordered him not to eat of the forbidden fruit, and who, having eaten
it, He cast out of Paradise, and bound him, as well as all the human
race, with the fetters of disobedience; who freely accepted the
sacrifice of Abel, and worthily rejected that of Cain; who received in
Paradise Enoch, together with Elias, in the flesh, before their time
was accomplished upon earth; who, at the time of the flood, deigned
to save Noah and his wife, and their three children and their wives,
with the animals, and the birds of the air, and the reptiles, whereby
the race of each was preserved; who caused Shem to be born of
Noah, and from him Abraham, and from Abraham the Israelites to
be derived; who chose the Patriarchs and Prophets, and blessed the
Patriarchs, Abraham, Isaac and Jacob. I swear by Him who made the
promise to the holy Abraham, saying, “in thy seed all nations shall
be blest,” and gave him the symbol of circumcision, as an eternal
covenant. I swear by the God who overthrew Sodom and Gomorrah,
and turned the wife of Lot, who looked backward, into a pillar of
salt. I swear by Him who strove with Jacob, and, touching his thigh,
caused him to become lame, saying, “thou shalt henceforth not be
called Jacob, but Israel.” I swear by the God who liberated Joseph
from the hands of his brethren, and caused him to find favor in the
eyes of Pharaoh, and by whom all Israel was saved from famine. I
swear by the God who rescued Moses from the waters, and
appeared to him in the burning bush, and who, by his hands,
brought the ten plagues upon the Egyptians; and who liberated his
Jewish people from Egyptian slavery, and caused them to traverse
the Red Sea with dry feet, when the waves, contrary to their nature,
stood, as a solid wall, upon either side. I swear by the God who
drowned Pharaoh and his army in the Red Sea; and who, as a pillar
of cloud by day, and of fire by night, guided the Hebrews in the
wilderness. I swear by the God who, upon Mount Sinai, gave the law
to Moses written in His own hand, upon tables of stone. I swear by
the God who made the mountain of Sinai to smoke in the sight of
the Children of Israel. I swear by the God who chose Aaron for His
first priest, and consumed the sons of the latter with fire, in the
tabernacle, because they offered strange sacrifices before the Lord. I
swear by the God who, by His just judgment, caused the earth to
gape and swallow up alive Dathan and Abiran. I swear by the God
who caused the bitter waters to become sweet by casting twigs into
the same. I swear by Him who, through Moses striking the rock with
his rod, caused great torrents to gush forth, to refresh the thirsty
Jewish people. I swear by Him who, for forty years, fed the Israelites
in the wilderness, and preserved their clothing entire, so that it did
not wear with the using. I swear by Him who declared by His
irrevocable mandate, that none of the Children of Israel should enter
the promised land, except Joshua-Ben-Nun, and Caleb, whom he
promised and predicted should enter there; for the Israelites did not
believe the word of God. I swear by Him who declared to Moses that
he would raise his hand, and the Jewish people would be victorious
over the Malekites. I swear by Him who ordered our fathers to cross
the River Jordan, and to take ten stones from that river as a
testimony. I swear by Him who ordered all Israel, when they passed
over the River Jordan, to be circumcised with knives of stone. I
swear by Him who overthrew the walls of Jericho. I swear by Him
who decorated David with the splendor of royalty, and rescued him
from the hands of Saul, and of his son Absalom. I swear by Him who
filled the temple with a cloud, and poured out His blessings therein.
I swear by Him who carried up the prophet Elias in a whirlwind and
a fiery chariot, from earth to the throne of glory; and by Him who, at
the prayer of Elisha, and with a stroke of the garment of Elijah,
divided the waters of the Jordan in twain. I swear by Him who
preserved the three young men in the furnace of burning fire, before
the eyes of a hostile king, He who holds the key of David, and who
closes what no one shall open, and opens what no one shall close. I
swear by Him who performed all miracles, and displayed all virtues
and all signs, among the Hebrews, or among other nations. I swear
by Him, and by the ten sacred commandments of the law. I swear
by Jesus Christ, the Son of the Omnipotent Father, and by the Holy
Spirit, the Paraclete, which is one of the Trinity and the true God;
and by the holy resurrection of our Lord Jesus Christ, and by His
ascension into Heaven, and by His glorious and terrible coming,
when He shall judge the quick and the dead, showing Himself
merciful to the just, and terrible to the wicked; and by the holy body
and precious blood of Him who opened the eyes of the blind, and
made the deaf to hear; restored paralytics to health; loosened the
tongues of the dumb; healed those possessed of the devil; made the
lame to run, and raised the dead; who walked upon the waters; who
resurrected Lazarus, whose flesh was already decayed, restored him
to life and strength, and changed sorrow into joy; who is the Creator
of the world, the origin of light, the source of vigor; who illuminated
the world by His birth, and redeemed it by His passion; who alone
was free among the dead, and whom death could not hold; who
broke into pieces the infernal gates, and, by the majesty of His
presence, rescued souls from the power of hell; who, having
conquered death, raised to Heaven, after His conquest of the world,
that body which He had assumed upon earth; and who now sits at
the right hand of the Omnipotent God, the Father, from whom He
has received the eternal power of the celestial kingdom. And I swear
by all the heavenly virtues, and by all the relics of the Saints and
Apostles, and by the four Holy Gospels which have been placed
under this my written oath upon the holy altar of Him of the sacred
name, and which I touch and hold with my hands.
And all these things which I have taken care to renew in my
confession, or have added thereto, which confession I have given,
signed with my hand, to thee, the bishop governing this diocese, I
have declared in all sincerity to have been offered, not with artifice
or fraud, but in good faith, as stated in said confession. And I hereby
renounce all the ceremonies of the Jewish ritual, and declare my
belief in the Holy Trinity with all my heart, and promise that I will
forever remain in the Faith, and will never again associate with the
impious Jews; but that I will hereafter live, in all respects, according
to the Christian customs, and take part in all their observances; and
that I will keep, with all purity of heart, whatever concerns the
practice of the Holy Faith, which has been set forth in my
confession; and that I will always live according to the apostolic
traditions and the canons of the Holy Church. And if I should violate
the same in any respect, or dishonor the Holy Faith, or attempt to
practice any Jewish rite, or deceive you, by this my confession, made
under oath; or, under any pretext whatever, I should not, even
unintentionally, perform the things which I have promised, as you
believed, or understood that I did promise; then may there be
visited upon me all the curses of the law which have been uttered by
the mouth of God against those who disobey His commandments.
And may there come upon me, and upon my house, and upon my
children, all the plagues and afflictions of Egypt, as an example and
a terror to others; and may I suffer the judgment of Dathan and
Abiran, and the earth swallow me up alive. And after I have
departed this life, may eternal fire receive me, delivered up to the
devil and his angels; and may I, sharing the punishments of the
inhabitants of Sodom and Gomorrah, be given up to be burned; and
when, at last, I shall come before the tribunal of the dreaded Judge
and sublime King, our Lord Jesus Christ, may I be numbered among
those to whom the terrible and glorious Judge shall say, “Depart
from me, ye accursed, into everlasting fire prepared for the devil and
his angels.” This oath was signed upon such and such a day and
date.
XVI. Concerning the Christian Slaves of Jews, who have
not Proclaimed Themselves Christians, and those who
Expose Them.
All slaves, belonging to Hebrews, and who are members of the
holy Christian communion, and who, henceforth, influenced, by their
masters, do not declare themselves Christians, and remain under the
yoke of their masters, for the reason that they have rejected the
favor of liberty which was offered them, shall be doomed to
perpetual slavery, and shall be given to whomever the king may
select. Any person, by whose means this was exposed, if he should
be the slave of a Jew, after having embraced the Christian faith,
shall receive his freedom. If, however, the discovery was made by a
Christian, he shall receive five solidi for every Christian slave, from
him who is convicted of having violated this decree after its
promulgation.

XVII. No Jew, under any Authority whatever, shall Dare


to Oppress, Punish, or Imprison a Christian, Except by Order
of the King.
No Jew shall have the power to rule, command, or restrain any
Christian, except in cases where the king orders it to be done for the
public benefit. If a Jew, acting under authority from any person,
should presume to imprison, punish, coerce, or illtreat any Christian
whomsoever, or should attempt to inflict upon him anything
forbidden by law, or even what is not provided for by the laws, he
shall either forfeit half of his property to the royal treasury, or, if he
should not possess any property, he shall receive a hundred lashes,
and have his head shaved. And where any person who is of noble
rank, attempts to exercise this power over Christians, he shall be
compelled to pay ten pounds of gold to the king; and where he is a
person of inferior rank, he shall pay five pounds of gold. Those who
have not the means wherewith to make reparation as aforesaid,
shall receive a hundred lashes, and have their heads shaved.
ERVIGIUS, KING.
XVIII. If Slaves of Jews, not yet Converted, should Claim
the Grace of Christ, they shall be Liberated.
The chosen apostle Paul, referring to something which happened
at the time, or merely for the sake of truth, declared that Christ
announced that, as we bestow liberty upon the faithful, so, also, we
ought to afford infidels the opportunity to embrace eternal life.
Therefore, if any slave belonging to a Jew should desire to be free
from servitude, and seek the favor of Christ, no one shall retain him
in bondage; no one shall oppose him in any way, or place any
obstacle in his path; but, as soon as he shows himself to be a
Christian, by his profession and his oath, and shall openly abandon,
or reject the false doctrines of his master, he shall be at once
released from slavery; and, removed, with all his property, from the
control of his master, he shall fully enjoy the blessings of freedom;
and the same rule which has been provided where Christian slaves
have been emancipated, shall apply, in every respect, to his case.

XIX. Jews shall not Rule Christians under the Authority of


Mayors of Towns, or of Superintendents of Estates; and
Concerning the Penalties to be Imposed upon Such as
Appoint them to Office.
Where a Jew is invested with authority or power by any member
of the laity, and by its means he obtains control over a Christian
family, his authority shall be at once transferred to the king, and he
who accepted it shall receive a hundred lashes, have his head
shaved, and forfeit half his property to the public treasury. If any
bishop, priest, minister, clerk, or member of a monastic order, should
invest a Jew with authority over church affairs, he shall forfeit to the
public treasury as much of his own property as is equal in value to
that over which he gave said Jew authority. If, however, he should
have no property, he shall be sent into exile, that he may learn
under the restrictions of penance, how impious it is to confer upon
infidels, authority over true Christians.
XX. Where a Jew comes from Another Country into any of
the Provinces of Our Kingdom, he Must, at once, Present
himself before a Bishop, a Priest, or a Judge; and What shall
be Done under the Circumstances.
Where a Jew, residing in a city or province of our kingdom,
makes application to a bishop, priest, or judge of that diocese or
district, and it appears from the testimony of ecclesiastical
witnesses, that he has abandoned the observance of the Sabbath,
and the practice of the rites and ceremonies usually observed by
members of his sect; and that he did not make use of any of the
same, while wandering hither and thither, or did not seek a hiding-
place anywhere, in which to observe said rites; and that, while at
home, he is known to have conferred with Christians of approved
faith, partaken of food with them, and participated in the Christian
communion; and that, upon such days as his ceremonies were
accustomed to be practised, he resorted to the church to receive the
salutary instructions of the bishops and the priests; and if said Jew
asserts that he cannot remain for any length of time, on account of
inevitable necessity, or press of business; then a confession of faith,
to be signed by him, shall be drawn up by the priest of the parish,
and the said Jew shall promise therein that, whenever, upon his
journey, he finds any of his sect observing their rites or festivities, he
will avoid them. And the said priest shall draw up a letter, written
with his own hand, directed to those ecclesiastics, in whose
jurisdiction said Jew represents that he is about to travel, in order
that, all suspicion of fraud being removed, said Jew whether
traveling, or remaining in one locality, may not be subjected to
religious restraint and discipline. If any Jew should violate this law,
authority is given to any bishop or priest of the diocese, as well as to
any judge, to punish him with a hundred lashes; nor shall he be
permitted to return to his home, unless he is furnished with letters
from the bishop or priest of the diocese in which he was unlawfully
found. In said letters the number of days shall be especially noted;
that is, dating from the time when said Jew made application to the
bishop aforesaid, as well as those included in his absence until the
day of his return.

XXI. How Assemblies of Jews shall Visit the Bishop on


Appointed Days.
Every colony of Jews, in whatever city or province they may be
situated, shall visit the bishop or priest of the diocese upon the
Sabbath, and upon all other festival days, when they are accustomed
to celebrate their rites; they shall not be permitted to wander about
on said days; and during all such festivals, when they are suspected
of performing their rites, they shall under no circumstances leave
their homes without the permission of the priest. Each of said Jews
on every Sabbath, after having bathed, shall visit a bishop, or a
priest, and receive his blessing. And in localities where there is no
priest, each of them shall visit the judges, or other approved
Christians, and shall associate with them openly, in such a manner
that, if inquiry be made, said persons may give favorable testimony
concerning their Christian behavior. Jewish women, that is to say,
the wives and daughters of Jews, to the end that they may have no
opportunity to commit any error or transgression upon the festival
days aforesaid, when they are accustomed to practise their rites,
shall act, in every respect, as may be prescribed by the bishops or
the priests to their husbands when present; that, like their
husbands, they may not absent themselves from ecclesiastical
control, and on all the festival days observed by their sect, may
associate with such respectable and devout Christian women as the
priests or bishops may select. If anyone shall be proved to have
violated this edict, he shall be punished with a hundred lashes, and
have his head shaved. And, as priests are sometimes influenced by
the execrable temptations of the flesh, it is hereby especially
enjoined, that they shall not take advantage of opportunities of this
kind, for the indulgence of the same. Wherefore, we decree, with all
severity, that every priest shall strictly observe this law concerning
Hebrew women, and shall not take advantage of any occasion by
which he may be polluted with their company. And if, at any time, a
priest should pervert the zeal which he should employ for the benefit
of Christianity, for the purpose of indulging his licentious passions,
he shall be deprived of his holy office, and be sentenced to
perpetual exile.
FLAVIUS ERVIGIUS, KING.
XXII. Where Anyone has a Jew in his Service, and a Priest
Demands him, the Master shall not have a Right to Retain
said Jew.
Where anyone of the laity has a Hebrew man or woman in his
service, or under his protection, and by the exertion of his authority
deprives them of the privilege of resorting at any time, to the bishop
or the priest, or prevents them from going, for the sake of
instruction, to ecclesiastics, on the days appointed for that purpose,
he shall be excommunicated by the bishop, and be deprived of said
slave which he attempted to restrain illegally, and for every slave so
restrained he shall pay three pounds of gold to the king.

XXIII. All Restraint of and Control over the Jews shall be


Vested in the Priesthood.
Those who are charged with the enforcement of our laws, and
the infliction of punishment upon infidels, are earnestly exhorted to
fulfil the duty imposed upon them by Divine authority; for the Holy
Spirit, whose truth is coextensive with the world, has said “Priests
shall sit in My judgment seat, and shall judge according to My laws
and precepts.” We decree that, hereafter, priests shall observe
whatever is included in our laws and that they shall not suffer a Jew
to be protected by anyone in the practice of his rites, but that all
such Jews shall be exempt from the favor of those by whom they
are shielded; and that said priests shall diligently take measures to
bring all Jews under the control of the Church, for the sake of their
salvation, which is the duty of all Catholic ecclesiastics; and that it
will be their earnest care not to grow lukewarm in the enforcement
of any of our laws aforesaid.
XXIV. Concerning the Penalties to be Imposed upon
Priests and Judges who Neglect to Enforce the Laws against
the Jews.
The priests of our Holy Church must exercise due and pious care
lest they be held responsible for the transgressions of the people.
For what profit is there, where one is not punished for his own sin,
but still can be punished for the sin of another? Therefore, to correct
the negligence of such persons, we hereby decree that if any bishop,
influenced by avarice or malice, should be lukewarm in the
enforcement of the laws enacted against the Jews, to wit: that
where any errors of that perfidious sect have been detected by him,
or where he has received information of them, and it appears that
he neglected to correct said errors, he shall be excommunicated for
the space of three months, and shall forfeit a pound of gold to the
royal treasury; and, if he should not have the means to make such
pecuniary reparation, he shall be excommunicated for the space of
six months; and, for the purpose of making amends for the
negligence of said bishop, any other bishop who is zealous in the
cause of God, shall have authority to correct the errors of said
perfidious Jews, which the former bishop neglected to correct, as
aforesaid. And if, through deceit, negligence, or lukewarmness, the
other bishop should hesitate, or procrastinate, in discharging the
duty imposed upon him, his inactivity shall be punished, and the
errors of the perfidious Jews be corrected by order of the king. This
rule shall also, in every respect, apply to, and be observed by, all
other ecclesiastics, as well as bishops; that is to say, priests, deacons
and clerks, upon any of whom the duty of restraining infidels has
been imposed by the bishop. And all judges who are informed of
such crimes, or who shall, themselves, discover them, and do not at
once punish them, as prescribed by law, shall each pay a pound of
gold to the public treasury, as has been provided in the case of
bishops. Nevertheless, priests, judges or other officials who have
been invested with authority, shall not be liable to the aforesaid
penalties, if they can prove that they were prevented, by command
of the king, from proceeding against the Jews.
ERVIGIUS, KING.
XXV. No Judge shall Presume to Investigate the Offences
of the Jews without the Knowledge of an Ecclesiastic.
No judge shall decide a cause involving the transgressions of the
perfidious Jews, unless an ecclesiastic be present, lest, by the
acceptance of a bribe, the Holy Faith of the Church be stained by
avarice; but, as is frequently the case, where no ecclesiastic is
present, the judge is authorized to proceed without him. If, however,
the bishop should be absent, whether near at hand, or at a distance,
he may leave a priest to act in his stead, who will co-operate with
the judge in the enforcement of these laws, without any
remuneration whatever.

XXVI. Bishops shall be Immune from Punishment, when


their Priests do not Inform them of Such Things as Should
be Corrected.
As soon as the priests, deacons, or other members of the clerical
order, and all judges, vested with authority, throughout the different
provinces of the kingdom, ascertain that a body of Jews is within
their jurisdiction, they must not delay to place said Jews under
coercion and restraint, as required by our laws; and all errors which
said Jews are unwilling to renounce, shall be brought to the
knowledge of the king and the bishop, in order that they may be
corrected; and if a Jew should give information of the same to the
bishop, he shall not be subject to punishment for any similar offence
of which he may be guilty. No bishop shall be liable to discipline for
neglect, when notice of the offence was not given him by his
subordinates.
ERVIGIUS, KING.
XXVII. Concerning the Mercy to be Shown by Princes
towards Those who have been Truly Converted to the
Christian Faith.
The foregoing laws having been framed by us with care and
diligence, and having attempted in them to adapt the punishment to
the guilt of the offender, as, for instance, where we have sentenced
certain of them to lose their property, and be driven into exile, we
now hereby reserve the following privileges of mercy for ourselves,
and our successors, to wit: that if any Jew, after having been
ensnared by the devil, should come to his senses, and profess belief
in the Holy Trinity; and the priests or judges of the diocese or district
in which he lives, should establish the fact by their testimony; and
the works of said Jew should correspond with his professions; in
such cases the prerogative of mercy may be exercised by ourselves,
and our successors; that is to say, after the confession and oath of
said Jew has been made, and the evidence has been submitted to
the king, the latter shall have authority to return his property to said
Jew, and to recall him from exile. If, however, any such Jew, after
having professed himself to be a Christian, should return to the
vomit of his error, he shall be condemned to punishment, without
any hope of pardon; and said punishment shall be proportionate to
the proof of his hypocrisy, and the degree of his guilt, and whether
he undergoes a capital penalty, or one of less severity, no mercy
shall, under any circumstances, be shown him.

XXVIII. Bishops shall Give to all Jews a Copy of this


Book, which has been Published for the Purpose of
Correcting their Errors; and their Confessions and a Record
of their Conversion, shall be Deposited among the Archives
of the Church.
The perversity of a deceitful mind is accustomed to make use of
the pretence of ignorance, when it asserts that it has no knowledge
of the law, and declares that it is exempt from punishment because
it is ignorant of the New Testament. Now, for the purpose of
removing this false and malicious excuse, we hereby order all
bishops and priests to explain to the Jews within their jurisdiction,
the decrees which we have heretofore promulgated concerning their
perfidy; and also, to give them a copy of this book, which is
ordinarily read to them publicly, in the congregations of the Church,
and which they must always carry with them as evidence of their
instruction. And if, after this book shall have been read to them
publicly as aforesaid, or given into their hands, any of them should
claim that he was not present when it was read, or should assert
that he is ignorant of the laws contained therein, no excuse of his
shall be thereafter received; but if, ever subsequently, he should be
detected in the breach of any of said laws, under no circumstances
shall he escape punishment for the same. And we add to this law, as
being a necessary part of it that all written confessions and
agreements which any Jew, at any time, has delivered to his priest,
shall be carefully preserved by the latter, among the archives of his
church, in order that it may be evidence against any Jew who may
thereafter venture to resume the practice of his impious rites.
INDEX.
A.

Abortion, by drugs, 206;


on a freeborn woman, 206;
on a slave, 207;
penalty for, 208;
on a beast of burden, 286.
Accessories, to rape, punishment of, 93;
to homicide, 223;
to theft, 240.
Accusation of crime, penalty for false, 200.
Adulterer, if killed, not criminal homicide, 96.
Adultery, of freeborn woman with slave, 83;
committed with connivance of husband, 95;
of a betrothed, 95;
of a wife, 96;
where a girl guilty of, is killed, 96;
parties guilty of, cannot be legally killed by slaves, 97;
when a freeborn woman commits, 97;
property of persons who have committed, how disposed of,
99;
who may bring accusation of, 100;
proof of, 101;
sons may prosecute, 100;
where one is convicted of, with virgin or widow, 101;
with female slave, 102.
Advocate, must have written authority from client, 48.
Animals, hired to another, 171;
loaned, 172;
when secretly killed, 246;
where loosed in crops, 279;
when loaned, and abused, 285;
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookgate.com

You might also like