﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-hengheng123456789-随笔分类-JAVA-Web</title><link>http://www.blogjava.net/hengheng123456789/category/17310.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 03 Sep 2007 13:52:38 GMT</lastBuildDate><pubDate>Mon, 03 Sep 2007 13:52:38 GMT</pubDate><ttl>60</ttl><item><title>Easy Ajax with Struts 2</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142400.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 03 Sep 2007 09:41:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142400.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/142400.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142400.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/142400.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/142400.html</trackback:ping><description><![CDATA[<p>A while back , I wrote an article for O&#8217;Reilly&#8217;s sister site , Java.net about <a href="http://today.java.net/pub/a/today/2005/10/27/sprinkle-ajax-magic-into-struts-webapp.html"><strong>How to add Ajax to your Struts Application</strong></a>. While it was pretty straightfoward (as is Ajax underneath all the hype), it still involved a little to much JavaScript for my liking. Nothing against JavaScript, but if you write it , you have to support it. Far better to use a standard Ajax library , like DWR , Prototype or Dojo.</p>
<p>So , along comes Struts 2. <a href="http://www.firstpartners.net/blog/technology/java/2006/12/18/struts-2-is-the-new-mini/">Be careful - it&#8217;s good , but a different beast under the covers from Struts 1</a>. It does a lot of things better - for example , the way it has Actions as normal POJO&#8217;s makes it a lot of things easier to unit test. </p>
<p>Struts 2 also gives you Ajax &#8216;out of the box&#8217;. No writing of javascript, no debugging against various browsers; just configure and go. A full description of <a href="http://www.firstpartners.net/kb/index.php/Easy_Ajax_using_Struts_2"><strong>how to setup Struts 2 to use Ajax is in this wiki article</strong></a>. The quick version is:</p>
<p>1. Setup Struts 2<br />
2. Add the Struts-Ajax URL and Div Tag.</p>
<p>That&#8217;s it. Ajax without the fuss.</p>
<p>Even better that the Struts guys have implemented the Ajax functionality using the Prototype Ajax Library, so you get the benefit of all the improvements there. </p>
<p>What do you think? Will you move to Struts 2 just for the new Ajax capabilities?</p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/142400.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-09-03 17:41 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142400.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Using Drools in Your Enterprise Java Application</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142394.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 03 Sep 2007 09:28:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142394.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/142394.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142394.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/142394.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/142394.html</trackback:ping><description><![CDATA[<h2>Using Drools in Your Enterprise Java Application</h2>
by <a href="http://www.onjava.com/pub/au/2366">Paul Browne</a><br />
08/24/2005
<p>These days enterprise Java could almost put you to sleep. How many hundreds of J2EE-EJB web applications have been written that capture information from a web page and store it in a database? What really keeps developers awake at night is trying to write and maintain the complex business logic in their applications. This is a problem not only for new applications, but increasingly, for long-lived, business-critical apps whose internal logic needs to change frequently, often at very short notice.</p>
<p>In an earlier article, "<a href="http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html">Give Your Business Logic a Framework with Drools</a>," I introduced the Drools framework and showed how it could be used to organize complicated business logic. Drools replaced many tangled <code>if ... then</code> statements with a simple set of things known to be true. If you are ever in a meeting with business customers, and your head hurts with the complexity of what they want you to implement, then maybe you should consider a rule engine such as Drools. This article will show you how you can do this in an enterprise Java application.</p>
<h3>Frameworks All the Way Down</h3>
<p>Most enterprise Java developers already have their favorite frameworks. In no particular order, these include presentation frameworks (Struts, JSF, Cocoon, and Spring), persistence frameworks (JDO, Hibernate, Cayenne, and Entity Beans) and structural frameworks (EJB, Spring again, Pico, and Excalibur), as well as many others. Each framework does one very useful thing (or more), and gives developers a lot of instant "out of the box" functionality. Deploying an application using frameworks means you avoid a lot of the boring bits and concentrate on what is really needed.</p>
<p>Until now, there was a gap in what the frameworks were able to do, in that business logic had no framework. Tools like EJB and Spring are good, but have little to say about how to organize your <code>if ... then</code> statements! Adding Drools to your developer toolbox means that it is now possible to build an application with "frameworks all the way down." Figure 1 shows a diagram of such an application.</p>
<p><img height="386" alt="Figure 1" src="http://www.onjava.com/onjava/2005/08/24/graphics/diagramB1.gif" width="442" /><br />
<em>Figure 1. Frameworks for Java applications</em></p>
<p>This article will build on what we already know of the Drools framework and allow us to build such an application.</p>
<h3>When Should I Use a Rule Engine?</h3>
<!-- sidebar begins --><br />
<p>It's almost a cliche in software engineering to say that "if you have a hammer, everything looks like a nail." While rule engines can solve a lot of problems for us, it is worth considering whether a rule engine is really appropriate for our enterprise Java application. Some questions to ask are:</p>
<ul>
    <li><strong>How complex is my application?</strong> For applications that shuffle data to and from a database, but not much more, it is probably best not to use a rule engine. However, where there is even a moderate amount of processing implemented in Java, it is worthwhile to consider the use of Drools. This is because most applications develop complexity over time, and Drools will let you cope easily with this.
    <li><strong>What is the lifetime of my application?</strong> The answer to this is often "surprisingly long"--remember the mainframe programmers who thought their applications wouldn't be around for the year 2000? Using a rule engine pays off, especially in the medium to long term. As this article demonstrates, even prototypes can benefit from the combination of Drools and agile methods to take the "prototype" into production.
    <li><strong>Will my application need to change?</strong> The only sure thing about your requirements is that they will change, either during or just after development. Drools helps you cope with this by specifying the business rule in one or more easy-to-configure XML files. </li>
</ul>
<h3>What About Performance?</h3>
<p>If you're writing an enterprise application, chances are that it will need to scale to hundreds, if not thousands, of users. You know that existing Java and J2EE applications can do this, but how will a application using Drools cope with this pressure? The answer is "surprisingly well." While most developers hate to "lose control" and rely on other people's code (i.e., a framework), consider the points below--not only should your application be as fast as "traditional" coding methods, but Drools may even make your application run faster:</p>
<ul>
    <li><strong>Avoids badly written code:</strong>&nbsp;Drools guides developers to do "the right thing." You may be sure the code you are writing is good, but would you say the same for the code of your co-developers? Using a framework makes it easier to write good, fast code.
    <li><strong>Optimized framework:</strong>&nbsp;How often have you seen business logic that repeatedly accesses a database for the same information, slowing down the entire application? Used correctly, Drools can remember not only the information, but also the results of previous tests using this information, giving the entire application a speed boost.
    <li><strong>Rete algorithm:</strong>&nbsp;Many times we apply "if" conditions that we didn't really need. The Rete algorithm, as implemented by Drools, replaces all of the <code>if ... then</code> statements with an optimized network. It is important to note that the Rete algorithm involves a tradeoff between using more memory to reduce delays at run time. While this isn't a factor in most modern servers, we wouldn't yet recommend deploying Drools on your mobile phone! </li>
</ul>
<br />
<br />
<h3>Where Were We?</h3>
In our <a href="http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html">previous article</a>, we wrote a simple stock trading application based around the Drools engine. We implemented various business rules, showed how we could rapidly change the rules to meet changing business requirements, and wrote JUnit tests to give us a high degree of confidence that the system would act as it was supposed to. However, the application as we left it had little or no user interface, and used hard-coded data instead of a database. To evolve our application into something that is more enterprise level, we need to add two main things:
<ul>
    <li>Some sort of user interface, ideally based one of the standard web-presentation frameworks.
    <li>A Data Access Object (DAO) to let Drools work with a database (or other back end system). </li>
</ul>
<h4>Calling the Rule Engine from a Presentation Framework</h4>
<p>Most enterprise Java applications are accessed using a web interface, and one of the most widely adopted web-presentation frameworks is <a href="http://struts.apache.org/">Struts</a>, from Apache. Ideally, we'll write our application so that the presentation layer knows about the business layer underneath, but not the other way around. This has the advantage not only of allowing us to change the presentation framework at a later date (e.g., to an Ajax or <a href="http://en.wikipedia.org/wiki/Web_service">web service</a> interface), but also means the code examples give should be readily applicable to other web frameworks like Spring.</p>
<br />
<p>The following code snippet demonstrates how to call the business logic tier (using the rule engine) from the web presentation layer. The code uses the results to decide which page to display. In this sample, we use a Struts action, but the code is similar for any other web framework or even a servlet or a JSP page. This snippet works with a supporting <em>struts-config.xml</em>, JSP pages to post/display data, and a way of generating the WAR file for deployment. The snippet shows how to integrate the rule engine with the web framework.</p>
<pre><code>
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import BusinessLayer;
/**
* Sample Struts action with Pseudocode
*/
public class SampleStrutsAction extends Action{
/**
* Standard Struts doPerfom method
*/
public ActionForward doPerform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws InvalidEntryPointException {
//Local Variables
StockOffer userOffer =null;
//Get any previous values from the session
userOffer=(StockOffer)request.getSession()
.getAttribute("PREVIOUS_STOCK_OFFER");
//create this object if it is null
if (null==userOffer){
userOffer = new StockOffer();
}
//Update with the incoming values
//These values match those on the form
userOffer.setStockName(request.
getParameterValue("STOCK_NAME"));
userOffer.setStockPrice(request
.getParameterValue("STOCK_PRICE"));
userOffer.setStockQuantity(request
.getParameterValue("STOCK_QTY"));
//Reset the output value
userOffer.setRecommendPurchase(null);
//Call the Business Layer
BusinessLayer
.evaluateStockPurchase(userOffer);
//Forward to the appropriate page
if ("YES".equals(
testOffer.getRecommendPurchase()){
return mapping.findForward("YES_WEB_PAGE");
}
//otherwise default to the no page
return mapping.findForward("NO_WEB_PAGE");
}
}</code>
</pre>
<p>There are a couple of things going on this sample. Often, we build up the data we need from the user over several web pages, so this sample shows how we can achieve this by retrieving the <code>StockOffer</code> object that we have previously stored in the web server session. Next, we update the <code>StockOffer</code> with any values that the user may have changed on the web page. We then reset the <code>recommendPurchase</code> flag to clear any previous results before we call the business logic layer. Finally, we take the response of the business logic and use it to decide which page to forward the user to.</p>
<p>In this example, note how we split the business logic (yes/no on whether or not to buy a stock) from the presentation logic (decide which page to go to). This allows us to reuse our business rules across several different applications In addition, take look at how the state information (i.e., things that the user has already told us) is stored in the <code>StockOffer</code> object/web server session, and not in the business layer. By keeping the business layer stateless in this way, we make the entire application much more scalable and performant.</p>
<br />
<h3>Integrating the Rule Engine with the Database Layer</h3>
<p>So far, our application has a web presentation layer and a rules engine for the business layer, but no means of getting data to and from a database. This section gives an example of how to do this. We base our example on the <a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html">Data Access Object</a> (DAO) pattern, where we encapsulate all code that "talks" to the database (or back-end data source) in one pluggable, configurable class. As such, the example is applicable to other persistence frameworks, such as Hibernate and Cayenne.</p>
<br />
<p>Some important points about the way we want to organize the data layer are:</p>
<ul>
    <li>Only the business layer should talk to the data layer; if a class in the presentation layer (front end) wants some data, it should pass through the business layer first. This helps makes our code easier to organize and read.
    <li>As far as possible, we should keep our data layer stateless--we should hold client data elsewhere (e.g., in the server session at the web front end, as per the previous example). This is distinct from caching of data, which we can do at this level. The difference between the two is state information is often user-specific, while data we cache at the data access layer is mainly sharable across the application. Organizing our layer in this way increases performance.
    <li>We should allow the business logic to decide if data is needed or not--if not needed, the call to get the data should not be made. </li>
</ul>
<p>To implement our simple Data Access Object, we create three new objects: <code>StockNameDao</code>, <code>DaoImplementation</code>, and <code>DaoFactory</code>.</p>
<p><code>StockNameDao</code> is an interface that defines two methods: <code>getStockNames()</code> returns a list of the stock names that we deal with, and <code>isOnStockList()</code> checks that a given stock is on the list of stocks that we deal with. Our business layer will call these methods as and when it needs the information.</p>
<p><code>DaoImplementation</code> is an actual implementation of <code>StockNameDao</code>. In this case the values are hard-coded, but we could have queried a database or accessed an information system like Bloomberg via a web service.</p>
<p><code>DaoFactory</code> is what we use to create an appropriate instance of <code>StockNameDao</code>. The advantage this approach has over creating the class directly is that it allows us to configure what DAO implementation we use at runtime (frameworks like Spring are especially good at this). One factory can return many types of DAOs (e.g., <code>StockNameDao</code>, <code>StockPriceDao</code>, <code>StockHistoryDao</code>), which means we can pass in our <code>DaoFactory</code>, and let the individual rules decide on the data and DAOs that they require.</p>
<p>Here's what the <code>StockNameDao</code> interface looks like:</p>
<pre><code>
/**
* Defines a Data Access Object - a non data
* source specific way of obtaining data.
*/
public interface StockNameDao {
/**
* Get a list of stock names for the application
* @return String[] array of stock names
*/
public String [] getStockNames();
/**
* Check if our stock is on the list
* @param stockName
* @return
*/
public boolean isOnStockList(String stockName);
}</code>
</pre>
<p>And here's the <code>DaoImplementation</code>:</p>
<pre><code>
/**
* Concrete Definition of a Data Access Object
*/
public class DaoImplementation
implements StockNameDao {
/**
* Constructor with package level access only
* to encourage use of factory method
*
*/
DaoImplementation(){}
/**
* Get a list of stock names for the app.
* This is a hard coded sample
* normally we would get this from
* a database or other datasource.
* @return String[] array of stock names
*/
public String[] getStockNames() {
String[] stockNames=
{"XYZ","ABC","MEGACORP","SOMEOTHERCOMPANY"};
return stockNames;
}
/**
* Check if our stock is on the list
* @param stockName
* @return true / false as appropriate
*/
public boolean isOnStockList(String stockName){
//Get our list of stocks
String stockList[] = getStockNames();
//Loop and see if our stock is on it
// done this way for clarity . not speed!
for (int a=0; a&lt;stockList.length;a++){
if(stockList[a].equals(stockName)){
return true;
}
}
//Default return value
return false;
}
}</code>
</pre>
<p>The simple <code>DaoFactory</code> just returns a <code>DaoImplementation</code>:</p>
<pre><code>
package net.firstpartners.rp;
/**
* Factory Method to get the Data Access Object.
* Normally we could replace this with a
* framework like Spring or Hibernate
*/
public class DaoFactory {
/**
* Get the stock name Dao
* This sample is hardcoded - in reality
* we would make this configurable / cache
* instances of the Dao as appropriate
* @return an instance of StockNameDao
*/
public static StockNameDao getStockDao(){
return new DaoImplementation();
}
}
</code>
</pre>
<br />
<p>Now that we have our simple DAO implementation to serve as our database layer, how do we integrate it with the Drools business layer? The updated business rules file, <em>BusinessLayer.xml</em>, shows us how.</p>
<br />
<pre><code>
&lt;?xml version="1.0"?&gt;
&lt;rule-set name="BusinessRulesSample"
xmlns="http://drools.org/rules"
xmlns:java="http://drools.org/semantics/java"
xmlns:xs="
http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="
http://drools.org/rules rules.xsd
http://drools.org/semantics/java java.xsd"&gt;
&lt;!-- Import the Java Objects that
we refer to in our rules --&gt;
&lt;java:import&gt;
java.lang.Object
&lt;/java:import&gt;
&lt;java:import&gt;
java.lang.String
&lt;/java:import&gt;
&lt;java:import&gt;
net.firstpartners.rp.StockOffer
&lt;/java:import&gt;
&lt;java:import&gt;
net.firstpartners.rp.DaoFactory
&lt;/java:import&gt;
&lt;java:import&gt;
net.firstpartners.rp.StockNameDao
&lt;/java:import&gt;
&lt;!-- Application Data not associated --&gt;
&lt;!-- with any particular rule --&gt;
&lt;!-- In this case it's our factory --&gt;
&lt;!-- object which gives us back --&gt;
&lt;!-- a handle to whatever Dao (Data --&gt;
&lt;!-- access object) that we need --&gt;
&lt;application-data
identifier="daoFactory"&gt;DaoFactory
&lt;/application-data&gt;
&lt;!-- A Java (Utility) function --&gt;
&lt;! we reference in our rules --&gt;
&lt;java:functions&gt;
public void printStock(
net.firstpartners.rp.StockOffer stock)
{
System.out.println(
"Name:"+stock.getStockName()
+" Price: "+stock.getStockPrice()
+" BUY:"+stock.getRecommendPurchase());
}
&lt;/java:functions&gt;
&lt;!-- Check for XYZ Corp--&gt;
&lt;rule name="XYZCorp" salience="-1"&gt;
&lt;!-- Parameters we can pass into--&gt;
&lt;!-- the business rule --&gt;
&lt;parameter identifier="stockOffer"&gt;
&lt;class&gt;StockOffer&lt;/class&gt;
&lt;/parameter"&gt;
&lt;!-- Conditions that must be met for --&gt;
&lt;!-- business rule to fire --&gt;
&lt;java:condition&gt;
stockOffer.getStockName().equals("XYZ")
&lt;/java:condition&gt;
&lt;java:condition&gt;
stockOffer.getRecommendPurchase() == null
&lt;/java:condition&gt;
&lt;java:condition&gt;
stockOffer.getStockPrice() &gt; 10
&lt;/java:condition&gt;
&lt;!-- What happens when the business --&gt;
&lt;!-- rule is activated --&gt;
&lt;java:consequence&gt;
stockOffer.setRecommendPurchase(
StockOffer.NO);
printStock(stockOffer);
&lt;/java:consequence&gt;
&lt;/rule&gt;
&lt;!-- Ensure that negative prices --&gt;
&lt;!-- are not accepted --&gt;
&lt;rule name="Stock Price Not Negative"&gt;
&lt;!-- Parameters we can pass into the --&gt;
&lt;!-- business rule --&gt;
&lt;parameter identifier="stockOffer"&gt;
&lt;class&gt;StockOffer&lt;/class&gt;
&lt;/parameter&gt;
&lt;!-- Conditions for rule to fire --&gt;
&lt;java:condition&gt;
stockOffer.getStockPrice() &lt; 0
&lt;/java:condition&gt;
&lt;!--When rule is activated then ... --&gt;
&lt;java:consequence&gt;
stockOffer.setRecommendPurchase
(StockOffer.NO);
printStock(stockOffer);
&lt;/java:consequence&gt;
&lt;/rule&gt;
&lt;!-- Check for Negative Prices--&gt;
&lt;rule name="Stock Price Low Enough"&gt;
&lt;!-- Parameters for the rule --&gt;
&lt;parameter identifier="stockOffer"&gt;
&lt;class&gt;StockOffer&lt;/class&gt;
&lt;/parameter&gt;
&lt;!-- Now uses Dao to get stock list --&gt;
&lt;java:condition&gt;
daoFactory.getStockDao().isOnStockList(
stockOffer.getStockName())
&lt;/java:condition&gt;
&lt;java:condition&gt;
stockOffer.getRecommendPurchase() == null
&lt;/java:condition&gt;
&lt;java:condition&gt;
stockOffer.getStockPrice() &lt; 100
&lt;/java:condition&gt;
&lt;!-- When rule is activated do this --&gt;
&lt;java:consequence&gt;
stockOffer.setRecommendPurchase(
StockOffer.YES);
printStock(stockOffer);
&lt;/java:consequence&gt;
&lt;/rule&gt;
&lt;/rule-set&gt;
</code>
</pre>
<p>There are several changes to this file to integrate the data access layer with our business rules:</p>
<ul>
    <li>At the top of the file, we have several new <code>&lt;java:import&gt;</code> statements to reference the <code>StockNameDao</code>, <code>DaoImplementation</code>, and <code>DaoFactory</code> classes that we added to the system.
    <li>We have a new tag, <code>&lt;application-data&gt;</code>, which assigns an instance of the <code>DaoFactory</code> class to a variable. <code>&lt;application-data&gt;</code> tags are similar to parameters, except they apply to all business rules, and not just one.
    <li>The <code>Stock Price Low Enough</code> rule has a new condition, which uses the <code>DaoFactory</code> and <code>StockNameDao</code> to check if the stock is on the list of those that we deal with. </li>
</ul>
<p>We run our <code>BusinessRulesTest</code> (simulator) again. The simulator/unit tests run OK, since even though we have changed the structure of the program, we haven't (yet) changed what it does. From looking at the output logs, we can see that our business rules are using <code>StockNameDao</code> as part of their evaluations, and that <code>DaoImplementation.isOnStockList()</code> is being called.</p>
<p>While this example shows the reading of information from a data source, the principles are the same for writing information, if that is what a rule has decided should be done. The differences would be that our DAO would have a <code>setSomeInformation()</code> method, and that the method would be called in the <code>&lt;java:consequence&gt;</code> part of the business rule, once the specific conditions had been met.</p>
<!-- sidebar begins --><!-- don't move sidebars --><!-- sidebar ends -->
<h3>Summary</h3>
<p>In this article, we showed that most Java server applications have three tiers: presentation, business logic, and data persistence. While the use of frameworks is widely accepted in the presentation and persistence layers, until now no framework has been available to encapsulate low-level business logic. As we've seen in the examples, Drools and JSR-94 are ideal candidates for reducing the complexity and speeding the development of Java applications. I hope that these examples inspire you to take a closer look at rule engines, and that they save many hours of development and maintenance time in your applications.</p>
<h3>Resources</h3>
<ul>
    <li><a href="http://sourceforge.net/project/showfiles.php?group_id=99476&amp;package_id=158438">Sample code for this article</a>
    <li><a href="http://www.drools.org/">Drools Project home page</a>
    <li><a href="http://www.jroller.com/page/eu/20040810">Information on Drools rules</a>
    <li>"<a href="http://www.theserverside.com/articles/article.tss?l=Drools">Introduction to Drools and Rule Engines</a>," by the Drools project lead.
    <li><a href="http://www.geocities.com/CapitolHill/5910/drltk/instructions.htm">Drools rules schema files</a>
    <li><a href="http://javaboutique.internet.com/tutorials/rules_engine/">JSR-94: Java Rule Engines, Overview</a>
    <li><a href="http://struts.apache.org/">Struts framework website</a>
    <li><a href="http://www.springframework.org/">Spring framework website</a>
    <li><a href="http://www.hibernate.org/">Hibernate website</a>
    <li><a href="http://www.junit.org/">JUnit test framework</a>
    <li><a href="http://herzberg.ca.sandia.gov/jess/index.shtml">Jess Java rule engine</a>
    <li><a href="http://jena.sourceforge.net/">Jena semantic and rule engine</a>
    <li><a href="http://jcp.org/aboutJava/communityprocess/review/jsr094/">JSR-94 home page</a>
    <li><a href="http://www.manning.com/friedman-hill">Jess in Action home page</a>
    <li>"<a href="http://herzberg.ca.sandia.gov/jess/zen.shtml">Business Rule Thinking</a>" (Jess-based)
    <li><a href="http://www.aaai.org/AITopics/html/expert.html">General introduction to rule systems</a>
    <li>"<a href="http://herzberg.ca.sandia.gov/jess/docs/61/rete.html">Jess implementation of the Rete algorithm</a>" </li>
</ul>
<p><em><a href="http://www.onjava.com/pub/au/2366">Paul Browne</a> , based in Dublin, Ireland, has been consulting in enterprise Java with <a href="http://www.firstpartners.net/rp">FirstPartners.net</a> for almost seven years. </em></p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/142394.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-09-03 17:28 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142394.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MINA Beginning</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 03 Sep 2007 07:38:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/142325.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/142325.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/142325.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;MINA Beginninghttp://mina.apache.org/http://mina.apache.org/documentation.html1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 传统Socket：阻塞式通信在java传统socket技术中，每建立一个Socket连接时，须同时创建一个新线...&nbsp;&nbsp;<a href='http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html'>阅读全文</a><img src ="http://www.blogjava.net/hengheng123456789/aggbug/142325.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-09-03 15:38 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache MINA 快速入门</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142326.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 03 Sep 2007 07:38:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142326.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/142326.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142326.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/142326.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/142326.html</trackback:ping><description><![CDATA[&nbsp;
<p style="text-align: center" align="center"><strong>Apache MINA </strong><strong><span style="font-family: 宋体">快速入门</span></strong></p>
<p><strong>&nbsp;</strong></p>
<p><a href="http://hi.baidu.com/ofbase/blog/item/9acf45d05989f88ea1ec9c11.html">http://hi.baidu.com/ofbase/blog/item/9acf45d05989f88ea1ec9c11.html</a></p>
<p>Added by Mark Webb, last edited by Trustin Lee on Apr 16, 2007&nbsp;&nbsp;&nbsp; (view change) </p>
<p><strong>1&nbsp;&nbsp;&nbsp; </strong><strong><span style="font-family: 宋体">简介</span></strong></p>
<p><span style="font-family: 宋体">建立一个基于</span>MINA<span style="font-family: 宋体">的时间服务器，下面的内容需要先准备好。</span></p>
<p>MINA 1.1 Core <br />
JDK 1.5 or greater <br />
SLF4J&nbsp;&nbsp;&nbsp; 1.3.0 or greater <br />
&gt;&gt;Log4J 1.2 users: slf4j-api.jar, slf4j-log4j12.jar, and Log4J&nbsp;&nbsp;&nbsp; 1.2.x <br />
&gt;&gt;Log4J 1.3 users: slf4j-api.jar, slf4j-log4j13.jar, and Log4J&nbsp;&nbsp;&nbsp; 1.3.x <br />
&gt;&gt;java.util.logging users: slf4j-api.jar and slf4j-jdk14.jar </p>
<p><span style="font-family: 宋体">这个程序只测试了</span>Windows2000pro<span style="font-family: 宋体">和</span>Linux<span style="font-family: 宋体">系统，并且在做的时候没有依赖于一些开发平台的环境。</span></p>
<p><strong>2&nbsp;&nbsp;&nbsp; </strong><strong><span style="font-family: 宋体">编写</span>MINA</strong><strong><span style="font-family: 宋体">时间服务</span></strong></p>
<p><span style="font-family: 宋体">下面先建立一个文件</span>MinaTimeServer.java<span style="font-family: 宋体">，代码如下：</span></p>
<p>public class MinaTimeServer {<br />
&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // code will go here next<br />
&nbsp;&nbsp;&nbsp; }<br />
}</p>
<p><span style="font-family: 宋体">下面会慢慢将这个类写完，这里先定义一个</span>main<span style="font-family: 宋体">用于启动程序。这一步结束后，还需要一个监听连接的对象，因为这个程序是基于</span>TCP/IP<span style="font-family: 宋体">的，这里将增加一个</span>SocketAcceptor<span style="font-family: 宋体">。</span></p>
<p>import org.apache.mina.common.IoAcceptor;<br />
import org.apache.mina.transport.socket.nio.SocketAcceptor;</p>
<p>public class MinaTimeServer {<br />
&nbsp;&nbsp;&nbsp; public static void main(String[] args) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The following two lines change the default buffer type to 'heap',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // which yields better performance.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ByteBuffer.setUseDirectBuffers(false);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ByteBuffer.setAllocator(new SimpleByteBufferAllocator());<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IoAcceptor acceptor = new SocketAcceptor();<br />
&nbsp;&nbsp;&nbsp; }<br />
}</p>
<p><span style="font-family: 宋体">通过这里的</span>SocketAcceptor<span style="font-family: 宋体">类，下面将把它绑定到一个端口上，如果你想增加一个线程模型到该类的话，参考</span>"<span style="font-family: 宋体">配置线程模型</span>"<span style="font-family: 宋体">部分。</span></p>
<p>import java.io.IOException;<br />
import java.net.InetSocketAddress;<br />
import org.apache.mina.common.IoAcceptor;<br />
import org.apache.mina.transport.socket.nio.SocketAcceptor;</p>
<p>public class MinaTimeServer {<br />
&nbsp;&nbsp;&nbsp; private static final int PORT = 9123;</p>
<p>&nbsp;&nbsp;&nbsp; public static void main(String[] args) throws IOException {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ByteBuffer.setUseDirectBuffers(false);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ByteBuffer.setAllocator(new SimpleByteBufferAllocator());</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IoAcceptor acceptor = new SocketAcceptor();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SocketAcceptorConfig cfg = new SocketAcceptorConfig();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cfg.getSessionConfig().setReuseAddress( true );<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cfg.getFilterChain().addLast( "logger", new LoggingFilter() );<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cfg.getFilterChain().addLast( "codec", new ProtocolCodecFilter( <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new TextLineCodecFactory( Charset.forName( "UTF-8" ))));</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acceptor.bind( new InetSocketAddress(PORT), new TimeServerHandler(), cfg);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("MINA Time server started.");<br />
&nbsp;&nbsp;&nbsp; }<br />
}</p>
<p><span style="font-family: 宋体">这里定义了一个整型的端口变量，呼叫</span>SocketAcceptor.bind(SocketAddress,IoHandler,cfg)<span style="font-family: 宋体">，第一个参数是要监听的网址，是本地的</span>9123<span style="font-family: 宋体">端口。</span></p>
<p><span style="font-family: 宋体">第二个参数传的是实现</span>IoHandler<span style="font-family: 宋体">接口的类，是服务于所有的客户端请求的。在这里，将会扩展</span>IoHandlerAdapter<span style="font-family: 宋体">类，这类遵循</span>"<span style="font-family: 宋体">适配器设计模式</span>"<span style="font-family: 宋体">的。</span></p>
<p><span style="font-family: 宋体">第三个参数是配置对象，用于配置日志和编码过滤器。每一个信息都会通过在</span>IoAcceptor<span style="font-family: 宋体">中定义的过滤器链的所有过滤器。在这风景点，将会将信息通过日志和编码过滤器。日志过滤器用</span>SL4J<span style="font-family: 宋体">库记录信息，而编码过滤器则反编码所有收到的信息，并且将所有</span>TextLineCodecFactory<span style="font-family: 宋体">发送的信息进行编码。</span></p>
<p><span style="font-family: 宋体">下面就是</span>TimeServerHandler<span style="font-family: 宋体">类的代码：</span></p>
<p>import java.util.Date;<br />
import org.apache.mina.common.IoHandlerAdapter;<br />
import org.apache.mina.common.IoSession;</p>
<p>public class TimeServerHandler extends IoHandlerAdapter {</p>
<p>&nbsp;&nbsp;&nbsp; public void exceptionCaught(IoSession session, Throwable t) throws Exception {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t.printStackTrace();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.close();<br />
&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; public void messageReceived(IoSession session, Object msg) throws Exception {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String str = msg.toString();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( str.trim().equalsIgnoreCase("quit") ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.close();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date date = new Date();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.write( date.toString() );<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Message written...");<br />
&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; public void sessionCreated(IoSession session) throws Exception {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Session created...");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( session.getTransportType() == TransportType.SOCKET )<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((SocketSessionConfig) session.getConfig() ).setReceiveBufferSize( 2048 );<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.setIdleTime( IdleStatus.BOTH_IDLE, 10 );<br />
&nbsp;&nbsp;&nbsp; }<br />
}</p>
<p><span style="font-family: 宋体">这里用于管理信息，覆盖了</span>exceptionCaught<span style="font-family: 宋体">，</span>messageReceived<span style="font-family: 宋体">和</span>sessionCreated<span style="font-family: 宋体">方法，如前所示，该类扩展了</span>IoHandlerAdapter<span style="font-family: 宋体">。</span></p>
<p>exceptionCaught<span style="font-family: 宋体">方法将会打印错误并且关闭对话，对于大多数的情况来讲，这是标准的处理方法，除非能从异常中恢复过来。</span></p>
<p>messageReceived<span style="font-family: 宋体">方法将收到从客户端发来的数据，并且写回当前时间。如果收到了</span>"quit"<span style="font-family: 宋体">，对话将被关闭。该方法将当前时间发往客户端，依赖于你使用的协议编码，发送至方法的对象（第二个参数）会有不同，发送到</span>session.write(Object)<span style="font-family: 宋体">方法的对象类同。如果你没有指定协议编码，则一般会收到</span>ByteBuffer<span style="font-family: 宋体">对象，而发送的也要是</span>ByteBuffer<span style="font-family: 宋体">对象。</span></p>
<p>sessionCreated<span style="font-family: 宋体">方法用于对话初始化，在这里，先打印一条信息，然后判断对话的类型，再设置缓冲大小，这里设置的是</span>2048<span style="font-family: 宋体">个字节。空闲时间设置为</span>10<span style="font-family: 宋体">秒，如果覆盖了</span>sessionIdle<span style="font-family: 宋体">方法，则该方法每</span>10<span style="font-family: 宋体">秒被呼叫一次。</span></p>
<p><strong>3&nbsp;&nbsp;&nbsp; </strong><strong><span style="font-family: 宋体">测试</span></strong></p>
<p><span style="font-family: 宋体">到这里，编译程序。如果成功，那么运行，然后</span>telnet<span style="font-family: 宋体">这个程序，如下所示：</span></p>
<p><span style="font-family: 宋体">客户端内容：</span><br />
<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#115;&#101;&#114;&#64;&#109;&#121;&#104;&#111;&#115;&#116;">user@myhost</a>:~&gt; telnet 127.0.0.1 9123 <br />
Trying 127.0.0.1... <br />
Connected to 127.0.0.1. <br />
Escape character is '^]'. <br />
hello <br />
Mon Apr 09 23:42:55 EDT 2007 <br />
quit <br />
Connection closed by foreign host. <br />
<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#115;&#101;&#114;&#64;&#109;&#121;&#104;&#111;&#115;&#116;">user@myhost</a>:~&gt;</p>
<p><span style="font-family: 宋体">服务端内容：</span><br />
MINA Time server started. <br />
Session created... <br />
Message written... </p>
<p><strong>4 </strong><strong><span style="font-family: 宋体">参考文档</span></strong></p>
<p><strong>&nbsp;&nbsp;&nbsp; Apache MINA Quick Start Guide</strong> <a href="http://mina.apache.org/documentation.html">http://mina.apache.org/documentation.html</a></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Added by Mark Webb, last edited by Trustin Lee on Apr 16, 2007&nbsp;&nbsp;&nbsp; (view change) </p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/142326.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-09-03 15:38 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142326.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Wicket Beginning</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142320.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 03 Sep 2007 07:32:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142320.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/142320.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142320.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/142320.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/142320.html</trackback:ping><description><![CDATA[&nbsp;
<p style="text-align: center" align="center">Wicket Beginning</p>
<p><a href="http://mywicket.group.javaeye.com/group/blog_post/259300">http://mywicket.group.javaeye.com/group/blog_post/259300</a></p>
<p><span style="font-family: 宋体">一、概貌</span></p>
<p>Wicket<span style="font-family: 宋体">是基于</span>web<span style="font-family: 宋体">应用框架的高级组件，其主要特点：</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">在</span>HTML<span style="font-family: 宋体">和</span>java<span style="font-family: 宋体">之间的明确分隔</span></p>
<p>&nbsp;&nbsp;&nbsp; * OO<span style="font-family: 宋体">组件模式</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">自动状态管理</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">高度生产化</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">低学习投入</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">屏蔽</span>Servlet API<span style="font-family: 宋体">、</span>HTTP<span style="font-family: 宋体">协议细节</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">无需</span>XML<span style="font-family: 宋体">配置文件</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">易于构造可重用组件</span></p>
<p>Struts<span style="font-family: 宋体">是以</span>Model2 MVC <span style="font-family: 宋体">为蓝本构建的</span>web<span style="font-family: 宋体">应用框架。其工作围绕着处理</span>HTTP<span style="font-family: 宋体">请求的</span>action<span style="font-family: 宋体">类来完成。配置方式采用</span>XML<span style="font-family: 宋体">文件。</span></p>
<p><span style="font-family: 宋体">下文将对</span>Wicket<span style="font-family: 宋体">和</span>Struts<span style="font-family: 宋体">在体系、</span>HTTP<span style="font-family: 宋体">请求处理、</span>Servlet API<span style="font-family: 宋体">和</span>HTTP<span style="font-family: 宋体">协议抽取、状态管理、配置这六方面进行比较。</span></p>
<p><span style="font-family: 宋体">二、比较第一方面：体系</span></p>
<p>Struts<span style="font-family: 宋体">体系基于解释每个</span>HTTP<span style="font-family: 宋体">请求并将其定向到某个处理该类型请求的指定</span>Action<span style="font-family: 宋体">类。每个</span>Action<span style="font-family: 宋体">类将处理后的结果返回，并决定下一步走向——通过转发或者重定向到另一个</span>Action<span style="font-family: 宋体">或者将控制权交给输出</span>HTML<span style="font-family: 宋体">的</span>JSP<span style="font-family: 宋体">页面。从技术较大来讲，虽然每个部分之间做到了很好的解耦，但是基于</span>HTTP<span style="font-family: 宋体">请求的处理模式可谓与时代不符（与</span>wicket<span style="font-family: 宋体">相比就是过时了）。两大原因如下：</span></p>
<p>&nbsp;&nbsp;&nbsp; * Struts<span style="font-family: 宋体">并不是真正意义上的纯粹面向对象，每个</span>Action<span style="font-family: 宋体">类定义了一个</span>abstraction<span style="font-family: 宋体">（抽取），但是</span>abstraction<span style="font-family: 宋体">是由</span>HTTP<span style="font-family: 宋体">协议的请求机制决定的，而并非面向对象的分析。</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">除非我们在</span>java<span style="font-family: 宋体">代码中直接输出</span>HTML<span style="font-family: 宋体">（当然除非我们疯了），那么为了输出</span>HTML<span style="font-family: 宋体">我们就要学习另外的主流技术，比如</span>JSP<span style="font-family: 宋体">和自定义</span>tag<span style="font-family: 宋体">。使用在</span>JSP<span style="font-family: 宋体">中使用</span>tag<span style="font-family: 宋体">并非易事，尤其是当我们把这项工作交给美工小组时，这会直接导致两个结果：</span>JSP<span style="font-family: 宋体">代码被他人作的一沓糊涂，或者是我们自己完成这项任务。</span></p>
<p><span style="font-family: 宋体">而</span>Wicket<span style="font-family: 宋体">的处理方式则不同，从整体来讲应该说是更加优雅些。它采用面向对象的组件技术实现</span>web<span style="font-family: 宋体">与用户的交互（这点有些如</span>Swing<span style="font-family: 宋体">）。在</span>Wicket<span style="font-family: 宋体">中的每一页是由若干的使用组合设计模板生成的组件构成。页面和组件各自渲染自己，并直接或者间接的与</span>markup<span style="font-family: 宋体">文件（标识文件，形式就像</span>JSP<span style="font-family: 宋体">）关联。当</span>HTTP<span style="font-family: 宋体">请求到来时，这些请求被转换、传递到组件上的相应事件中来，这一点与微软的</span>VS<span style="font-family: 宋体">很相象。所以</span>Wicket<span style="font-family: 宋体">能够解决</span>struts<span style="font-family: 宋体">体系中存在的问题：</span></p>
<p>&nbsp;&nbsp;&nbsp; * Wicket<span style="font-family: 宋体">是完全面向对象的。我们可以利用组件的继承性设计自己的应用。这里不需要为处理</span>HTTP<span style="font-family: 宋体">协议的请求</span>/<span style="font-family: 宋体">响应而作任何工作。</span></p>
<p>&nbsp;&nbsp;&nbsp; * Wicket<span style="font-family: 宋体">所使用的</span>markup<span style="font-family: 宋体">文件与纯粹的</span>HTML<span style="font-family: 宋体">很接近，所以容易上手使用。</span>Wicket<span style="font-family: 宋体">在</span>markup<span style="font-family: 宋体">文件中所引入的内容非常整洁，并符合</span>XHTML<span style="font-family: 宋体">标准。任何了解</span>HTML<span style="font-family: 宋体">的开发者都可以如编辑</span>HTML<span style="font-family: 宋体">文件那样编辑</span>Wicket<span style="font-family: 宋体">的</span>markup<span style="font-family: 宋体">文件，就好似他并不知道这是</span>Wicket<span style="font-family: 宋体">的</span>markup<span style="font-family: 宋体">文件一样。</span></p>
<p><span style="font-family: 宋体">三、</span>HTTP<span style="font-family: 宋体">请求处理</span></p>
<p><span style="font-family: 宋体">在</span>Struts<span style="font-family: 宋体">中，一个</span>HTTP<span style="font-family: 宋体">请求被接收后，</span>Struts<span style="font-family: 宋体">将在配置文件中查找</span>request path<span style="font-family: 宋体">和相应的</span>Action<span style="font-family: 宋体">类。如果这些已经被配置好了，它将将提取请求参数放入到</span>ActionForm bean<span style="font-family: 宋体">中，并执行一些验证。然后</span>HTTP<span style="font-family: 宋体">请求、回应和</span>ActionForm<span style="font-family: 宋体">对象都将作为参数传入到</span>Action<span style="font-family: 宋体">类中。从这点可以看出</span>Action<span style="font-family: 宋体">的开发者掌握着应用的方方面面：他们必须处理</span>HTTP session<span style="font-family: 宋体">，维护</span>HTTP<span style="font-family: 宋体">请求和</span>session<span style="font-family: 宋体">的属性，并在</span>action<span style="font-family: 宋体">执行完时建立需要返回的信息，最后还要返回相应的</span>ActionForward<span style="font-family: 宋体">以使</span>struts<span style="font-family: 宋体">知道下一步在哪里。假如此时</span>ActionForward<span style="font-family: 宋体">将控制权交给了</span>JSP<span style="font-family: 宋体">页面，开发者就要使用</span>struts<span style="font-family: 宋体">自定义的</span>tag<span style="font-family: 宋体">库编写</span>JSP<span style="font-family: 宋体">代码。如此繁复的工作环节很容易出现错误，而且</span>struts<span style="font-family: 宋体">还需要三个位置保持一致：</span>struts XML<span style="font-family: 宋体">配置文件、</span>java Action<span style="font-family: 宋体">类、</span>JSP<span style="font-family: 宋体">自定义</span>tag<span style="font-family: 宋体">。</span></p>
<p><span style="font-family: 宋体">而在</span>Wicket<span style="font-family: 宋体">中，一个</span>HTTP<span style="font-family: 宋体">请求被接收后，</span>Wicket<span style="font-family: 宋体">将确认</span>HTTP<span style="font-family: 宋体">所请求的那个页面和在这个页面关联的组件。如果请求的目的是</span>form<span style="font-family: 宋体">，</span>Wicket<span style="font-family: 宋体">将自动提取请求参数、验证参数、进行一些预先规定好的类型转换、设置</span>form<span style="font-family: 宋体">组件中的</span>model<span style="font-family: 宋体">（模式，这里用法与</span>MVC<span style="font-family: 宋体">中类似，但有不同）值；接着转化请求为相应类型的事件、调用目标组件上的相应事件侦听器，这样就会导致事件处理代码运行来执行业务逻辑；然后，事件处理器还将指定下一步页面的位置，被指定的页面将初始化（如果页面从未被初始化的话）并自动渲染；渲染处理将按照顺序访问每个页面组件，要求它们进行自我渲染。在</span>markup<span style="font-family: 宋体">文件中能够组件仅通过名字与</span>HTML<span style="font-family: 宋体">元素进行映射。</span></p>
<p>Wicket<span style="font-family: 宋体">出色的原因：</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">每个组件知道如何处理自己事件。因此我们只需要将组件放到页面上，编写事件处理器就行了。如果一个页面中存在</span>20<span style="font-family: 宋体">个能引发事件的不同的组件，我们除了进行将它们添加到页面上的工作外没有别的工作。但如果在</span>struts<span style="font-family: 宋体">中，我们可能需要建立</span>20<span style="font-family: 宋体">个不同的</span>Action<span style="font-family: 宋体">类或者一个具有</span>20<span style="font-family: 宋体">个分支语句的</span>Action<span style="font-family: 宋体">类，并要在</span>XML<span style="font-family: 宋体">配置中逐一添加。</span></p>
<p>&nbsp;&nbsp;&nbsp; * Wicket<span style="font-family: 宋体">带给了我们考虑组件</span>/<span style="font-family: 宋体">事件重用的机会。而不用将注意力放到如何处理</span>HTTP<span style="font-family: 宋体">请求和回应上。</span></p>
<p>&nbsp;&nbsp;&nbsp; * <span style="font-family: 宋体">与</span>struts<span style="font-family: 宋体">相比使用</span>Wicket<span style="font-family: 宋体">会降低我们的代码量，这正是重用组件带来的益处。</span>Wicket<span style="font-family: 宋体">本身不使用任何的</span>XML<span style="font-family: 宋体">配置文件。只需要修改</span>web<span style="font-family: 宋体">容器的</span>web.xml<span style="font-family: 宋体">文件中的</span>servlet<span style="font-family: 宋体">声明部分。</span></p>
<p><span style="font-family: 宋体">假如我们曾经编写过</span>Windows API<span style="font-family: 宋体">、并用过</span>Visual Basic<span style="font-family: 宋体">或者</span>Borland Delphi<span style="font-family: 宋体">的话，下面的比较会更加让人印象深刻。使用</span>struts<span style="font-family: 宋体">开发就像使用</span>Windows API<span style="font-family: 宋体">一样：接收原始消息，解码原始消息，然后再处理这些消息。由于</span>Windows API<span style="font-family: 宋体">是基于消息循环工作的，所以系统除了消息回应外不期望任何的返回值。</span></p>
<p><span style="font-family: 宋体">从另一方面看，</span>Dephi<span style="font-family: 宋体">在</span>TApplication<span style="font-family: 宋体">类中隐藏了</span>Windows<span style="font-family: 宋体">消息循环，使开发人员围绕着</span>TApplication<span style="font-family: 宋体">类建立其他的类。原始的系统消息就这样被</span>Dephi<span style="font-family: 宋体">内建类接收，被内建类解析并被确定其接纳者。消息被转换为一个事件，并被传送到某个特定的对象。</span></p>
<p><span style="font-family: 宋体">如</span>Windows<span style="font-family: 宋体">应用程序一样，</span>Wicket<span style="font-family: 宋体">应用也具有服务于文本和</span>HTML<span style="font-family: 宋体">模板的资源文件。从这点看，</span>Wicket<span style="font-family: 宋体">象用</span>Delphi<span style="font-family: 宋体">做桌面开发一样被用来做</span>web<span style="font-family: 宋体">开发。</span></p>
<p><span style="font-family: 宋体">四、</span>Servlet API<span style="font-family: 宋体">和</span>HTTP<span style="font-family: 宋体">协议的抽取</span></p>
<p>Struts<span style="font-family: 宋体">没有隐藏</span>Servlet API<span style="font-family: 宋体">和</span>HTTP<span style="font-family: 宋体">协议的细节。为了使用</span>Struts<span style="font-family: 宋体">，我们必须乐于和</span>HTTPServletRequest<span style="font-family: 宋体">、</span>HttpServletResponse <span style="font-family: 宋体">和</span>HttpSession<span style="font-family: 宋体">类打交道。并围绕着请求和回应建立应用。这便是所有</span>Model2 MVC wen<span style="font-family: 宋体">框架与生俱来的弱点。</span></p>
<p><span style="font-family: 宋体">正如上面说的，</span>Wicket<span style="font-family: 宋体">隐藏了</span>Servlet API<span style="font-family: 宋体">和</span>HTTP<span style="font-family: 宋体">协议的细节。对于一些应用，我们甚至触及不到这些细节。甚至对于非常复杂的应用，我们也仅使用适当的</span>Wicket<span style="font-family: 宋体">协议抽取类。而经常用到的是</span>java<span style="font-family: 宋体">组件类、</span>POJO<span style="font-family: 宋体">业务模型、纯</span>HTML<span style="font-family: 宋体">标记文件。</span></p>
<p><span style="font-family: 宋体">五、状态管理</span></p>
<p><span style="font-family: 宋体">使用</span>Struts<span style="font-family: 宋体">开发，我们将获得全部的状态管理权。这对于建立大规模的、高升级空间的、集群应用来讲是很好的，因为我们将获得对</span>HttpSession<span style="font-family: 宋体">上每件事物的控制权。但是对于中小型应用，我们将没有缘由编写一些额外的代码。这样将导致应用变得复杂和编写费时。</span></p>
<p><span style="font-family: 宋体">在状态管理上，</span>Wicket<span style="font-family: 宋体">可以作为一个不错的选择。</span>Wicket<span style="font-family: 宋体">框架默认代管所有的组件状态。这对于中小型应用，在状态管理上的代码量几乎为</span>0<span style="font-family: 宋体">。但是</span>Wicket<span style="font-family: 宋体">也提供了一些</span>API<span style="font-family: 宋体">使我们进行标准状态管理和实现自己的状态管理。这样，即使是大型应用，我们也能够全权掌握状态管理。事实上，即使在使用</span>Wicket<span style="font-family: 宋体">编写大型应用时，通常也是先让</span>Wicket<span style="font-family: 宋体">代管所有的状态，然后再慢慢的实现自己定义的状态管理以提高应用性能。</span></p>
<p><span style="font-family: 宋体">六、配置</span></p>
<p><span style="font-family: 宋体">不言自明，</span>Struts<span style="font-family: 宋体">需要一个</span>XML<span style="font-family: 宋体">文件：定义对</span>HTTP<span style="font-family: 宋体">请求和响应的映射和所有的</span>ActionForm<span style="font-family: 宋体">对象等。这个文件可能非常大而且复杂。而新版本的</span>Struts<span style="font-family: 宋体">提供了将这个文件分解为多个模块的方法，虽然这样可以将模块分类，但是这样同样要维护许多的小文件。</span></p>
<p>Wicket<span style="font-family: 宋体">不需要配置文件。</span>Wicket<span style="font-family: 宋体">通过一个简单的应用配置类或者通过编写</span>web<span style="font-family: 宋体">容器的</span>web.xml<span style="font-family: 宋体">文件中</span>Servlet init<span style="font-family: 宋体">参数来完成程序的初始化。而</span>HTTP<span style="font-family: 宋体">请求到组件事件的映射、组件如何输出</span>HTML<span style="font-family: 宋体">等被包含在了</span>Wicket<span style="font-family: 宋体">的应用逻辑里，从而极大地简化了配置。</span></p>
<p><span style="font-family: 宋体">七、参考资料</span><br />
<a href="http://wicket.sourceforge.net/" target="_new">http://wicket.sourceforge.net/</a><br />
<a href="http://www.wicket-wiki.org.uk/wiki/index.php/Newuserguide" target="_new">http://www.wicket-wiki.org.uk/wiki/index.php/Newuserguide</a></p>
<p><a href="http://www.blogjava.net/tommyjian/archive/2007/06/10/123202.html">http://www.blogjava.net/tommyjian/archive/2007/06/10/123202.html</a></p>
<p><span style="font-family: 宋体">感谢</span><span style="font-size: 14pt; color: #663300; font-family: Verdana"><a href="http://www.blogjava.net/tommyjian/"><span style="font-family: 'Trebuchet MS'">Tommy Jian </span></a></span></p>
<p><strong><span style="font-family: 宋体">为什么是</span>Wicket</strong><strong><span style="font-family: 宋体">？</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">如果您正在寻求使用</span>Java<span style="font-family: 宋体">开发</span>Web<span style="font-family: 宋体">应用程序，目前，您有很多的选择。实际上，存在如此众多的</span>Web<span style="font-family: 宋体">应用程序框架显得有点搞笑。来自于互联网一个博客站点的问题：您能说出多少</span>Java Web<span style="font-family: 宋体">应用框架的名字？他们展现的结果如下：</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">框架，到处都是框架，参看后面附带的表格。</span></p>
<p><strong><span style="font-family: 宋体">为什么要</span>&#8220;</strong><strong><span style="font-family: 宋体">重新发明轮子</span>&#8221;</strong><strong><span style="font-family: 宋体">？</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">从这个角度看，您对于</span>&#8220;<span style="font-family: 宋体">另一个</span>Web<span style="font-family: 宋体">应用程序框架有多好</span>&#8221;<span style="font-family: 宋体">这个问题总是耿耿于怀？确实，为什们要</span>&#8220;<span style="font-family: 宋体">重新发明轮子</span>&#8221;<span style="font-family: 宋体">呢？对这个古老的谚语的答复是：因为这一次可以使轮子更圆！</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">但是对于高质量的期待并不是构建</span>Wicket<span style="font-family: 宋体">框架的唯一动因。甚至有很多的观点，认为没有其他的</span>Web<span style="font-family: 宋体">工具集填补这一空白，而</span>Wicket<span style="font-family: 宋体">做到了。实际上，</span>Wicket<span style="font-family: 宋体">与上面提及的众多框架不太一样。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">与</span>Wicket<span style="font-family: 宋体">最相近的或许是</span>Tapestry<span style="font-family: 宋体">和</span>Echo<span style="font-family: 宋体">，但是这种相似性也很有限。和</span>Tapestry<span style="font-family: 宋体">一样，</span>Wicket<span style="font-family: 宋体">使用特定的</span>HTML<span style="font-family: 宋体">属性来标识组件（</span>Components<span style="font-family: 宋体">）声明，这可以方便使用一般的</span>HTML<span style="font-family: 宋体">编辑器进行文件编辑。和</span>Echo<span style="font-family: 宋体">一样，</span>Wicket<span style="font-family: 宋体">拥有一流的组件模型。但是基于</span>Wicket<span style="font-family: 宋体">的应用程序和那些基于</span>Tapestry<span style="font-family: 宋体">和</span>Echo<span style="font-family: 宋体">的应用程序不一样，这是因为从</span>Wicket<span style="font-family: 宋体">框架中两方面都可以受益。您获得了一流的组件模型和对</span>HTML<span style="font-family: 宋体">没有干扰所带来的益处。在很多情况下，这种复合的好处可以带来非常重要的开发优势。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">理解了构建</span>Wicket<span style="font-family: 宋体">的动机有助于您理解为什么</span>Wicket<span style="font-family: 宋体">会表现的不一样。</span></p>
<div align="center">
<table style="width: 240pt" cellspacing="0" cellpadding="0" width="320" border="1">
    <tbody>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>&nbsp;Echo</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Cocoon </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Millstone </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>OXF </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>&nbsp;Struts</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>SOFIA</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Tapestry</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>WebWork </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>RIFE </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Spring MVC </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Canyamo&nbsp;</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>&nbsp;Maverick</p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JPublish </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JATO </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Folium </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Jucas </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Verge </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Niggle </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Bishop </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Barracuda </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Action Framework </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Shocks </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>TeaServlet</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>&nbsp;wingS</p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Expresso </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Bento </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>jStatemachine </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>jZonic </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>OpenEmcee </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Turbine </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Scope </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Warfare </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JMAA </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Jaffa</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Jacquard </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Macaw </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Smile </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>MyFaces </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Chiba</p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JBanana </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Jeenius </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JWarp </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Genie </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Melati </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Dovetail </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Cameleon </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>JFormular </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Xoplon </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Japple </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Helma </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Dinamica </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>WebOnSwing </p>
            </td>
        </tr>
        <tr style="height: 6pt">
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Nacho </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Cassandra </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt">
            <p>Baritus </p>
            </td>
            <td style="padding-right: 0cm; padding-left: 0cm; padding-bottom: 0cm; padding-top: 0cm; height: 6pt"></td>
        </tr>
    </tbody>
</table>
</div>
<p><strong><span style="font-family: 宋体">动机</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">目前存在的大多数</span>Web<span style="font-family: 宋体">框架对于服务端的状态管理都仅仅提供了较弱的支持。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">这就意味着在</span>Web<span style="font-family: 宋体">应用程序中存在着很多特殊的代码来处理和维护繁复的状态管理机制。虽然</span>Wicket<span style="font-family: 宋体">并不允许对服务端的状态完全不考虑，但是它在状态管理的简便性和透明化方面做了很多的工作。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">在</span>Wicket<span style="font-family: 宋体">中，所有服务端的状态都被纳入了自动的管理。您始终不需要直接使用</span>HttpSession<span style="font-family: 宋体">对象或者类似的封装对象去存储状态信息。相反，状态信息已经都与组件关联起来，而在组件后端的数据模型都是传统的</span>Java<span style="font-family: 宋体">对象（</span>POJO<span style="font-family: 宋体">）。</span>Wicket<span style="font-family: 宋体">在每个用户会话期内维护着页面的映射表（</span>Map<span style="font-family: 宋体">）。这个页面映射表（以及每个一面内的组件层次）的目的在于使得框架隐藏了组件以及数据模型访问的细节。您只需要处理简单而熟悉的</span>Java<span style="font-family: 宋体">对象，而</span>Wicket<span style="font-family: 宋体">则处理诸如</span>URL<span style="font-family: 宋体">、会话期标识以及</span>GET/POST<span style="font-family: 宋体">请求的任务。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">您接着也会发现这种结构良好的服务端状态使得解决令人恐惧的</span>&#8220;<span style="font-family: 宋体">后退按钮问题</span>&#8221;<span style="font-family: 宋体">变得十分的容易。实际上，针对页面内组件数据模型的结构性变化带来的数据过期，</span>Wicket<span style="font-family: 宋体">提供了通用而且健壮的解决方案，这个方案可以有效地对浏览器缓存页面进行甄别和过期检测。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">最后，</span>Wicket<span style="font-family: 宋体">在设计的时候就考虑与诸如</span>JDO<span style="font-family: 宋体">和</span>Hibernate<span style="font-family: 宋体">的普通</span>Java<span style="font-family: 宋体">对象（</span>POJO<span style="font-family: 宋体">）序列化框架协同工作。这一点使得构建数据驱动的</span>Web<span style="font-family: 宋体">应用程序显得非常简单。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">对于很多应用程序来说，必须在额外服务端状态导致服务器负载增加和其带来的好处之间进行权衡，服务端状态管理可以降低开发成本、减少维护成本、加快对市场的响应时间以及生产高质量的软件。这里提出的基本观点是：软件是十分昂贵、复杂的，而来自于</span>E-machines<span style="font-family: 宋体">和</span>Dell<span style="font-family: 宋体">的服务器则相对便宜。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">在效率和生产性方面，</span>Wicket<span style="font-family: 宋体">对</span>JSP<span style="font-family: 宋体">的优越性则犹如</span>Java<span style="font-family: 宋体">语言对</span>C<span style="font-family: 宋体">语言一样。您使用</span>Wicket<span style="font-family: 宋体">可以实现的功能使用</span>JSP<span style="font-family: 宋体">也都可以实现。甚至于在内存和</span>CPU<span style="font-family: 宋体">消耗方面效率也非常的高。但是使用</span>JSP<span style="font-family: 宋体">开发应用程序则需要耗费您更多的时间。最后，因为在</span>JSP<span style="font-family: 宋体">中进行状态管理时使用了特别的方式，您可能发现不少的安全问题，也能看到到处蹦出来的错误。上面提及的大部分框架在这方面仅仅提供了有限的辅助。</span></p>
<p><strong><span style="font-family: 宋体">大部分现存的框架需要特定的</span>HTML</strong><strong><span style="font-family: 宋体">代码</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; JSP<span style="font-family: 宋体">具有最深的侵入性，它允许将</span>Java<span style="font-family: 宋体">代码直接嵌入</span>Web<span style="font-family: 宋体">页面中。但是，上面列示的框架（除了</span>Tapestry<span style="font-family: 宋体">）都不同程度地针对</span>HTML<span style="font-family: 宋体">代码引入了特殊的语法。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">因为特殊语法改变了单纯而简单的</span>HTML<span style="font-family: 宋体">标记的实质，而</span>Web<span style="font-family: 宋体">设计者对于这一点是十分的熟悉，所以特殊语法并不是十分得人心。而且预览、编辑和理解这种包含特殊语法的</span>HTML<span style="font-family: 宋体">也是十分困难的事情。</span></p>
<p>&nbsp;&nbsp;&nbsp; Wicket<span style="font-family: 宋体">并没引入任何新的</span>HTML<span style="font-family: 宋体">语法。相反，它通过</span>Wicket<span style="font-family: 宋体">命名空间（</span>namespace<span style="font-family: 宋体">）的标准兼容方式扩展了</span>HTML<span style="font-family: 宋体">，这完全兼容</span>XHTML<span style="font-family: 宋体">标准。这意味这您可以使用</span>Macromedia Dreamweaver<span style="font-family: 宋体">、</span>Microsoft Frontpage<span style="font-family: 宋体">、</span>Word<span style="font-family: 宋体">、</span>Adobe Go Live<span style="font-family: 宋体">以及其他现有的</span>HTML<span style="font-family: 宋体">编辑器来编辑您的</span>Web<span style="font-family: 宋体">页面，并且可以和</span>Wicket<span style="font-family: 宋体">的组件协同工作。为了实现这个目标，</span>Wicket<span style="font-family: 宋体">始终在</span>Wicket<span style="font-family: 宋体">命名空间内使用单个</span>id<span style="font-family: 宋体">属性（</span>&#8220;wicket:id&#8221;<span style="font-family: 宋体">）来标识那些需要框架进行特殊处理的标签。如果您并不喜欢将有</span>Wicket<span style="font-family: 宋体">命名空间修饰的标签和属性展示给您的最终用户，通过简单的设置就可以完全消除它们，从而得到普通的与标准兼容的</span>HTML<span style="font-family: 宋体">代码。</span></p>
<p>&nbsp;&nbsp;&nbsp; HTML<span style="font-family: 宋体">中没有特殊的语法意味着设计者可以直接模拟页面，而您可以在开发的过程中直接使用这些页面。向</span>HTML<span style="font-family: 宋体">页面中添加</span>Java<span style="font-family: 宋体">组件就和设置组件的名称属性一样简单。然后，您可以直接将这些页面交给</span>Web<span style="font-family: 宋体">设计人员，他们可以充满信心地对其进行修改。</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">与其他的应用框架相比，</span>Wicket<span style="font-family: 宋体">在各方面的分离上提供更多的支持。</span>Web<span style="font-family: 宋体">设计者在对应用程序代码不甚了解的情况下就可以编辑</span>HTML<span style="font-family: 宋体">（当然，他们不能移除组件名称标签，而且不能任意改变组件嵌套的层次，其他的事情都是可以的）。另一方面，编程者只需要关注与</span>HTML<span style="font-family: 宋体">混在一起的</span>Java<span style="font-family: 宋体">组件，而不需要了解页面的最终陈现是什么样子。通过这种职能清楚的工作方式，每个人都可以工作得更为顺畅。</span></p>
<p><strong><span style="font-family: 宋体">现存的框架易用性不好</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">目前存在的大部分框架工具在对象模型方面做得不够。在一些框架中，对象模型是通过特定的</span>XML<span style="font-family: 宋体">来定义的。这些语法令人生厌，而且还需要特定的工具来编辑这些配置信息。由于这些框架并不是单一的</span>Java<span style="font-family: 宋体">类库，您就不能使用包含编辑器、调试器和编译器的</span>IDE<span style="font-family: 宋体">工具来编辑它们。</span></p>
<p>&nbsp;&nbsp;&nbsp; Wicket<span style="font-family: 宋体">是化繁为简的代表。在学习</span>Wicket<span style="font-family: 宋体">的过程中不需要了解任何配置文件。</span>Wicket<span style="font-family: 宋体">就是组件结构良好的普通的类库。在</span>Wicket<span style="font-family: 宋体">中，您的</span>Web<span style="font-family: 宋体">应用程序与普通的</span>Swing<span style="font-family: 宋体">应用程序类似，而不是</span>JSP<span style="font-family: 宋体">应用程序。如果您熟悉</span>Java<span style="font-family: 宋体">（特别是如果您熟悉</span>Swing<span style="font-family: 宋体">），那么您就已经对</span>Wicket<span style="font-family: 宋体">有不少的了解了。</span></p>
<p><strong><span style="font-family: 宋体">现存的框架可复用性不好</span></strong></p>
<p>&nbsp;&nbsp;&nbsp; Tapestry<span style="font-family: 宋体">和</span>JSF<span style="font-family: 宋体">虽然有可以重用的组件模型，但是您将发现与</span>Wicket<span style="font-family: 宋体">相比这并不是特别容易做到的事情。</span>Wicket<span style="font-family: 宋体">从设计之初就十分地注重组件的复用。在</span>Wicket<span style="font-family: 宋体">中，从现有的组件扩展编制诸如</span>SignInPanel<span style="font-family: 宋体">或者</span>AddressForm<span style="font-family: 宋体">的复合组件是十分简单的事情。相对来说，针对浏览器的新特性编制新的组件也是十分容易的事情。</span>Wicket<span style="font-family: 宋体">的组件可以使用</span>JAR<span style="font-family: 宋体">格式进行打包，直接通过库引用的方式就可以实现重用</span>——<span style="font-family: 宋体">不需要任何配置文件！</span></p>
<p>&nbsp;&nbsp;&nbsp; Web<span style="font-family: 宋体">编程应该更关注编程乐趣！</span></p>
<p>&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">这就是我编写</span>Wicket<span style="font-family: 宋体">的个人方面的目标。现存的框架在实现开发的直接性、快捷性和简易性方面真正地吸引我。我希望</span>Wicket<span style="font-family: 宋体">在</span>Web<span style="font-family: 宋体">应用程序开发的建议性和乐趣方面能够迈出重要的一步。</span></p>
<p><strong><span style="font-family: 宋体">目标</span></strong></p>
<p><span style="font-family: 宋体">基于上面的这些动机，下面是</span>Wicket<span style="font-family: 宋体">的目标：</span></p>
<ol style="margin-top: 0cm" type="1">
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">简单（易用性、一致性、易懂性）</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt">&nbsp;<span style="font-family: 宋体">以</span>POJO<span style="font-family: 宋体">为核心</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">所有代码均使用</span>Java<span style="font-family: 宋体">编写</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">最小的概念域</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">避免过度地使用</span>XML<span style="font-family: 宋体">配置文件</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">全面解决</span>&#8220;<span style="font-family: 宋体">向后按钮</span>&#8221;<span style="font-family: 宋体">问题</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">最大限度地类型安全以及编译检查</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">最大限度地分析运行时错误</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">对特定工具集的最小依赖</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">组件、容器和惯例始终保持一致性</span></li>
    </ul>
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">复用</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">使用</span>Wicket<span style="font-family: 宋体">编制的组件具备高度的复用性</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">可复用的组件可以使用</span>JAR<span style="font-family: 宋体">文件发布</span></li>
    </ul>
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">无侵入</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt">HTML<span style="font-family: 宋体">以及其他标记性文件不会编程语法所干涉</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">在标记方面只有一个简单的标签</span></li>
        <li style="tab-stops: list 72.0pt">&nbsp;<span style="font-family: 宋体">与任何普通的</span>HTML<span style="font-family: 宋体">编辑器兼容</span></li>
        <li style="tab-stops: list 72.0pt">&nbsp;<span style="font-family: 宋体">图形开发人员很容易识别并避免修改框架标签</span></li>
        <li style="tab-stops: list 72.0pt">&nbsp;<span style="font-family: 宋体">如果设计者不小心删除了标签，则很容易恢复它</span></li>
    </ul>
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">安全</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">默认情况下代码都是安全的</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">在页面和</span>URL<span style="font-family: 宋体">中，只有显式的声明的链接才能公布数据状态</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">具备最大限度类型安全逻辑</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">很容易集成到</span>Java<span style="font-family: 宋体">安全框架</span></li>
    </ul>
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">富有效率，可伸缩性</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">在不牺牲其他目标的前提下保证效率和轻量级</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">可依附的优选会话期支持集群</span></li>
        <li style="tab-stops: list 72.0pt"><span style="font-family: 宋体">通过与可分离模型的协作，会话复制形成的集群很容易实现和调整</span></li>
    </ul>
    <li style="tab-stops: list 36.0pt"><span style="font-family: 宋体">完整</span></li>
    <ul style="margin-top: 0cm" type="circle">
        <li style="tab-stops: list 72.0pt">Wicket<span style="font-family: 宋体">团队乐于为开发</span>Java Web<span style="font-family: 宋体">应用贡献可用的且特性齐全的框架。核心框架是由本篇文档的作者</span>Jonathan Locke<span style="font-family: 宋体">编写和贡献的。目前的团队包括了很多经验丰富的程序员，他们中的一些人还是上面提及的其他框架的开发者，他们也都拥有构建大型</span>Java Web<span style="font-family: 宋体">应用的经验。我们对自己的处境十分的了解，因此也更能从框架使用者的角度来开发</span>Wicket<span style="font-family: 宋体">。</span></li>
    </ul>
</ol>
<p><strong><span style="font-family: 宋体">开发</span>Wicket</strong><strong><span style="font-family: 宋体">的一些网站和资料</span></strong></p>
<p><strong>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wicket</strong></p>
<p>Wicket<span style="font-family: 宋体">框架的大本营，在这里你可以通过</span>Wiki<span style="font-family: 宋体">了解更多关于</span>Wicket<span style="font-family: 宋体">开发的概念和技巧，还可以下载相关的资源，如</span>Wicket<span style="font-family: 宋体">核心包，</span>Wicket<span style="font-family: 宋体">的扩展包，还有</span>Wicket<span style="font-family: 宋体">自带的例子。</span></p>
<p><a href="http://gocom.primeton.com/modules/newbb/viewforum41.htm">http://gocom.primeton.com/modules/newbb/viewforum41.htm</a>(<span style="font-family: 宋体">本文作者主持的中文论坛</span>)</p>
<p><a href="http://wicket.sourceforge,net/">http://wicket.sourceforge,net</a><span style="font-family: 宋体">（这是</span>Wicket<span style="font-family: 宋体">在</span>sourceforge<span style="font-family: 宋体">的根据地）</span></p>
<p><a href="http://www.wicketframework.org/">http://www.wicketframework.org</a><span style="font-family: 宋体">（这是</span>Wicket<span style="font-family: 宋体">的独立域名）</span></p>
<p><strong>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wicket-Stuff</strong></p>
<p><span style="font-family: 宋体">因为</span>Wicket<span style="font-family: 宋体">作为一个</span>Web<span style="font-family: 宋体">框架，只可能提供最核心的功能，但是在实际的开发中，需要更多的控件以及辅助的功能，如与</span>Hibernate<span style="font-family: 宋体">的整合，数据分布列表控件等，</span>Wicket-Stuff<span style="font-family: 宋体">就是一个致力于开发</span>Wicket<span style="font-family: 宋体">扩展功能的站点，目前已经提供了以下的扩展功能</span>:</p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>Dojo</p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>Hibernate<span style="font-family: 宋体">的控件</span>Hibernate (2.1 and 3) components </p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">支持客户端数据验证的控件</span></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">支持</span>Groovy<span style="font-family: 宋体">脚本编程</span></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Velocity<span style="font-family: 宋体">控件面板</span></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>Freemarker</p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>JasperReports</p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>TinyMCE<span style="font-family: 宋体">这个</span>Html<span style="font-family: 宋体">编辑器</span></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体">整合</span>Yahoo Ajax UI<span style="font-family: 宋体">控件</span></p>
<p><a href="http://wicket-stuff.sourceforge.net/">http://wicket-stuff.sourceforge.net/</a></p>
<p><strong>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wicket-Quickstart</strong></p>
<p>Wicket<span style="font-family: 宋体">虽然入门门框不高，但是许多热心的开发人员还是提供了许多详细的教程，帮助开发人员学习如何在各种</span>IDE<span style="font-family: 宋体">环境下开发</span>Wicket<span style="font-family: 宋体">应用程序。</span></p>
<p><a href="http://wicketframework.org/wicket-quickstart/index.html">http://wicketframework.org/wicket-quickstart/index.html</a>Html</p>
<p><strong>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wicket-Library</strong></p>
<p>Wicket-Library<span style="font-family: 宋体">也是一个类似于</span>Wicket-Stuff<span style="font-family: 宋体">的站点，它的目的也是为了提供更多的</span>Wicket<span style="font-family: 宋体">控件，为开发人员服务，但是目前并没有提供什么有用的控件。</span></p>
<p><span style="font-family: 宋体">它的网站上提供了</span>Wicket<span style="font-family: 宋体">例子的在线演示，如果你不想在本机上安装</span>Tomcat<span style="font-family: 宋体">，</span>JDK<span style="font-family: 宋体">等软件，就可以在这个网站上看</span>Wicket<span style="font-family: 宋体">提供的例子。</span></p>
<p><a href="http://www.wicket-library.com/">http://www.wicket-library.com/</a></p>
<p><strong>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataBinder</strong></p>
<p>DataBinder<span style="font-family: 宋体">是一个将</span>Hibernate<span style="font-family: 宋体">整合到</span>Wicket<span style="font-family: 宋体">中的一个扩展功能，对于那些以数据驱动为开发目的的</span>Web<span style="font-family: 宋体">程序，它是不二之选。</span></p>
<p><a href="http://databinder.net/">http://databinder.net/</a></p>
<p><strong>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hibernate</strong></p>
<p>Hibernate<span style="font-family: 宋体">本身与</span>Wicket<span style="font-family: 宋体">并没有关系，但是</span>Wicket-Stuff<span style="font-family: 宋体">和</span>DataBinder<span style="font-family: 宋体">都已经提供了</span>Hibernate<span style="font-family: 宋体">的扩展功能，所以把</span>Hibernate<span style="font-family: 宋体">也放入这个列表，方便大家使用</span>Hibernate<span style="font-family: 宋体">。</span></p>
<p><a href="http://www.hibernate.org/">http://www.hibernate.org/</a></p>
<p><strong>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QWicket</strong></p>
<p>QWicket<span style="font-family: 宋体">是一些热心的</span>Wicket<span style="font-family: 宋体">开发人员，为了让更多的开发人员了解</span>Wicket<span style="font-family: 宋体">，所以提供了一个很完整的应用程序，它是</span>Wicket<span style="font-family: 宋体">世界中的</span>Appfuse<span style="font-family: 宋体">。</span></p>
<p><a href="http://www.antwerkz.com/qwicket/">http://www.antwerkz.com/qwicket/</a></p>
<p><strong>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wicket Bench</strong></p>
<p>Wicket Bench<span style="font-family: 宋体">是一个用来辅助</span>Wicket<span style="font-family: 宋体">进行开发的</span>Eclipse<span style="font-family: 宋体">插件工具。前面已经对它进行了详细的介绍。</span></p>
<p><a href="http://www.laughingpanda.org/mediawiki/index.php/wicket_bench">http://www.laughingpanda.org/mediawiki/index.php/Wicket_Bench</a></p>
<p><strong>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mail-Archive</strong></p>
<p>Mail-Archive<span style="font-family: 宋体">本身不是一个与技术有关的网站，它是一个邮件组归档的站点，常用的邮件组在上面都有归档，如</span>Jakarta<span style="font-family: 宋体">小组的开源软件，</span>Wicket<span style="font-family: 宋体">也在上面，还有许多，在上面可以查看许多</span>Wicket<span style="font-family: 宋体">的讨论，非常的精彩。</span></p>
<p><span style="font-family: 宋体">你可以通过下面的网址直接访问</span>Mail-Archive<span style="font-family: 宋体">网站上</span>Wicket<span style="font-family: 宋体">邮件组的归档</span>:</p>
<p><a href="http://www.mail-archive.com/wicket-user%40lists.sourceforge.net/">http://www.mail-archive.com/wicket-user%40lists.sourceforge.net/</a></p>
<p><strong>10 </strong><strong><span style="font-family: 宋体">一些</span>Blog</strong></p>
<p>Wicket<span style="font-family: 宋体">的开发人员和</span>Wicket<span style="font-family: 宋体">一些资深用户将自己关于</span>Wicket<span style="font-family: 宋体">的开发经验放在自己的</span>Blog<span style="font-family: 宋体">上，与大家共享</span>:</p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.jroller.com/page/dashorst">A Wicket Diary - Martijn Dashorst </a></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://chillenious.wordpress.com/">Chillenious! - Eelco Hillenius </a></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.jroller.com/page/jonathanlocke">Jonathan - Jonathan Locke</a> </p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://technically.us/n8/">N8than - Nathan Hamblen </a></p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.antwerkz.com/wp/">Antwerkz - Justin Lee</a> </p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.systemmobile.com/">System Mobile - Nick Heudecker</a> </p>
<p>v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://blogs.sun.com/geertjan">Geertjan - Geertjan Wielenga </a></p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/142320.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-09-03 15:32 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142320.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>FLEX是什么及与FLASH的关系的介绍</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/03/15/104066.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Thu, 15 Mar 2007 10:03:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/03/15/104066.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/104066.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/03/15/104066.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/104066.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/104066.html</trackback:ping><description><![CDATA[
		<p>
				<span style="FONT-SIZE: 12px">摘自久久学院<br /><br />Flex 是 Macromedia发布的presentation server（展现服务），它是java web container或者.net server的一个应用，根据.mxml文件（纯粹的xml描述文件和actions cript）产生相应得.swf文件，传送到客户端，由客户端的flash player或者shockwave player解释执行，给用户以丰富的客户体验。<br /><br /><br /><br />大名鼎鼎的Macromedia Flash是强大的矢量动画编辑工具，在作动画起家之后，Flash一直在谋求rich internet application(ria富客户端)的霸主地位，最有影响的是，已经推出了面向对象的编成脚本actions cript2.0，并且建立起类似于java swing的类库和相应component(组件)。Flex是通过java或者.net等非Flash途径，解释.mxml文件组织components，并生成相应得.swf文件。Flex的component和flash的component很相似，但是有所改进增强。<br /><br /><br /><br />运用Flash是完全可以做到flex的效果的，为什么还需要flex呢？我理解这里面有两个原因：<br /><br />1，为了迎合更多的developers（开发者）。Flash天生是为了designer（设计者）设计的，界面还有flash的动画概念和写程序的开发人员格格不入，为了吸引更多的jsp/asp/php等程序员，Macromedia推出了Flex用非常简单的.mxml来描述界面和jsp/asp/php程序人员使用.(x/d)html非常相似，而且mxml更加规范化、标准化。<br /><br />2，为了一个标准。大家一定听说过微软下一代系统longhorn，在longhorn推出的同时微软也会推出新的语言xaml，一种界面描述语言，与之相应的就是smart client和flex非常相似的东西。Mxml和Xaml的也很相似… …由此带来的一些列好处就不用我说了。<br /><br /><br /><br />Flex和j2ee/.net其实没什么关系，Macromedia用java做出来个应用把flash的技术融合到j2ee里面，再用.net的技术做出来个.net应用把flash技术融合到.net里面去；应该说flex解决了j2ee里面和.net最繁琐的问题那就是web 客户端的问题。微软比较卑鄙在ie里面built-in（事先安装好了）很多空间，可以被.net调用比如datagrid，java就没有办法啦，只能用最原始的html一个tag一个tag地print，真是头疼，还有客户端的javas cript是最难调试的，不论java还是.net都束手无策。</span>
		</p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/104066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-03-15 18:03 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/03/15/104066.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 之 jbpm 配置</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/03/02/101471.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Fri, 02 Mar 2007 06:24:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/03/02/101471.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/101471.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/03/02/101471.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/101471.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/101471.html</trackback:ping><description><![CDATA[
		<p>这几天经过多方查找，在Liferay的论坛上找到了答案，希望对如何在Liferay中部署使用jpbm工作流感兴趣的朋友有所帮助。</p>
		<p>1、首先下载 Liferay Portal Professional 4.2.1 (Bundled with Tomcat for JDK 5.0) </p>
		<p>2、使用其默认的 HSQL 数据库，即不去更改其数据库配置。</p>
		<p>3、下载 liferay-portal-servicemix-4.2.1.war 和 iferay-portal-jbpm-4.2.1.war <br /><a href="http://www.liferay.com/web/guest/downloads">http://www.liferay.com/web/guest/downloads</a></p>
		<p>4、把下载的这两个包分别更名为jbpm-web.war 和 servicemix-web.war</p>
		<p>5、把 jbpm-web.war 和 servicemix-web.war 拷贝到 Tomcat 的 webapps 目录中<br /><br />6、把 webapps\jbpm-web\WEB-INF\sql  目录中的 hsqldb.create.jbpm.3.1.sql 文件更名为 jbpm.script  ，并把它放入 tomcat 的 bin 目录。<br /><br />7、运行 Tomcat 的 startup.bat<br /><br />8、打开 <a href="http://localhost:8080/">http://localhost:8080/</a> ，并使用 test@liferay.com 用户登录 （密码为 test）<br /><br />9、增加  workflow portlet 项，选择其中的 definitions 标签，选择 add 按钮。<br /><br />10、在  text area 中输入工作流定义，如：<br /><br />1<br /><span class="message-board-code-lines"> 2</span>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br /><span class="message-board-code-lines"> 3</span><br /><span class="message-board-code-lines"> 4</span>&lt;process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="Example Process"&gt;<br /><span class="message-board-code-lines"> 5</span>    &lt;start-state name="start"&gt;<br /><span class="message-board-code-lines"> 6</span>        &lt;task&gt;<br /><span class="message-board-code-lines"> 7</span>            &lt;assignment class="com.liferay.jbpm.handler.IdentityAssignmentHandler" &gt;<br /><span class="message-board-code-lines"> 8</span>                &lt;companyId&gt;liferay.com&lt;/companyId&gt;<br /><span class="message-board-code-lines"> 9</span>                &lt;type&gt;user&lt;/type&gt;<br /><span class="message-board-code-lines">10</span>                &lt;name&gt;test@liferay.com&lt;/name&gt;<br /><span class="message-board-code-lines">11</span>            &lt;/assignment&gt;<br /><span class="message-board-code-lines">12</span>            &lt;controller&gt;<br /><span class="message-board-code-lines">13</span>                &lt;variable name="text:color" /&gt;<br /><span class="message-board-code-lines">14</span>                &lt;variable name="text:size" /&gt;<br /><span class="message-board-code-lines">15</span>            &lt;/controller&gt;<br /><span class="message-board-code-lines">16</span>        &lt;/task&gt;<br /><span class="message-board-code-lines">17</span>        &lt;transition name="to_t" to="t"/&gt;<br /><span class="message-board-code-lines">18</span><br /><span class="message-board-code-lines">19</span>    &lt;/start-state&gt;<br /><span class="message-board-code-lines">20</span><br /><span class="message-board-code-lines">21</span>    &lt;task-node name="t"&gt;<br /><span class="message-board-code-lines">22</span>        &lt;task name="t" &gt;<br /><span class="message-board-code-lines">23</span>            &lt;controller &gt;<br /><span class="message-board-code-lines">24</span>                &lt;variable name="text:color" access="read" /&gt;<br /><span class="message-board-code-lines">25</span>                &lt;variable name="text:size"  access="read"/&gt;<br /><span class="message-board-code-lines">26</span>            &lt;/controller&gt;<br /><span class="message-board-code-lines">27</span>            &lt;assignment class="com.liferay.jbpm.handler.IdentityAssignmentHandler" &gt;<br /><span class="message-board-code-lines">28</span>                &lt;companyId&gt;liferay.com&lt;/companyId&gt;<br /><span class="message-board-code-lines">29</span>                &lt;type&gt;user&lt;/type&gt;<br /><span class="message-board-code-lines">30</span>                &lt;name&gt;test@liferay.com&lt;/name&gt;<br /><span class="message-board-code-lines">31</span>            &lt;/assignment&gt;<br /><span class="message-board-code-lines">32</span>        &lt;/task&gt;<br /><span class="message-board-code-lines">33</span>        &lt;transition name="to_end" to='end' /&gt;<br /><span class="message-board-code-lines">34</span>    &lt;/task-node&gt;<br /><span class="message-board-code-lines">35</span>    &lt;end-state name="end"&gt;&lt;/end-state&gt;<br /><span class="message-board-code-lines">36</span>&lt;/process-definition&gt;<br /><br />11、提交此示例，则生成一个工作流程。<br /><br />12、在  tasks view ，选择 "manage" 来执行此 tasks 。<br /></p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/101471.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-03-02 14:24 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/03/02/101471.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java Web services 开发之建立Web services（使用 Web Tools Project）</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101167.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Wed, 28 Feb 2007 08:40:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101167.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/101167.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101167.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/101167.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/101167.html</trackback:ping><description><![CDATA[
		<br />You can create of Web services using a top-down approach (which starts with a WSDL file) or a bottom-up approach (which starts with a Java bean or EJB).<br /><br />建立Web services有两种方式：<br /><br />top-down ：是从WSDL 开始，Top-down Web services development involves creating a Web service from a WSDL file.<br /><br />bottom-up ：是从Java bean or EJB开始，Bottom-up Web services development involves creating a Web service from a Java™ bean or enterprise bean.<br /><br />通用的开发步骤有以下几步：<br /><br /><ol><li><span>Create a Web project.</span></li><li><span>Create or import an artifact to be turned into a Web service.</span></li><li><span>Create a Web service.</span></li><li><span>Publish a business entity.</span></li><li><span>Publish a Web service.</span></li></ol><p>首先介绍一下top-down方式：<br /><br /></p><ol><li class="stepexpand"><span>Switch to the J2EE perspective (<span class="uicontrol">Window &gt; Open Perspective &gt; J2EE</span>).</span></li><li class="stepexpand"><span>In the Project Explorer view, select the WSDL file that you created or imported into the Web Content folder of your Web project.</span></li><li class="stepexpand"><span>Click <span class="uicontrol">File &gt; New &gt; Other</span>. Select <span class="uicontrol">Web Services</span> in order to display the various Web service wizards. Select the <span class="uicontrol">Web Service</span> wizard. Click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Web Services page: select <span class="uicontrol">Top down Java bean Web service</span> as your Web service type. You can optionally choose to do the following: </span><ul><li>Start the Web service in a Web project - if you do not select this option you will have to manually start the Web service. You must select this option to enable the other options on this page. 
</li><li>Launch the Web Services Explorer to publish your Web service to a UDDI registry. 
</li><li>Generate a Java?bean client proxy to the Web service. The Java bean client proxy that is generated provides a remote procedure call interface to the Web service. 
</li><li>Test the Web service - this allows you to test the Web service in the Web Service Explorer before a proxy is generated. 
</li><li>Send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance. Note that this is only supported for Tomcat v4.0 and v4.1. If you are using Tomcat v5.0 and want to monitor the Web service traffic, you need to manually set up a TCP/IP monitor  </li></ul></li><li class="stepexpand"><span>Web Service Selection page: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the Java bean. If you have selected the WSDL file before starting the wizard, this information should be prefilled. You can optionally generate a WSIL file from this file as well.</span> Ensure that there are no spaces at the beginning of the URI or you may generate a null pointer exception. 
</li><li class="stepexpand"><span>Service Deployment Configuration page: specify the server and client deployment settings.</span><ol type="a"><li class="substepexpand"><span>Click <span class="uicontrol">Edit</span> and select the Apache Axis run-time environment and select the server on which you want to run your Web service and Web service client.</span></li><li class="substepexpand"><span>Select the Web project in which you want your Web service created. </span>The wizard will create this for you if they do not already exist. 
</li><li class="substepexpand"><span>Select the type and name of project in which you want the Web service client created. If you enter the name of an existing project, the project type field must match that of the existing project. If you enter a name of a project that does not already exist, the wizard will create the project for you. Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere<sup>   </sup>run-time environment for your client.</span></li></ol></li><li class="stepexpand"><span>Web Services Skeleton Java Bean Configuration page: Select the folder where the generated Java will be stored. If you want to review or edit the mappings between packages and namespaces, select the <span class="uicontrol">Define custom mapping for namespace to package</span> check box. Click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Web Service Namespace to Package Mappings page: if you selected <span class="uicontrol">Define custom mapping for package to namespace</span> on the previous panel, you can enter your custom mapping pairs on this panel by clicking <span class="uicontrol">Add.</span> Click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Web Service Test page: If you selected to test the Web service, select the test facility for the generated Web service. This will open the Web service in the Web Services Explorer. Select the operation you want to test, enter the required information, and click <span class="uicontrol">Go</span>. The result will display in the Status pane. Click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Web Service Proxy page: If you have selected to generate a proxy, this page shows the options for the proxy. It lists the folder where the proxy will be generated, and you can optionally create custom mappings between namespaces and packages. Click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Web Service Client Test page: Use this page to select the following options: </span><ol type="a"><li><span>Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.</span></li><li><span>If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.</span></li><li><span>Select <span class="uicontrol">Run test on server</span> to start the server for you automatically.</span></li></ol></li><li class="stepexpand"><span>Web Service Publication page: If you have selected to publish your Web service to a UDDI registry, use this page to launch the Web Services Explorer and select the UDDI registry to which the Web service will be published. Click <span class="uicontrol">Finish</span>.</span></li></ol><p class="stepexpand">bottom-up方式：<br /><br /></p><ol><li class="stepexpand"><span>Switch to the J2EE perspective ( <span class="uicontrol">Window &gt; Open Perspective &gt; J2EE</span>).</span></li><li class="stepexpand"><span>In the Project Explorer view, select the bean that you created or imported into the source folder of your Web project.</span></li><li class="stepexpand"><span>Click <span class="uicontrol">File &gt; New &gt; Other</span>.</span> Select<span class="uicontrol">Web Services</span> in order to display the various Web service wizards. Select the <span class="uicontrol">Web Service</span> wizard. Click <span class="uicontrol">Next</span>. 
</li><li class="stepexpand"><span>Web Services page: select <span class="uicontrol">Bottom up Java bean Web service</span> as your Web service type. You can optionally choose to do the following: </span><ul><li>Start the Web service in a Web project - if you do not select this option you will have to manually start the Web service. You must select this option to enable the other options on this page. 
</li><li>Launch the Web Services Explorer to publish your Web service to a UDDI registry. 
</li><li>Generate a Java bean client proxy to the Web service. The Java bean client proxy that is generated provides a remote procedure call interface to the Web service. 
</li><li>Test the Web service - this allows you to test the Web service in the Web Service Explorer before a proxy is generated. 
</li><li>Send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance. Note that this is only supported for Tomcat v4.0 and v4.1. If you are using Tomcat v5.0 and want to monitor the Web service traffic, you need to manually set up a TCP/IP monitor  </li></ul></li><li class="stepexpand"><span>Object selection page: select the Java bean from which the Web service will be created.</span></li><li class="stepexpand"><span>Service Deployment Configuration page: specify the server and client deployment settings.</span><ol type="a"><li class="substepexpand"><span>Click <span class="uicontrol">Edit</span> and select the Apache Axis run-time environment and select the server on which you want to run your Web service and Web service client.</span></li><li class="substepexpand"><span>Select the Web project in which you want your Web service created, and the EAR with which it will be associated. </span>The wizard will create these for you if they do not already exist. 
</li><li class="substepexpand"><span>Select the type and name of project in which you want the Web service client created. If you enter the name of an existing project, the project type field must match that of the existing project. If you enter a name of a project that does not already exist, the wizard will create the project for you. Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere<sup>  </sup>run-time environment for your client.</span></li><li class="substepexpand"><span>Select an existing EAR or enter a unique name to associate the Web service client with a different EAR than the Web service EAR. <strong>Note:</strong> Selecting different EARs for the Web service and Web service client can reduce the chance of encountering run time errors, but will use more system resources.</span></li></ol></li><li class="stepexpand"><span>A message will display stating that you have made a WS-I non-compliant selection.</span> The Apache Axis run-time environment is not WS-I compliant. Select <span class="uicontrol">Ignore</span>. 
</li><li class="stepexpand"><span>Web Service Java Bean Identity page: the Web service URI and WSDL name will be listed.</span> You?have the following options: 
<ul><li>Select the methods to expose. 
</li><li>Select the encoding style. RPC/Encoded is the recommended encoding style for the Axis run-time environment. This encoding method is not WS-I compliant. 
</li><li>Select if you want to customize the package to namespace mappings. </li></ul>Click <span class="uicontrol">Next</span></li><li class="stepexpand"><span>Web Service Package to Namespace Mappings page: if you selected <span class="uicontrol">Define custom mapping for package to namespace</span> on the previous panel, you can enter your custom mapping pairs on this panel by clicking <span class="uicontrol">Add</span>.</span></li><li class="stepexpand"><span>Web Service Test page: If you selected to test the Web service, select the test facility for the generated Web service.</span> This will open the Web service in the Web Services Explorer. Select the operation you want to test, enter the required information, and click<span class="uicontrol">Go</span>. The result will display in the Status pane. Click <span class="uicontrol">Next</span>. 
</li><li class="stepexpand"><span>Web Service Proxy page: if you have selected to generate a proxy, select if you want to customize the package to namespace mappings.</span></li><li class="stepexpand"><span>Web Service Client Test page: Use this page to select the following options: </span><ol type="a"><li><span>Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.</span></li><li><span>If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.</span></li><li><span>Select <span class="uicontrol">Run test on server</span> to start the server for you automatically.</span></li></ol></li><li class="stepexpand"><span>Web Service Publication page: Select whether or not you want to publish this Web service to a UDDI registry. Click <span class="uicontrol">Finish</span> . Note: you may see a warning stating <samp class="codeph">Error in generating WSDL from Java. ClassNotFound: &lt;bean name&gt;</samp>. This error can be safely ignored. </span></li></ol><p class="stepexpand">最后我们可建立<span>Web Service Client来验证<span>Web Service 的使用。<br /><br />首先需要发现Web services，步骤如下：<br /><br />从UDDI 查找：<br /><br /></span></span></p><ol><li><span>Launch the Web Services Explorer</span></li><li><span>Click <span class="uicontrol">UDDI Main</span>.</span></li><li><span>In the Actions pane select a registry from the drop-down list and click <span class="uicontrol">Go</span>.</span></li><li><span>In the Actions pane toolbar click the <strong>Find</strong> icon <img alt="A picture of the Find icon." src="http://127.0.0.1:56914/help/topic/org.eclipse.jst.ws.consumption.ui.doc.user/images/find.gif" />.</span></li><li><span>In the Actions pane, enter the name of the query, what you are searching for, the type of search that you want to perform, and any query information: </span><ol type="a"><li class="substepexpand"><span><strong>Search for</strong>  This list allows you to search for businesses, services, or service interfaces. </span><ul><li><strong>Businesses</strong> Once you locate a business in the registry, use the icons in the Action pane toolbar to do the following: 
<ul><li>View and edit business details 
</li><li>Get the services associated with that business 
</li><li>Publish a service 
</li><li>Manage referenced services 
</li><li>Manage publisher assertions 
</li><li>Add the business to Favorites 
</li><li>Unpublish the business </li></ul></li><li><strong>Services</strong> Once you locate a service in the registry, use the icons in the Action pane toolbar to do the following: 
<ul><li>View and edit service details 
</li><li>Get the business associated with that service 
</li><li>Get the service interfaces associated with that service 
</li><li>Import the service WSDL file to the Eclipse workbench 
</li><li>Import the service WSDL file to the file system 
</li><li>Launch the Web Service wizards 
</li><li>Add the service to Favorites 
</li><li>Unpublish the service </li></ul></li><li><strong>Service interfaces</strong> Once you locate a service interface in the registry, use the icons in the Action pane toolbar to do the following: 
<ul><li>View and edit interface details 
</li><li>Get the services associated with that service interface 
</li><li>Get the businesses associated with that service interface 
</li><li>Import the service interface WSDL file to the Eclipse workbench 
</li><li>Import the service interface WSDL file to the file system 
</li><li>Launch the Web Service wizards 
</li><li>Add the service interface to Favorites 
</li><li>Unpublish the service interface </li></ul></li></ul></li><li class="substepexpand"><span><strong>Type of search</strong>  These radio buttons allow you to specify a simple or advanced search, or a search by a Universal Unique Identifier (UUID). </span><dl><dt class="dlterm">Simple 
</dt><dd>Type the name of the businesses, services, or service interfaces for which you are searching. <strong>Note:</strong> The search set size is set to 100 and the maximum number of returned results is set to 10 by default.  If you would like to override the defaults, use the Advanced search. 
</dd><dt class="dlterm">Advanced 
</dt><dd>Allows you to enter more search options to focus the scope of your search. Select this option if you would like to search for multiple businesses or services. 
</dd><dt class="dlterm">UUID 
</dt><dd>Allow you to enter the UUID key.  The UUID key is the identifier that is associated with the published object. </dd></dl></li></ol></li><li><span>Once you have searched and discovered the business service description you desired, select the service or the service interface and click the <strong>Import</strong> icon to: </span><ul><li>import the WSDL document into your Web project 
</li><li>import the WSDL document into the WSDL Explorer for testing 
</li><li>launch the Web Service Skeleton Creation wizard or Web Service Client wizard directly from the Web Services Explorer. </li></ul></li></ol><p class="stepexpand">从WSIL 查找：<br /><br /></p><ol><li class="stepexpand"><span>From the Web Services Explorer toolbar, click the <strong>WSIL Page</strong> icon <img alt="Picture of the WSIL Page icon." src="http://127.0.0.1:56914/help/topic/org.eclipse.jst.ws.consumption.ui.doc.user/images/wsilview.gif" />.</span></li><li class="stepexpand"><span>In the Navigator pane, click <strong>WSIL Main</strong>.</span></li><li class="stepexpand"><span>In the <strong>URL to document</strong> field of the Actions pane enter the URL to the WSIL document or HTTP document that contains links to a WSIL document. Details on how an HTTP file can contain links to WSIL can be found here: http://www.ibm.com/developerworks/webservices/library/ws-wsilspec.html</span></li><li class="stepexpand"><span>Once you have located the WSIL document, use the icons in the Action pane toolbar to do the following:</span><ul><li>View WSIL document details 
</li><li>List all of the WSDL services associated with that WSIL document 
</li><li>List all of the UDDI services associated with that WSIL document 
</li><li>List all of the UDDI businesses associated with that WSIL document 
</li><li>List all of the WSIL links associated with that WSIL document 
</li><li>Import the WSIL document to the file system 
</li><li>Add the WSIL document to Favorites </li></ul><strong>Important:</strong> If the IBM Web Services Explorer does not display the project that you would like to import your WSDL file to, ensure that you have created the project and/or click the <strong>Refresh</strong> icon. </li></ol><p class="stepexpand">建立<span>Web Service Client：<br /><br /></span></p><ol><li><span>Switch to the J2EE perspective (<span class="uicontrol">Window &gt; Open Perspective &gt; J2EE</span>).</span></li><li><span>In the Navigator view, select the Web project in which you want to generate a sample application.</span></li><li><span>Click <span class="uicontrol">File &gt; New &gt; Other</span>. Select <span class="uicontrol">Web Services</span> in order to display the various Web service wizards. Select the <span class="uicontrol">Web Service Client</span> wizard. Click <span class="uicontrol">Next</span>.</span></li><li><span>Web Services page: Select the type of proxy to be generated, and whether or not it will be tested.</span></li><li><span>Client Environment Configuration page: Select the run-time environment and the server for your Web service client.</span><ol type="a"><li class="substepexpand"><span>Click <span class="uicontrol">Explore Options</span> and select the Apache Axis run-time environment and select the server on which you want to run your Web service client.</span></li><li class="substepexpand"><span>Select the type and name of project in which you want the Web service client created.</span><ul><li>If you enter the name of an existing project, the project type field must match that of the existing project. Ensure that the project selected as the Client Web Project is different from the Service Web Project, or the service will be overwritten by the client's generated artifacts. 
</li><li>If you enter a name of a project that does not already exist, the wizard will create the project for you. 
</li><li>Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere run-time environment for your client. </li></ul></li></ol></li><li><span>Web Service Selection page: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the client. You can optionally generate a WSIL file from this file as well.</span></li><li><span>Web Service Proxy page: This panel shows the options for the proxy. It lists the folder where the proxy will be generated, and you can optionally create custom mappings between namespaces and packages.</span></li><li><span>Web Service Namespace to Package Mappings page: if you selected <span class="uicontrol">Define custom mapping for namespace to package</span> on the previous page, you can enter your custom mapping pairs on this page by clicking <span class="uicontrol">Add</span>.</span></li><li><span>Web Service Client Test page: Select the test facility that you will use to test the proxy, and the methods that you want included in the proxy. Note that the Universal Test Client (UTC) is only compatible with Web service clients deployed on WebSphere servers.</span></li><li><span>Click <span class="uicontrol">Finish</span>. If you have selected to test the proxy, the test client will open in a browser window.</span></li></ol><img src ="http://www.blogjava.net/hengheng123456789/aggbug/101167.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-28 16:40 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101167.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java Web services 开发之WSDL （使用 Web Tools Project） </title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101120.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Wed, 28 Feb 2007 08:28:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101120.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/101120.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101120.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/101120.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/101120.html</trackback:ping><description><![CDATA[我使用的是lomboz-wtp-emf-gef-jem-3.1.2的Eclipse插件，开源的项目。<br /><br />一、Importing a WSDL file<br /><br /><ol><li class="stepexpand"><span>Select your project in the J2EE Navigator pane, and from the <span class="uicontrol">File</span> menu, select <span class="uicontrol">Import</span>.</span></li><li class="stepexpand"><span>Select <span class="uicontrol">File System</span> and click <span class="uicontrol">Next</span>.</span></li><li class="stepexpand"><span>Click the <span class="uicontrol">Browse</span> button on the next page of the wizard to select the directories from which you would like to add the WSDL.</span></li><li class="stepexpand"><span>In the import selection panes, use the following methods to select exactly the resources you want to add: </span><ul><li>Expand the hierarchies in the left pane and select or clear the checkboxes that represent the folders in the selected directory. Then in the right pane, select or clear checkboxes for individual files. 
</li><li>Click <span class="uicontrol">Filter Types</span> to filter the current selection for files of a specific type. 
</li><li>Click <span class="uicontrol">Select All</span> to select all resources in the directory, then go through and deselect the ones that you do not want to add. 
</li><li>Click <span class="uicontrol">Deselect All</span> to deselect all resources in the directory, then go through and choose individual resources to add. </li></ul></li><li class="stepexpand"><span>Specify the Workbench project or folder that will be the import destination.</span></li><li class="stepexpand"><span>When you have finished specifying your import options, click <span class="uicontrol">Finish.</span></span></li></ol>二、Creating a new WSDL file<br /><br /><ol><li class="stepexpand"><span>Create a project to contain the WSDL document.</span> It does not matter what kind of project you create. 
</li><li class="stepexpand"><span>In the workbench, click <strong>File &gt; New &gt; Other &gt; Web Services &gt; WSDL</strong>.</span> Click <strong>Next</strong>. 
</li><li class="stepexpand"><span>Select the project or folder that will contain the WSDL file.</span> In the <strong>File name</strong> field, type the name of the WSDL file, for example <tt class="sysout">MyWSDLFile.wsdl</tt>. The name of your XML file must end in <tt class="sysout">.wsdl</tt></li><li class="stepexpand"><span>Click <strong>Next.</strong></span></li><li class="stepexpand"><span>Enter the following information: </span><ol type="a"><li class="substepexpand"><span><strong>Target namespace</strong> is the namespace for the WSDL file or accept the default (<samp class="codeph">http://www.example.org/<em>MyWSDLFile</em>/</samp>).</span> The target namespace is used for the names of messages and the port type, binding and service defined in the WSDL file. The value must take the form of a valid URI (for example, <samp class="codeph">http://www.mycompany.com/myservice/</samp>) 
</li><li class="substepexpand"><span>The <strong>Prefix</strong> is the prefix associated with the target namespace.</span></li><li class="substepexpand"><span>Select <span class="uicontrol">Create WSDL Skeleton</span> if you want the wizard to create the skeleton of the WSDL file.</span> This will generate the WSDL elements required for your service, including bindings, ports and messages. You can then modify these to meet the requirements of your Web service. 
</li><li class="substepexpand"><span>If you have chosen to create a WSDL skeleton, select the binding options you want to use in the WSDL document. The options are SOAP and HTTP.</span> If you select SOAP you can then select the encoding style you want to use. If you select HTTP you can select whether to create an HTTP getter or setter. </li></ol></li><li class="stepexpand"><span>Click <strong>Finish</strong>.</span> The WSDL file opens in the WSDL editor. </li></ol><li>services, which are used to aggregate a set of related ports. These are the root elements of all WSDL files. 
</li><li>ports, which specify an address for a binding, thus defining a single communication endpoint. 
</li><li>bindings, which specify concrete protocol and data format specifications for the operations and messages defined by a particular port type. 
</li><li>port types, which are a set of abstract operations. Each operation refers to an input message and output messages. 
</li><li>operations, which refer to input and output messages 
</li><li>messages, which represent an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system. 
</li><li>parts, which are a flexible mechanism for describing the logical abstract content of a message 
</li><li>types, which describe all the data types used between the client and server. WSDL is not tied exclusively to a specific typing system, but it uses the W3C XML Schema specification as its default choice. 
</li><li>import statements, which are used to associate a namespace with a document location </li><p><br /> </p><img src ="http://www.blogjava.net/hengheng123456789/aggbug/101120.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-28 16:28 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101120.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java Web services 开发之概念</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101111.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Wed, 28 Feb 2007 05:11:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101111.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/101111.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101111.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/101111.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/101111.html</trackback:ping><description><![CDATA[
		<p>The following standards play key roles in Web services: Universal Description, Discovery and Integration (UDDI), Web Services Description Language (WSDL), Web Services Inspection Language (WSIL), Simple Object Access Protocol (SOAP) and Web Services Interoperability (WS-I). The relationship between these standards is described in Figure .<br /><br />与Web services密切相关的主要标准有以下几种：<br /><br />1、UDDI<br /><br />UDDI是平台无关的，为业务提供了一个全局的注册、查找Web Services 的规范。<br /><br />UDDI has two functions: </p>
		<div class="p">
				<ul>
						<li>It is a SOAP-based protocol that defines how clients communicate with UDDI registries. 
</li>
						<li>It is a particular set of global replicated registries. </li>
				</ul>
		</div>
		<p>UDDI includes an XML schema for SOAP messages that defines a set of documents to describe business and services information, a common set of APIs for querying and publishing information to the directories, and an API for replicating directory entries between peer UDDI nodes.<br /><br />2、WSIL<br /><br />Web Services Inspection Language (WSIL) is a service discovery mechanism that is an alternative to UDDI as well as complementary to UDDI. When you discover Web services with UDDI, you go to a centralized registry.  WSIL is an alternative approach to Web service discovery.  WSIL allows you to go directly to the service provider and ask for the services it provides.<br /><br />WSIL也是用于查找Web Services 的机制。它是UDDI的补充。<br /><br />The Web Services Inspection Language (WSIL) and the Universal Description, Discovery, and Integration (UDDI) specification both address issues related to Web service discovery.  However, each specification takes a different approach to the discovery of Web services.  The two specifications can be used separately or jointly; searching with WSIL can result in finding items in UDDI.<br /><br />3、WSDL<br /><br />WSDL is an XML-based open specification that describes the interfaces to and instances of Web services on the network. It is extensible, so endpoints can be described regardless of the message formats or network protocols that are used to communicate. <br /><br />Relationship between UDDI and WSDL<br /><img height="377" alt="o_wsdluddi.gif" src="http://www.blogjava.net/images/blogjava_net/hengheng123456789/14649/o_wsdluddi.gif" width="556" border="0" /><br /></p>
		<p>Figure  illustrates the relationship between UDDI and WSDL. The WSDL service element references the WSDL binding element. The URL of the document containing the WSDL binding element is published to the UDDI business registry as a tModel. The URL of the document containing the WSDL service element is published to the UDDI business registry as a businessService and contains information about the bindingTemplate. <br /><br /><br />4、SOAP<br /><br />SOAP is an XML-based standard for messaging over HTTP and other Internet protocols. It is a lightweight protocol for the exchange of information in a decentralized, distributed environment. It is based on XML and consists of three parts: </p>
		<ul>
				<li>An envelope that defines a framework for describing what is in a message and how to process it. 
</li>
				<li>A set of encoding rules for expressing instances of application-defined data types. 
</li>
				<li>A convention for representing remote procedure calls and responses. </li>
		</ul>
		<p>SOAP enables the binding and usage of discovered Web services by defining a message path for routing messages. SOAP may be used to query UDDI for Web services.<br /><br />简单对象访问协议（SOAP）是一种轻量的、简单的、基于 XML 的协议，它被设计成在 WEB 上交换结构化的和固化的信息。 SOAP 可以和现存的许多因特网协议和格式结合使用，包括超文本传输协议（ HTTP），简单邮件传输协议（SMTP），多用途网际邮件扩充协议（MIME）。它还支持从消息系统到远程过程调用（RPC）等大量的应用程序。</p>
		<p>　　SOAP 包括三个部分： </p>
		<ul>
				<li>SOAP 封装：它定义了一个框架，该框架描述了消息中的内容是什么，谁应当处理它以及它是可选的还是必须的。 
</li>
				<li>SOAP 编码规则：它定义了一种序列化的机制，用于交换应用程序所定义的数据类型的实例。 
</li>
				<li>SOAP RPC 表示：它定义了用于表示远程过程调用和应答的协定。 </li>
		</ul>
		<p>　　SOAP 消息基本上是从发送端到接收端的单向传输，但它们常常结合起来执行类似于请求 / 应答的模式。所有的 SOAP 消息都使用 XML 编码。一条 SOAP 消息就是一个包含有一个必需的 SOAP 的封装包，一个可选的 SOAP 标头和一个必需的 SOAP 体块的 XML 文档。<br /><br />SOAP 消息格式：</p>
		<p>　　SOAP 标头</p>
		<p>　　&lt;SOAP-ENV: Envelope Attributes&gt;</p>
		<p>　　&lt;SOAP-ENV:Body&gt;</p>
		<p>　　Attributes </p>
		<p>　　&lt;/SOAP-ENV:Body&gt; </p>
		<p>　　&lt;/SOAP-ENV:Envelope&gt; <br /><br /><img height="481" alt="o_soapudws.gif" src="http://www.blogjava.net/images/blogjava_net/hengheng123456789/14649/o_soapudws.gif" width="510" border="0" /><br /></p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/101111.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-28 13:11 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101111.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java Web services 开发之概述</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101093.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Wed, 28 Feb 2007 03:31:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101093.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/101093.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101093.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/101093.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/101093.html</trackback:ping><description><![CDATA[Web services 是一系列相互关联的应用函数，它们可以在Internet上被调用。Web services 是独立的、可以自己解释自己的组件，可以在Web上发布、定位、和调用。<br /><br />Web services 的种类可以为三种：<br /><br />1、共享商业信息。如：新闻、天气预报、股票行情等。<br />2、商业集成。如：网上拍卖、预订系统、信用校验等。<br />3、商业流程扩展。如：合并企业的制造、批发、零售等业务流程。<br /><br />Web services 的业务角色和交互<br /><br />可以分为service provider, service broker, and service client<br /><br /><li>Service providers create and deploy their Web services and can publish the availability of their WSDL-described services through a service registry, such as a UDDI Business Registry. </li><p>service provider主要是建立发布Web services。</p><li>Service brokers register and categorize published services and provide search services. For example, UDDI acts as a service broker for WSDL-described Web services. </li><p>Service brokers 是归类并注册Web services，以利于查询。</p><li>Service clients use broker services such as the UDDI Business Registry to discover a needed WSDL-described service and then bind to and call the service provider.</li><p>Service clients 则是在Service brokers中查找到Web services，然后绑定到Service providers并调用之。</p><p><img height="203" alt="o_roles.gif" src="http://www.blogjava.net/images/blogjava_net/hengheng123456789/14649/o_roles.gif" width="409" border="0" /><br /><br />可以参考<a href="http://www.ibm.com/developerworks/webservices" target="_blank">www.ibm.com/developerworks/webservices</a></p><img src ="http://www.blogjava.net/hengheng123456789/aggbug/101093.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-28 11:31 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/28/101093.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 技术理解之 CMS</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99124.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Sat, 10 Feb 2007 05:30:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99124.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/99124.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99124.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/99124.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/99124.html</trackback:ping><description><![CDATA[      Liferay Portal <span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">CMS（Content Manage System）</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">提供了两大功能：文档管理和文章发布。文档管理包括文档库和图片集两个</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">portlets</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">，能够提供对</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Microsoft Office</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">文档、</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">PDFs</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">、文本文件和图片的管理；文章发布功能依靠</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Liferay Portal</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">中的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Journal portlet</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">完成，它的特性是能够将数据（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">data entry</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">）和版面设计（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Layout Design</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">）很轻易的分开，这就使得</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">content</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">能够复合一致的“</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">look and feel</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">”，另外，</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Journal portlet</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">提供了</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">content</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">的版本跟踪和发布流程的功能。<br /><span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"><font face="宋体">    
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><span lang="EN-US"><font face="Times New Roman">Liferay Portal</font></span><span style="FONT-FAMILY: 宋体">的</span><span lang="EN-US"><font face="Times New Roman">CMS</font></span><span style="FONT-FAMILY: 宋体">功能是通过</span><span lang="EN-US"><font face="Times New Roman">Journal Portlet</font></span><span style="FONT-FAMILY: 宋体">实现的，在介绍怎样使用</span><span lang="EN-US"><font face="Times New Roman">Journal Portlet</font></span><span style="FONT-FAMILY: 宋体">之前，有必要理解</span><span lang="EN-US"><font face="Times New Roman">structures</font></span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US"><font face="Times New Roman">templates</font></span><span style="FONT-FAMILY: 宋体">和</span><span lang="EN-US"><font face="Times New Roman">articles</font></span><span style="FONT-FAMILY: 宋体">的概念，它们是</span><span lang="EN-US"><font face="Times New Roman">Journal portlet</font></span><span style="FONT-FAMILY: 宋体">功能的基础。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt"><span lang="EN-US" style="FONT-FAMILY: Wingdings"><span>l<span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal">         </span></span></span><strong><span lang="EN-US"><font face="Times New Roman">Structures</font></span></strong><span style="FONT-FAMILY: 宋体">：定于了</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">的类型和数量，</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">的类型包括</span><span lang="EN-US"><font face="Times New Roman">text</font></span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US"><font face="Times New Roman">text area</font></span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US"><font face="Times New Roman">images</font></span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US"><font face="Times New Roman">selection lists</font></span><span style="FONT-FAMILY: 宋体">等</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt"><span lang="EN-US" style="FONT-FAMILY: Wingdings"><span>l<span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal">         </span></span></span><strong><span lang="EN-US"><font face="Times New Roman">Templates</font></span></strong><span style="FONT-FAMILY: 宋体">：确定</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">怎样排列或摆放</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt"><span lang="EN-US" style="FONT-FAMILY: Wingdings"><span>l<span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal">         </span></span></span><strong><span lang="EN-US"><font face="Times New Roman">Articles</font></span></strong><span style="FONT-FAMILY: 宋体">：确定每个</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">包含的实际的</span><span lang="EN-US"><font face="Times New Roman">text</font></span><span style="FONT-FAMILY: 宋体">和</span><span lang="EN-US"><font face="Times New Roman">images</font></span></p><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">   <br />    我们以下图为例定义一个</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">content</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">，分为三个步骤：</span></font><br /><a href="/images/blogjava_net/coldtear/CMS/1.JPG" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" height="535" alt="1.JPG" src="http://www.blogjava.net/images/blogjava_net/coldtear/CMS/1.JPG" width="500" onload="java_script_:if(this.width&gt;500)this.width=500" border="0" /></a><br /><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体">第一步、创建</span><span lang="EN-US">Structure</span><span style="FONT-FAMILY: 宋体">，包含一下元素：一个</span><span lang="EN-US">text</span><span style="FONT-FAMILY: 宋体">元素名为“</span><span lang="EN-US">headline</span><span style="FONT-FAMILY: 宋体">”（对应图片</span><span lang="EN-US">1</span><span style="FONT-FAMILY: 宋体">区域）、三个</span><span lang="EN-US">text area</span><span style="FONT-FAMILY: 宋体">元素为名称分别为“</span><span lang="EN-US">body-text</span><span style="FONT-FAMILY: 宋体">”（对应</span><span lang="EN-US">4</span><span style="FONT-FAMILY: 宋体">区域）“</span><span lang="EN-US">caption-1</span><span style="FONT-FAMILY: 宋体">”（对应</span><span lang="EN-US">2</span><span style="FONT-FAMILY: 宋体">区域）“</span><span lang="EN-US">caption-2</span><span style="FONT-FAMILY: 宋体">”（对应</span><span lang="EN-US">6</span><span style="FONT-FAMILY: 宋体">区域）、两个</span><span lang="EN-US">image</span><span style="FONT-FAMILY: 宋体">元素名称分别为“</span><span lang="EN-US">image-1</span><span style="FONT-FAMILY: 宋体">”（对应</span><span lang="EN-US">3</span><span style="FONT-FAMILY: 宋体">区域）和“</span><span lang="EN-US">image-2</span><span style="FONT-FAMILY: 宋体">”（对应</span><span lang="EN-US">5</span><span style="FONT-FAMILY: 宋体">区域）</span></p><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">添加完这些元素后的界面如下：<br /><a href="/images/blogjava_net/coldtear/CMS/2.JPG" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" height="251" alt="2.JPG" src="http://www.blogjava.net/images/blogjava_net/coldtear/CMS/2.JPG" width="500" onload="java_script_:if(this.width&gt;500)this.width=500" border="0" /></a><br /><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体">点击</span><span lang="EN-US"><font face="Times New Roman">Launch Editor</font></span><span style="FONT-FAMILY: 宋体">按钮，可以看到</span><span lang="EN-US"><font face="Times New Roman">XML</font></span><span style="FONT-FAMILY: 宋体">定义，也可以在此增删或修改元素及类型，内容如下：<br /></span></p><div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">root</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">headline</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">text</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">body-text</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">text_area</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">caption-1</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">text_area</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">caption-2</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">text_area</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">image-1</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">image</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">image-2</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)"> type</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">image</span><span style="COLOR: rgb(0,0,0)">'</span><span style="COLOR: rgb(0,0,0)">&gt;&lt;/</span><span style="COLOR: rgb(0,0,0)">dynamic</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">element</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a></span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">root</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a></span></div></span></span></span><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 31.5pt; TEXT-INDENT: -31.5pt"><span style="FONT-FAMILY: 宋体">第二步、创建</span><span lang="EN-US">Template</span><span style="FONT-FAMILY: 宋体">，添入</span><span lang="EN-US">ID</span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US">Name</span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US">Description</span><span style="FONT-FAMILY: 宋体">信息后，在</span><span lang="EN-US">Structure</span><span style="FONT-FAMILY: 宋体">一栏选择上一步创建的</span><span lang="EN-US">Structure</span><span style="FONT-FAMILY: 宋体">（这里为</span><span lang="EN-US">test</span><span style="FONT-FAMILY: 宋体">）<br /><a href="/images/blogjava_net/coldtear/CMS/3.JPG" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" height="437" alt="3.JPG" src="http://www.blogjava.net/images/blogjava_net/coldtear/CMS/3.JPG" width="500" onload="java_script_:if(this.width&gt;500)this.width=500" border="0" /></a><br /></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体">然后点击</span><span lang="EN-US"><font face="Times New Roman">Launch Editor</font></span><span style="FONT-FAMILY: 宋体">按钮，打开</span><span lang="EN-US"><font face="Times New Roman">Template</font></span><span style="FONT-FAMILY: 宋体">编辑窗口，按照所需要的格式定义</span><span lang="EN-US"><font face="Times New Roman">Template</font></span><span style="FONT-FAMILY: 宋体">，如下：<br /></span></p><div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a><span style="COLOR: rgb(0,0,0)">&lt;?</span><span style="COLOR: rgb(0,0,0)">xml version</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">1.0</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">?&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a></span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:stylesheet xmlns:xsl</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">http://www.w3.org/1999/XSL/Transform</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> version</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">1.0</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)">  <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:output method</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">html</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> omit</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">xml</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">declaration</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)">  <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:template match</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>    </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">table cellpadding</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">0</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> cellspacing</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">0</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> border</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">0</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> width</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">100%</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td colspan</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of<br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a> disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='headline']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">img</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>            </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:attribute name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">src</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>              </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='image-1']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>            </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">xsl:attribute</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">img</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='caption-1']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td colspan</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">2</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='body-text']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='caption-2']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">img</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>            </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:attribute name</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">src</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>              </span><span style="COLOR: rgb(0,0,0)">&lt;</span><span style="COLOR: rgb(0,0,0)">xsl:value</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">of <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>disable</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">output</span><span style="COLOR: rgb(0,0,0)">-</span><span style="COLOR: rgb(0,0,0)">escaping</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">yes</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)"> select</span><span style="COLOR: rgb(0,0,0)">=</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">root/dynamic-element[@name='image-2']/dynamic-content</span><span style="COLOR: rgb(0,0,0)">"</span><span style="COLOR: rgb(0,0,0)">/&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>            </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">xsl:attribute</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>          </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">img</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>        </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">td</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>      </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">tr</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>    </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">table</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a>  </span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">xsl:template</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"> <br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a></span><span style="COLOR: rgb(0,0,0)">&lt;/</span><span style="COLOR: rgb(0,0,0)">xsl:stylesheet</span><span style="COLOR: rgb(0,0,0)">&gt;</span><span style="COLOR: rgb(0,0,0)"><br /><a href="/Images/OutliningIndicators/None.gif" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" onload="java_script_:if(this.width&gt;500)this.width=500" align="top" border="0" /></a></span></div><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体">下面对该文件进行说明：</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">1</font></span><span style="FONT-FAMILY: 宋体">、这里的</span><span lang="EN-US"><font face="Times New Roman">@name=’</font></span><span style="FONT-FAMILY: 宋体">名称</span><span lang="EN-US"><font face="Times New Roman">’</font></span><span style="FONT-FAMILY: 宋体">必须要和第一步中创建</span><span lang="EN-US"><font face="Times New Roman">Structure</font></span><span style="FONT-FAMILY: 宋体">中的元素名称一致，页面格式根据需求使用</span><span lang="EN-US"><font face="Times New Roman">HTML</font></span><span style="FONT-FAMILY: 宋体">语言定义即可。</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 31.5pt; TEXT-INDENT: -31.5pt"><span lang="EN-US"><font face="Times New Roman">2</font></span><span style="FONT-FAMILY: 宋体">、对</span><span lang="EN-US"><font face="Times New Roman">text</font></span><span style="FONT-FAMILY: 宋体">、</span><span lang="EN-US"><font face="Times New Roman">text area</font></span><span style="FONT-FAMILY: 宋体">类型的元素输出时的格式如下：</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">&lt;xsl:value-of </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">disable-output-escaping="yes" select="root/dynamic-element[@name='caption-2']/dynamic-content"/&gt;</font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt"><span lang="EN-US"><span><font face="Times New Roman">1、<span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal"><font size="3">  </font></span></font></span></span><span style="FONT-FAMILY: 宋体">对</span><span lang="EN-US"><font face="Times New Roman">image</font></span><span style="FONT-FAMILY: 宋体">类型的元素输出时的格式如下：</span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">&lt;img&gt; </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span>  </span>&lt;xsl:attribute name="src"&gt; </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span>    </span>&lt;xsl:value-of </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 31.5pt"><span lang="EN-US"><font face="Times New Roman">disable-output-escaping="yes" select="root/dynamic-element[@name='image-2']/dynamic-content"/&gt; </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman"><span>  </span>&lt;/xsl:attribute&gt; </font></span></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><font face="Times New Roman">&lt;/img&gt;</font></span></p><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">第三步、创建</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Article</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">，添写基本信息后，在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Structure</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">一栏选择</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">test</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">，对应的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">Template</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">一栏也选择</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">test</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">即可，然后在对应的元素域里添入合适的文本或者图片，点击预览即可以看到如下界面，确定无问题后，点击保存或者保存并发布按钮即可完成</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'">content</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体">的定制。<br /><a href="/images/blogjava_net/coldtear/CMS/4.JPG" target="_blank"><img onmousewheel="return bbimg(this)" title="点击在新窗口查看原始图片" style="ZOOM: 120%" height="635" alt="4.JPG" src="http://www.blogjava.net/images/blogjava_net/coldtear/CMS/4.JPG" width="499" onload="java_script_:if(this.width&gt;500)this.width=500" border="0" /></a><br /><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><span style="FONT-FAMILY: 宋体">通过以上三个步骤，我们就实现了定制</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">的功能。使用</span><span lang="EN-US"><font face="Times New Roman">Journal Portlet</font></span><span style="FONT-FAMILY: 宋体">，我们可以定制任何不同风格的</span><span lang="EN-US"><font face="Times New Roman">content</font></span><span style="FONT-FAMILY: 宋体">来展示必要的信息。</span></p></span><img src ="http://www.blogjava.net/hengheng123456789/aggbug/99124.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-10 13:30 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99124.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 技术理解之 SOAP, RMI, and Tunneling</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99121.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Sat, 10 Feb 2007 05:19:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99121.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/99121.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99121.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/99121.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/99121.html</trackback:ping><description><![CDATA[
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">通过</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">SOAP, RMI, </span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">以及我们客户化的隧道类等途径，所有的远程</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">实现都向外开放。<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">之所以这么做，并不仅仅是因为网络服务要应用于商务，而是根本上我们发现这样做对集成来说简直是太有用了。以下就有一个得益于此的企业集成案例。<br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.3sixteen.com/"><span style="COLOR: rgb(92,92,154)">3sixteen</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">是一个做服装</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">T</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">恤的公司，需要扩大发展。他们注意到了</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">有意用之来集成一个商业门户。但是，他们又感觉在一个超前时尚的服务行业</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">似乎显得有点太丑了，或者说不入格。为了解决这个矛盾，他们不得以把</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">WEB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">表现层分成了两个站点：一个产品展示站点和一个在线购买站点。</span><br /></span></span>
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">结果，</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.3sixteen.com/">
						<span style="COLOR: rgb(92,92,154)">www.3sixteen.com</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">成了一个基于</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Flash</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">技术的漂亮站点，而</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://my.3sixteen.com/c/extranet/home">
						<span style="COLOR: rgb(92,92,154)">my.3sixteen.com</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">则是一个基于</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">vanilla</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">版本的在线购物站点。这两个站点分别安装在不同的两个</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Linux</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">主机上，基于目标及用途的考虑可以布署在不同的国家。</span>
		<br />
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">项目的一个重要需求是要建立一个邮件地址管理系统，用来收集目标客户的邮件地址。于是，在</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Flash</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">作的站点中我们加入了弹出工窗口，用来通过门户服务器要增加记录某客户的这个邮件地址到系统中。</span>
		<br />
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">以下是相应的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">JSP</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">片段，它利用</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/addressbook/ejb/ABContactManagerHttp.html">
						<span style="COLOR: rgb(92,92,154)">ABContactManagerHttp</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的功能来增加新的联系人。</span>
		<br />
		<div class="code-fragment">String URL = "http://my.3sixteen.com"; <br /><br />HttpPrincipal httpPrincipal = new HttpPrincipal(URL, "joe_bloggs", "password");<br /><br />ABContactManagerHttp.addContact(httpPrincipal, firstName, lastName, emailAddress);</div>
		<br />
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/addressbook/ejb/ABContactManagerHttp.html">
						<span style="COLOR: rgb(92,92,154)">ABContactManagerHttp</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">调用了</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/addressbook/ejb/ABContactManagerUtil.html">
						<span style="COLOR: rgb(92,92,154)">ABContactManagerUtil</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">中的</span>
		<em>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">addContact</span>
		</em>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">方法，而重要的是这个调用是通过</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">80</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">端口，直接由门户站点的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">http://my.3sixteen.com/tunnel/servlet/AuthTunnelServlet</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">接收，应用服务器只要判定认证合法之后，就以</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ID</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">是</span>
		<strong>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">joe_bloggs</span>
		</strong>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的用户的身份</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">调用</span>
		<em>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">addContact</span>
		</em>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">方法，然后由</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ABContactManagerUtil</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">调用实现类</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/addressbook/ejb/ABContactManagerImpl.html">
						<span style="COLOR: rgb(92,92,154)">ABContactManagerImpl</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来完成真正的添加联系人的工作。这一过程可能通过查自动生成的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">JavaDocs</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">文档中的源代码来证实。<br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">之后呢，那个</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Joe Bloggs</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">就可以登录门户，通过查看它的地址本发现多了一个新的联系人了。而且在系统的其它门户单元也可以通过协助类（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">helper classses</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）达到同样的目的。而另外一方面这也可能是一个安全隐患，因为随便一个人就可以通过一个小</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">JAVA</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">applets</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）或其它程序，从而直接调用有业务逻辑功能的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，只要他拥有认证的密码。一个应对的方法是通过修改</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.liferay.com/cms/servlet/DOCUMENTATION-DEVELOPMENT-PROPERTIES"><span style="COLOR: rgb(92,92,154)">portal.properties</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来只指定特定的端口侦听这类服务请求。</span><br /></span>
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">当然也可以通过</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">SOAT</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">或</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">RMI</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">等来调用</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB。<br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">是一个自下而上完整的应用系统提供者。以下是案例清单，它们都是单一门户单一数据库系统。</span><br /><a href="http://demo.liferay.net/"><font color="#5c5c9a" size="3">http://demo.liferay.net</font></a><br /><a href="http://my.ccuc.net/"><font color="#5c5c9a" size="3">http://my.ccuc.net</font></a><br /><a href="http://my.3sixteen.com/"><font color="#5c5c9a" size="3">http://my.3sixteen.com</font></a><br /><a href="http://portal.liferay.com/"><font color="#5c5c9a" size="3">http://portal.liferay.com</font></a><br /><a href="http://www.gatewayfriends.org/"><font color="#5c5c9a" size="3">http://www.gatewayfriends.org</font></a><br /><a href="http://www.jasonandiris.com/"><font color="#5c5c9a" size="3">http://www.jasonandiris.com</font></a><br /></span>
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">其中每个门户的用户都与其它门户完全隔离，门户间是依据各自的公司</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ID</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">通过域来分割不同的空间。</span>
		<br />
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">如果对在同一机器集成多个</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">有兴趣，请参阅</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">
				<a href="http://www.liferay.com/cms/servlet/DOCUMENTATION-DEVELOPMENT-ASP">
						<span style="COLOR: rgb(92,92,154)">Multiple Portals</span>
				</a>
		</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">。</span>
		<br />
		<br />
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/99121.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-10 13:19 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99121.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 技术理解之 概述</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99120.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Sat, 10 Feb 2007 05:10:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99120.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/99120.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99120.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/99120.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/99120.html</trackback:ping><description><![CDATA[
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">不再依赖于</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，它完全可以单独装配到一个</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">servlet</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">容器（如：</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Tomcat,JBoss</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">等）中。而所有的业务逻辑都通过</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Spring</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">管理的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来实现。这样的实现利益于</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Spring</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">AOP</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">各</span>
		<span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">IOC</span>
		<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">特性。<br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">但在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的实现方法上</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的两个版本有所不同，企业版（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">enterprise</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）中通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">从而为大站点提供了高扩展性各良好的事务支持能力（如集群），而专业版（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">professiona</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）直接通过轻量级的接口完成。<br /></span><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">所有的业务数据都通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Hibernate</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来实现并通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来调用。</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">曾经使用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">CMP</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">技术</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">.</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来实现持久层，但后来因速度及灵活性等原因改用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Hibernate</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">。在数据库方面，</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">也完全兼容大多数主流类型</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">DB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">。<br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">使用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">JAAS</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来完成用户认证安全管理，好处是当一个用户登录后，它的安全属性可以在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Servlet</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">和</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">层中沿用，真正作到系统级的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">SSO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">。具体讲，远程</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">可以沿用安全检查及权限属性，本地的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">是为其它</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">提供业务逻辑服务的，不能被远程调用所以也不必做此类检查；安全原则也派生到</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">实现中，而这此实现其实是远程</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的基础类。</span><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">企业版式使用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，所以系统分别可以在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">WEB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">服务器、</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">服务器、数据库服务器三层中实现集群。当然在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">n</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">层的系统中，集群也保持优势，而且在每一层都并不强迫使用集群，这些都为大企业应用提供了极好的弹性选择权。</span><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">系统中的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">、</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">HBM</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">、以及模式</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Model</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">者是</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ant</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">执行</span><strong><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">build-ejb</span></strong><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">任务时，通过读取目录</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">/portal-ejb</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">下的</span><strong><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ejb.xml</span></strong><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">文件，然后自动生成的。每个有持久层对象的门户单元（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">portlet</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）都有自己的</span><strong><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ejb.xml</span></strong><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">文件（可以在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">/portal-ejb</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">下搜索得到清单）。当需要生成持久层的类时，就把文件复制到</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">/portal-ejb</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">下，这生成工具是建立在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">XDoclet</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">之上的。<br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">例如：通过读取</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Bookmarks</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">门户单元的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ejb.xml</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">文件配置后，自动生成下列的模式类。每个类对应数据库中的一个表。永远不要手工修改</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryModel</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类，而要通过修改</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntry</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，然后再更新</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryModel</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">内容。这样做的好处是减少了直接写代码的工作，而只做相应的标记工作。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/model/BookmarksEntry.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.model.BookmarksEntry</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/model/BookmarksEntryModel.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.model.BookmarksEntryModel</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/model/BookmarksFolder.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.model.BookmarksFolder</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/model/BookmarksFolderModel.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.model.BookmarksFolderModel</font></a><br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Hibernate</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类是根据模式（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">model</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）类对应生成的。这样就可以在多层系统中允许模式类是可作序列化处理的，而</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Hibernate</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类则不必。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryHBM.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryHBM</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderHBM.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderHBM</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">持久层的方法如：</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">add, update, delete, find, remove, </span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">以及</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">count</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，系统都默认自动生成。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryPersistence.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryPersistence</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderPersistence.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderPersistence</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">也生成了专门的协助类（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Helper classes</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">），可以用来调用持久层方法。默认时，协助类调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Hibernate</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的方法来对数据库进行更新操作，但是也可以改写</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.liferay.com/cms/servlet/DOCUMENTATION-DEVELOPMENT-PROPERTIES"><span style="COLOR: rgb(92,92,154)">portal.properties</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">中的配置，使用自己专用的类来完成，但这种类要求要继承默认的持久层类。换言之，用户完全可以定制自己的持久层数据，可以是一个正统的数据库，或者是</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">LDAP</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">服务器，其它什么的。</span><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryUtil</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderUtil</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">为了减少对象生成的成本，引入了对象池，可以通过修改</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.liferay.com/cms/servlet/DOCUMENTATION-DEVELOPMENT-PROPERTIES"><span style="COLOR: rgb(92,92,154)">portal.properties</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">文件来控制池的基本动作。</span><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryPool.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryPool</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderPool.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderPool</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">用来实现业务逻辑的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJ</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">Ｏ类，通过继承</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portal/ejb/PrincipalBean.html"><span style="COLOR: rgb(92,92,154)">PrincipalBean</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类，来实现有关调用者的方法，所以可以远程调用。如：调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">getUserId()</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">可以得到当前用户的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">ID</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">；调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">getUser()</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">则返回当前用户的对象。</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">再继承这类</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，实现远程调用。</span><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">例如：下面的类实现了，允许当且公当</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">bookmark</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">项目或目录的生成者可以删除它。这些对象只有在不存在时才可能被创建。</span><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">协助类（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Helper classes</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）是在</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的实现基础上生成的。它可以节约开发者的工作，不必书写很多行的代码，而只要简单的找到合适的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB wrapper</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">或</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">实现，通过调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryManagerUtil.addEntry</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来间接调用相应的</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryManagerImpl.addEntry</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">方法就可以了。</span><br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryManagerUtil</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">通过调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksFolderManagerFactory</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来查找实现</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksEntryManager</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的类。也正是通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">BookmarksFolderManagerFactory</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">来识别</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Spring</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">和</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial"><a href="http://www.liferay.com/cms/servlet/DOCUMENTATION-DEVELOPMENT-PROPERTIES"><span style="COLOR: rgb(92,92,154)">portal.properties</span></a></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">中的配置来决定要是载入</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB wrapper</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">还是</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">实现。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerUtil</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerUtil</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">隧道类（</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Tunneling classes</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）是用来实现通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">80</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">端口来调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerHttp.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerHttp</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerHttp.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerHttp</font></a><br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类也是用来实现通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">80</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">端口来调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的。虽然与隧道类相比</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类在速度上要差一点，原因是隧道类使用二进制数据流。但</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类用灵活，可以适用各种客户端（不局限于</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Java</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）。</span><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryManagerSoap.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryManagerSoap</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderManagerSoap.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderManagerSoap</font></a><br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类也是用来实现通过</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">80</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">端口来调用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的。虽然与隧道类相比</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类在速度上要差一点，原因是隧道类使用二进制数据流。但</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Soap</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">类用灵活，可以适用各种客户端（不局限于</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Java</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">）。<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">这些类只有在检验到不存在时才会被创建。<span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">同时协助类也生成了。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryLocalManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryLocalManagerUtil</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderLocalManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderLocalManagerUtil</font></a><br /><br /><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">但总有一些用户需要调用引种当地类，于是完全相对应的远程类也应用而生了。<br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksEntryRemoteManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksEntryRemoteManagerUtil</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManager.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManager</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManagerEJB.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManagerEJB</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManagerEJBImpl.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManagerEJBImpl</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManagerFactory.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManagerFactory</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManagerHome.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManagerHome</font></a><br /><a href="http://www.liferay.com/documentation/api/portal-ejb/com/liferay/portlet/bookmarks/ejb/BookmarksFolderRemoteManagerUtil.html"><font color="#5c5c9a" size="3">com.liferay.portlet.bookmarks.ejb.BookmarksFolderRemoteManagerUtil</font></a><br /><br /><br /></span></span></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">许多人避免使用</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">，因为它的重量级，需要大量的代码工作。</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的自动生成脚本可以使得，既不损失</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">EJB</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的优点，而且还最小化重复的代码等工作，从而你可以在努力与结果之间找到一个良好的平衡点。</span><br /><br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Spring</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">也给</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">Liferay</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">带来了更多的好处。开发者既可以利用专业版在一个</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">servlet</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">容器中测试</span><span lang="EN-US" style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: Arial">POJO</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(51,51,51); FONT-FAMILY: 宋体">的实现，也可以通过企业版在应用服务器上装载要上线的产品。</span><br /></span><br /><br /></span></span></span></span></span></span></span></span>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/99120.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-10 13:10 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99120.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 技术理解之 Velocity</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99112.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Sat, 10 Feb 2007 04:40:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99112.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/99112.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99112.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/99112.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/99112.html</trackback:ping><description><![CDATA[
		<p>
				<br />      Velocity是一个基于java的模板引擎(template engine).它允许任何人仅仅简单的使用模板语言(template language)来引用由java代码定义的对象. 当Velocity应用于web开发时,界面设计人员可以和java程序开发人员同步开发一个遵循MVC架构的web站点,也就是说,页面设计人员可以只关注页面的显示效果,而由java程序开发人员关注业务逻辑编码.Velocity将java代码从web页面中分离出来,这样为web站点的长期维护提供了便利,同时也为我们在JSP和PHP之外又提供了一种可选的方案. Velocity的能力远不止web站点开发这个领域,例如,它可以从模板(template)产生SQL和PostScript,XML,它也可以被当作一个独立工具来产生源代码和报告,或者作为其他系统的集成组件使用.Velocity也可以为Turbine web开发架构提供模板服务(template service).Velocity+Turbine提供一个模板服务的方式允许一个web应用以一个真正的MVC模型进行开发. </p>
		<p>1.Velocity的使用</p>
		<p>　　Velocity是一个开放源吗的模版引擎，由apache.org小组负责开发，现在最新的版本是Velocity1.3.1，<a href="http://jakarta.apache.org/velocity/index.html">http://jakarta.apache.org/velocity/index.html</a>可以了解Velocity的最新信息。</p>
		<p>　　Velocity允许我们在模版中设定变量，然后在运行时，动态的将数据插入到模版中，替换这些变量。</p>
		<p>　　例如：</p>
		<p>　　&lt;html&gt;</p>
		<p>　　&lt;body&gt;HELLO$CUSTOMERNAME&lt;/body&gt;</p>
		<p>　　&lt;/html&gt;</p>
		<p>　　我们可以在运行时得到客户的名字，然后把它插入到这个模版中替换变量$CUSTOMERNAME，整个替换过程是由Velocity进行控制的，而且java的调用代码也非常简单，如我们可以在java代码中这样调用</p>
		<p>　　/***********************************************************/</p>
		<p>　　//这个文件中设定了Velocity使用的log4j的配置和Velocity的模版文件所在的目录</p>
		<p>　　Velocity.init("D:\\Template\\resource\\jt.properties");</p>
		<p>　　//模版文件名，模版文件所在的路径在上一条语句中已经设置了</p>
		<p>　　Templatetemplate=Velocity.getTemplate("hello.vm","gb2312");</p>
		<p>　　//实例化一个Context</p>
		<p>　　VelocityContextcontext=newVelocityContext();</p>
		<p>　　//把模版变量的值设置到context中</p>
		<p>　　context.put("CUSTOMERNAME","MyFirstTemplateEngine----Velocity.");</p>
		<p>　　//开始模版的替换</p>
		<p>　　template.merge(context,writer);</p>
		<p>　　//写到文件中</p>
		<p>　　PrintWriterfilewriter=newPrintWriter(newFileOutputStream(outpath),true);</p>
		<p>　　filewriter.println(writer.toString());</p>
		<p>　　filewriter.close();</p>
		<p>　　/***********************************************************/</p>
		<p>　　这就是整个java的代码，非常的简单。如果我们有多个模版变量，我们仅需要把这些模版变量的值设置到context中。</p>
		<p>　　下面我们简单的分析一下，Velocity引擎读取模板文件时，它直接输出文件中所有的文本，但以$字符开头的除外，$符号标识着一个模版变量位置，</p>
		<p>　　context.put("CUSTOMERNAME","MyFirstTemplateEngine----Velocity.");</p>
		<p>　　当Velocity模板引擎解析并输出模板的结果时，模板中所有出现$CUSTOMERNAME的地方都将插入客户的名字，即被加入到VelocityContext的对象的toString()方法返回值将替代Velocity变量（模板中以$开头的变量）。</p>
		<p>　　模板引擎中最强大、使用最频繁的功能之一是它通过内建的映像（Reflection）引擎查找对象信息的能力。这个映像引擎允许用一种方便的Java“.”类似的操作符，提取任意加入到VelocityContext的对象的任何公用方法的值，或对象的任意数据成员。</p>
		<p>　　映像引擎还带来了另外一个改进：快速引用JavaBean的属性。使用JavaBean属性的时候，我们可以忽略get方法和括号。请看下面这个模板的例子。</p>
		<p>　　&lt;html&gt;</p>
		<p>　　&lt;body&gt;</p>
		<p>　　Name:$Customer.Name()</p>
		<p>　　Address:$Customer.Address()</p>
		<p>　　Age:$Customer.Age()</p>
		<p>　　&lt;/body&gt;</p>
		<p>　　&lt;/html&gt;</p>
		<p>　　java的代码：</p>
		<p>　　/***********************************************************/</p>
		<p>　　//设置客户信息</p>
		<p>　　Customermycustomer=newCustomer();</p>
		<p>　　mycustomer.setName("Velocity");</p>
		<p>　　mycustomer.setAddress("jakarta.apache.org/velocity/index.html");</p>
		<p>　　mycustomer.setAge(2);</p>
		<p>　　//这个文件中设定了Velocity使用的Log4j的配置和Velocity的模版文件所在的目录Velocity.init("D:\\Template\\resource\\jt.properties");</p>
		<p>　　//模版文件名，模版文件所在的路径在上一条语句中已经设置了</p>
		<p>　　Templatetemplate=Velocity.getTemplate("hello.vm","gb2312");</p>
		<p>　　//实例化一个Context</p>
		<p>　　VelocityContextcontext=newVelocityContext();</p>
		<p>　　//把模版变量的值设置到context中</p>
		<p>　　context.put("Customer",mycustomer);</p>
		<p>　　//开始模版的替换</p>
		<p>　　template.merge(context,writer);</p>
		<p>　　//写到文件中</p>
		<p>　　PrintWriterfilewriter=newPrintWriter(newFileOutputStream(outpath),true);</p>
		<p>　　filewriter.println(writer.toString());</p>
		<p>　　filewriter.close();</p>
		<p>　　输出结果：</p>
		<p>　　&lt;html&gt;</p>
		<p>　　&lt;body&gt;</p>
		<p>　　Name:Velocity</p>
		<p>　　Address:jakarta.apache.org/velocity/index.html</p>
		<p>　　Age:2</p>
		<p>　　&lt;/body&gt;</p>
		<p>　　&lt;/html&gt;</p>
		<p>　　除了替换变量之外，象Velocity高级引擎还能做其他许多事情，它们有用来比较和迭代的内建指令，通过这些指令我们可以完成程序语言中的条件判断语句和循环语句等。</p>
		<p>　　例如，我们想要输出年龄等于2的所有客户的信息，我们可以这样定义我们的模版</p>
		<p>　　模版：</p>
		<p>　　&lt;html&gt;</p>
		<p>　　&lt;body&gt;</p>
		<p>　　&lt;table&gt;</p>
		<p>　　&lt;tr&gt;</p>
		<p>　　&lt;td&gt;名称&lt;/td&gt;</p>
		<p>　　&lt;td&gt;地址&lt;/td&gt;</p>
		<p>　　&lt;td&gt;年龄&lt;/td&gt;</p>
		<p>　　&lt;/tr&gt;</p>
		<p>　　#foreach($Customerin$allCustomer)</p>
		<p>　　#if($Customer.Age()=="2")</p>
		<p>　　&lt;tr&gt;</p>
		<p>　　&lt;td&gt;$Customer.Name()&lt;/td&gt;</p>
		<p>　　&lt;td&gt;$Customer.Address()&lt;/td&gt;</p>
		<p>　　&lt;td&gt;$Customer.Age()&lt;/td&gt;</p>
		<p>　　&lt;/tr&gt;</p>
		<p>　　#end</p>
		<p>　　#end</p>
		<p>　　&lt;/table&gt;</p>
		<p>　　&lt;/body&gt;</p>
		<p>　　&lt;/html&gt;</p>
		<p>　　java的代码：</p>
		<p>　　/******************************************************/</p>
		<p>　　//设置客户信息</p>
		<p>　　ArrayListallMyCustomer=newArrayList();</p>
		<p>　　//客户1</p>
		<p>　　Customermycustomer1=newCustomer();</p>
		<p>　　mycustomer1.setName("Velocity");</p>
		<p>　　mycustomer1.setAddress("jakarta.apache.org/velocity/index.html");</p>
		<p>　　mycustomer1.setAge(2);</p>
		<p>　　//客户2</p>
		<p>　　Customermycustomer2=newCustomer();</p>
		<p>　　mycustomer2.setName("Tomcat");</p>
		<p>　　mycustomer2.setAddress("jakarta.apache.org/tomcat/index.html");</p>
		<p>　　mycustomer2.setAge(3);</p>
		<p>　　//客户3</p>
		<p>　　Customermycustomer3=newCustomer();</p>
		<p>　　mycustomer3.setName("Log4J");</p>
		<p>　　mycustomer3.setAddress("jakarta.apache.org/log4j/docs/index.html");</p>
		<p>　　mycustomer3.setAge(2);</p>
		<p>　　//添加到allMyCustomer(ArrayList)中.</p>
		<p>　　allMyCustomer.add(mycustomer1);</p>
		<p>　　allMyCustomer.add(mycustomer2);</p>
		<p>　　allMyCustomer.add(mycustomer3);</p>
		<p>　　//这个文件中设定了Velocity使用的log4j的配置和Velocity的模版文件所在的目</p>
		<p>　　Velocity.init("D:\\Template\\resource\\jt.properties");</p>
		<p>　　//模版文件名，模版文件所在的路径在上一条语句中已经设置了</p>
		<p>　　Templatetemplate=Velocity.getTemplate("hello.vm","gb2312");</p>
		<p>　　//实例化一个Context</p>
		<p>　　VelocityContextcontext=newVelocityContext();</p>
		<p>　　/**注意这里我们仅仅需要给一个模版变量负值*/</p>
		<p>　　context.put("allCustomer",allMyCustomer);</p>
		<p>　　//开始模版的替换</p>
		<p>　　template.merge(context,writer);</p>
		<p>　　//写到文件中</p>
		<p>　　PrintWriterfilewriter=newPrintWriter(newFileOutputStream(outpath),true);</p>
		<p>　　filewriter.println(writer.toString());</p>
		<p>　　filewriter.close();</p>
		<p>　　/******************************************************/</p>
		<p>　　结果：</p>
		<p>　　&lt;html&gt;</p>
		<p>　　&lt;body&gt;</p>
		<p>　　&lt;table&gt;</p>
		<p>　　&lt;tr&gt;</p>
		<p>　　&lt;td&gt;名称&lt;/td&gt;</p>
		<p>　　&lt;td&gt;地址&lt;/td&gt;</p>
		<p>　　&lt;td&gt;年龄&lt;/td&gt;</p>
		<p>　　&lt;/tr&gt;</p>
		<p>　　&lt;tr&gt;</p>
		<p>　　&lt;td&gt;Velocity&lt;/td&gt;</p>
		<p>　　&lt;td&gt;jakarta.apache.org/velocity/index.html&lt;/td&gt;</p>
		<p>　　&lt;td&gt;2&lt;/td&gt;</p>
		<p>　　&lt;/tr&gt;</p>
		<p>　　&lt;tr&gt;</p>
		<p>　　&lt;td&gt;Log4J&lt;/td&gt;</p>
		<p>　　&lt;td&gt;jakarta.apache.org/log4j/docs/index.html&lt;/td&gt;</p>
		<p>　　&lt;td&gt;2&lt;/td&gt;</p>
		<p>　　&lt;/tr&gt;</p>
		<p>　　&lt;/table&gt;</p>
		<p>　　&lt;/body&gt;</p>
		<p>　　&lt;/html&gt;</p>
		<p>　　#if语句完成逻辑判断，这个我想不用多说了。</p>
		<p>　　allCustomer对象包含零个或者多个Customer对象。由于ArrayList(List,HashMap,HashTable,Iterator,Vector等)属于JavaCollectionsFramework的一部分，我们可以用#foreach指令迭代其内容。我们不用担心如何定型对象的类型——映像引擎会为我们完成这个任务。#foreach指令的一般格式是“#foreachin”。#foreach指令迭代list，把list中的每个元素放入item参数，然后解析#foreach块内的内容。对于list内的每个元素，#foreach块的内容都会重复解析一次。从效果上看，它相当于告诉模板引擎说：“把list中的每一个元素依次放入item变量，每次放入一个元素，输出一次#foreach块的内容”。</p>
		<p>　　2.MVC设计模型</p>
		<p>　　使用模板引擎最大的好处在于，它分离了代码（或程序逻辑）和表现（输出）。由于这种分离，你可以修改程序逻辑而不必担心邮件消息本身；类似地，你（或公关部门的职员）可以在不重新编译程序的情况下，重新编写客户列表。实际上，我们分离了系统的数据模式（DataModel，即提供数据的类）、控制器（Controller，即客户列表程序）以及视图（View，即模板）。这种三层体系称为Model-View-Controller模型（MVC）。</p>
		<p>　　如果遵从MVC模型，代码分成三个截然不同的层，简化了软件开发过程中所有相关人员的工作。</p>
		<p>　　结合模板引擎使用的数据模式可以是任何Java对象，最好是使用JavaCollectionFramework的对象。控制器只要了解模板的环境（如VelocityContext），一般这种环境都很容易使用。</p>
		<p>　　一些关系数据库的“对象-关系”映射工具能够和模板引擎很好地协同，简化JDBC操作；对于EJB，情形也类似。模板引擎与MVC中视图这一部分的关系更为密切。模板语言的功能很丰富、强大，足以处理所有必需的视图功能，同时它往往很简单，不熟悉编程的人也可以使用它。模板语言不仅使得设计者从过于复杂的编程环境中解脱出来，而且它保护了系统，避免了有意或无意带来危险的代码。例如，模板的编写者不可能编写出导致无限循环的代码，或侵占大量内存的代码。不要轻估这些安全机制的价值；大多数模板编写者不懂得编程，从长远来看，避免他们接触复杂的编程环境相当于节省了你自己的时间。许多模板引擎的用户相信，在采用模板引擎的方案中，控制器部分和视图部分的明确分离，再加上模板引擎固有的安全机制，使得模板引擎足以成为其他内容发布系统（比如JSP）的替代方案。因此，Java模板引擎最常见的用途是替代JSP也就不足为奇了。</p>
		<p>　　3.HTML处理</p>
		<p>　　由于人们总是看重模板引擎用来替换JSP的作用，有时他们会忘记模板还有更广泛的用途。到目前为止，模板引擎最常见的用途是处理HTMLWeb内容。但我还用模板引擎生成过SQL、email、XML甚至Java源代码。<br /><br />y</p>引自：<a href="http://www.52blog.net/user1/34503/archives/2005/326868.shtml">http://www.52blog.net/user1/34503/archives/2005/326868.shtml</a><img src ="http://www.blogjava.net/hengheng123456789/aggbug/99112.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-10 12:40 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99112.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Liferay Portal 技术理解之 JSR-170</title><link>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99110.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Sat, 10 Feb 2007 04:29:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99110.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/99110.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99110.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/99110.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/99110.html</trackback:ping><description><![CDATA[
		<p>   JSR-170 (Java Content Repository (JCR)Java内容仓库包)</p>
		<p>1、什么是Content Repository ？<br />   可以把Content Repository 看作是一个通用的数据存储程序，可以用于存储txt和其他二进制文件（图片、Word、PDF等）。<br />   Content Repository 的一个关键特性是，你不必关心数据是如何存放的（无论数据存放在数据库、文件系统还是XML文件）。<br />   Content Repository 可以对文件进行访问控制、查询、版本控制、锁定等。</p>
		<p>2、JSR-170的目标：<br />   通过javax.jcr.* 中的类和接口可以访问所有兼容JSR-170的 Content Repository。<br />实现了内容服务的一些功能如基于编辑者的版本控制、完全文本搜索、访问控制、内容分类和内容事件监控。可以把JSR-170看作是一个访问内容仓库的类似JDBC的API。<br />   如果一些厂家的内容仓库不支持JSR-170则可以通过这些厂家提供的JSR-170驱动来完成从JSR-170与厂家特定的内容仓库的转换。<br />   内容仓库的数据存储方式可以是数据库或者文件系统或者是二者的混合。<br />   <br />3、JSR-170具有如下优点：<br />●对于开发者无需了解厂家的仓库特定的API，只要兼容JSR-170就可以通过JSR-170访问其仓库。<br />●对于使用CMS的公司则无需花费资金用于在不同种类CMS的内容仓库之间进行转换。<br />●对于CMS厂家，无需自己开发内容仓库，而专注于开发CMS应用。</p>
		<p>4、JSR-170内容仓库模型：<br />JSR-170声称内容仓库是由一些workspace组成的，每个工作空间应该存放相似的数据，每个工作空间包含一个树根节点，下面是一些items，每个item是一个node或者property，每个node下面包含一个或多个child node和一个或者多个property，property不能有子节点，它们是叶子节点，内容仓库中真正的值存放在property中。</p>
		<p>5、为了使厂家更容易的实现JSR-170，JSR-170提供了三种承诺级别：<br />Level 1：定义了一个只读的内容仓库。<br />Level 2：定义了可写的内容仓库。<br />Advanced options：定义实现五种附加功能，版本控制、JTA、SQL查询、清晰的内容锁定和监视。</p>
		<p>引自：<a href="http://blogger.org.cn/blog/more.asp?name=lylhelin&amp;id=20455">http://blogger.org.cn/blog/more.asp?name=lylhelin&amp;id=20455</a></p>
<img src ="http://www.blogjava.net/hengheng123456789/aggbug/99110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2007-02-10 12:29 <a href="http://www.blogjava.net/hengheng123456789/archive/2007/02/10/99110.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java的web开发常见问题之：ClassCastException org.apache.struts.taglib.html.MessagesTei</title><link>http://www.blogjava.net/hengheng123456789/archive/2006/11/16/81452.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Thu, 16 Nov 2006 02:16:00 GMT</pubDate><guid>http://www.blogjava.net/hengheng123456789/archive/2006/11/16/81452.html</guid><wfw:comment>http://www.blogjava.net/hengheng123456789/comments/81452.html</wfw:comment><comments>http://www.blogjava.net/hengheng123456789/archive/2006/11/16/81452.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hengheng123456789/comments/commentRss/81452.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hengheng123456789/services/trackbacks/81452.html</trackback:ping><description><![CDATA[   在开发部署Web应用程序过程中，我们经常会遇到这样的问题，项目放在JBoss或其他容器中运行没有任何错误，但是放在Tomcat下面就会出现该错误。这是为什么呢？<br />   其实这都是因为jar包引入或冲突产生的问题，相信大多数使用java开发的同仁们都遇到过这样的问题，如果是自己开发的jar程序，情况可能还好一些，但是很多情况下问题都是发生在其他公司或同事开发的jar程序，调试和问题的查找让我们郁闷不已。<br />   就ClassCastException org.apache.struts.taglib.html.MessagesTei这个问题的解决方法，我在百度上查找了许久，但都没有答案，后来在国外的网站上发现了此问题的解决方法，具体如下：<br /><br />   原因是Tomcat 5.5版本中已经包含了jsp-api.jar，而我的项目中同样也包含了jsp-api.jar，又是冲突<img height="19" src="http://www.blogjava.net/Emoticons/confused_smile.gif" width="19" border="0" />，我已经无语了！<br />   解决办法也很简单，把项目中的jsp-api.jar干掉就可以了。<br /><br />   写本文的主要目的是为了提醒大家和我，在程序移植和二次开发时，如果发现问题，首先应当按以下顺序查找问题：<br /><br />   1、环境问题：包括操作系统、Web服务器、源代码的环境、网络和硬件资源等<br />   2、代码是否完整<br />   3、是否程序中包含重复jar或class文件，特别是连class文件的包路径也相同的情况下<img src ="http://www.blogjava.net/hengheng123456789/aggbug/81452.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hengheng123456789/" target="_blank">哼哼</a> 2006-11-16 10:16 <a href="http://www.blogjava.net/hengheng123456789/archive/2006/11/16/81452.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>