Processing of layout parameters in Java Tapestry5

Copy codeThe code is as follows:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
<html xmlns:t=””>
<meta name=”keywords” content=”${ks}”>
<meta name=”description” content=”${desc}”>
<body >

For example, when using the template page above, you want to change the title, keywords and description dynamically.
Add the following code in the Java class of the template page:

Copy codeThe code is as follows:
@Parameter (defaultprefix = bindingconstants.literal, name = “title”, requred = true) / / here I set it as a parameter, and it must be\
@Property (write = false) / / mark the non writable property
private String title;

Finally, in use:

Copy codeThe code is as follows:
< div T: type = “template” xmlns:t= ” 5_ 0_ 0. XSD “title =” write your parameters here “>”

After rearranging the server, it has been found that the normal Title properties can be displayed….

Recommended Today

Programming Xiaobai must understand the network principle

How is the network composed? Why can we easily surf the Internet now?Whether you are a computer major or not, you may always have such questions in your heart!And today we will solve this matter and tell you the real answer! Basic composition of network First, let’s look at this sentence Connect all computers together […]