|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Interface Summary | |
| Content | The methods in this interface are the public face of ContentBean. |
| ContentHome | This interface is the home interface for ContentBean,
which in WebLogic is implemented by the code-generated container
class ContentBeanEOImpl. |
| Class Summary | |
| ContentBean | This stateless Session Bean generates XML content that is later displayed to various client types. |
This example demonstrates using XML and XSLT to separate content generation from presentation. In this example, the JSP presentation.jsp handles requests from both HTML browser clients and WAP-enabled clients. For each request, presentation.jsp calls ContentBean to generate the response content, shown by the following XML document:
<content>
<title>
XSLT example
</title>
<description>
This example demonstrates the use of XML and XSLT as a way to
separate content from presentation.
</description>
<html_note>
ContentBean generates the content in the form of an XML document.
Presentation.jsp uses XSLT to transform the XML document to a format
that is appropriate for the client making the request. Since you are
currently viewing this page in an HTML browser, more information can
be displayed than if you were viewing this page in a client with a
smaller display such as a WAP-enabled mobile telephone. See the example
documentation for instructions on viewing this page using a WAP emulator.
</html_note>
<wap_note>
You are viewing this page from a WAP-enabled client.
</wap_note>
</content>
presentation.jsp then transforms this XML document using
WebLogic's built-in JSP tags and XSLT processor into a format that is appropriate
for the client type (HTML or WML).
The example demonstrates how to:
| Additional Resources for examples.xml.xslt | |
| presentation.jsp | The JSP that handles client requests and uses XSLT to transform XML data into HTML or WML as appropriate. |
| html.xsl | The stylesheet used to transform the XML document received from ContentBean into HTML. |
| wml.xsl | The stylesheet used to transform the XML document received from ContentBean into WML. |
IMPORTANT: You must install the following software to run this example:
prompt> antThe Java ant command uses the
build.xml file, located in the SAMPLES_HOME\server\src\examples\xml\xslt
directory, to build the example.
The Java Ant command builds the example and copies the files to the following directories of the WebLogic Server:
The WebLogic server automatically deploys the EJB as soon as the build command copies the EJB files to the correct directory. If the WebLogic server is not running, the EJB is deployed as soon as you start the WebLogic server.
For additional information on using the build commands, see Building Enterprise JavaBean examples.
| File Extension | MIME Type |
| wml | text/vnd.wap.wml |
| wmlc | application/vnd.wap.wmlc |
| wmls | text/vnd.wap.wmlscript |
| wmlsc | application/vnd.wap.wmlscriptc |
| wbmp | image/vnd.wap.wbmp |
| Parameter | Value |
| compile command | JAVA_HOME/bin/javac |
| pageCheckSeconds | 1 |
| verbose | true |
http://WebLogicURL:Port/examplesWebApp/presentation.jspwhere:
You will see a description of this example formatted in HTML.
NOTE:You must specify the /bin directory of the JRE 1.2.2 in your PATH to start the Nokia WAP Server.
http://WebLogicURL:Port/examplesWebApp/presentation.jspwhere:
You will see a discription of this example formated in WML. Note that the description is much shorter in WML than it is in HTML.
Read more in Programming WebLogic Server for Wireless Services.
Read more about EJB in BEA WebLogic Server Enterprise Java Beans.
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||