Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Apr 6, 2008

JSTL in Action

Like JSTL, this book is aimed at both programmers and nonprogrammers. Parts 1, 2, and 3 are accessible to page authors who start out with nothing more than HTML. Part 4 is intended for Java programmers—and ambitious page authors who want to learn more about how JSTL works behind the scenes.


In part 1, we look broadly at the Web and at two technologies that are important foundations to JSTL: JavaServer Pages ( JSP) and the Extensible Markup Language (XML).

In part 2, we delve into JSTL’s depths. Chapters 3, 4, and 5 lay the necessary groundwork by discussing JSTL’s expression language, conditions, and loops. Chapters 6 through 10 discuss the more exciting features of JSTL: database access, XML manipulation, text importing and formatting, and so forth.

In part 3 (chapters 11, 12, and 13), we look at progressively more complete and integrated examples of JSTL in action. We start with common, stand-alone tasks and move to an example of organizing an entire site—a web portal—using JSTL.

Finally, part 4 discusses how to configure JSTL, integrate Java code, and even write custom tags using JSTL’s API. The appendices contain reference material. Appendix A is a brief summary of all of JSTL’s tags. Appendix B lists JSTL’s API and goes into detail about some of its advanced features. Appendix C describes the basics of SQL to help you follow some of the book’s examples, and appendix D lists online and printed references.

How to approach the book :
If you’re a web-page author who knows HTML, you’ll probably want to start at the beginning. Chapters 1 and 2 will be particularly useful to you, and you can read the rest of the book in order, stopping somewhere around chapter 14 if the material becomes less interesting to you. If you already know JavaScript, pay special attention to chapter 3, because you’ll need to master the details of JSTL’s expression language.

JavaScript won’t help you produce dynamic server-side logic in this environment. If you don’t know SQL, appendix C will help you follow the book’s database examples. If you’re an experienced Java programmer looking to master JSTL in order to use or teach it, you can probably skip part 1. You might want to begin by focusing on the expression language in chapter 3. Chapters 4 and 5 will be a breeze, but the rest of part 2 should be useful in orienting you to JSTL’s tag-set. The examples in part 3 will be useful, and part 4 is specially intended for you. Also, appendix B is both a thorough reference and an indispensable introduction to some of JSTL’s advanced features.

If you have a background in JSP but aren’t familiar with Java, then parts 2 and 3 will be particularly useful to you. Also, the beginning of chapter 14—integrating JSTL with scriptlets—might be helpful. In general, the book gets more advanced as it moves forward. Most readers will gain less by reading the book backward (but if you find any interesting hidden messages that way, be sure to let me know).

Download JSTL in Action

Apr 5, 2008

SOA Using Java Web Services

Java became a powerful development platform for Service-Oriented Architecture (SOA) in 2006. Java EE 5, released in May 2006, signi.cantly enhanced the power and usability of the Web Services capabilities on the application server. Then Java SE 6, released in December 2006, incorporated the majority of those capabilities into the standard edition of the Java programming language.

Because robust Web Services technology is the foundation for implementing SOA, Java now provides the tools modern enterprises require to integrate their Java applications into SOA infrastructures. Of course, Java has had basic Web Services capabilities for some time. JAX-RPC 1.0 was released in June 2002. J2EE 1.4, .nalized in November 2003, included JAX-RPC 1.1. So what is signi.cant about the latest versions of the Java Web Services (JWS) APIs?
The answers are power and ease of use. Programmers will .nd it much easier to build enterprise-class applications with Web Services in Java EE 5 than in J2EE 1.4. Evidence of that is contained in Chapters 9 and 10, which describe an application I developed to integrate online shopping across eBay, Yahoo! Shopping, and Amazon. It’s a pure Java EE 5 application, called SOAShopper, that consumes REST and SOAP services from those shopping sites. SOAShopper also provides its own SOAP and REST endpoints for cross-platform search, and supports an Ajax front-end. SOAShopper would have been a struggle to develop using J2EE 1.4 and JAX-RPC. With the new Java Web Services standards, it was a pleasure to write.

This book focuses on the following standards comprising the new Java
Web Services:
1. JAX-WS 2.0 [JSR 224]—The Java API for XML-Based Web Services.
The successor to JAX-RPC, it enables you to build and consume Web services with Java.

2. JAXB 2.0 [JSR 222]—The Java Architecture for XML Binding.
Tightly integrated with JAX-WS, the JAXB standard controls how Java objects are represented as XML.

3. WS-Metadata [JSR 181]—Web Services Metadata for the Java Platform.
WS-Metadata provides annotations that facilitate the .exible de.nition and deployment of Java Web Services.

4. WSEE 1.2 [JSR 109]—Web Services for Java EE. WSEE de.nes the programming model and run-time behavior of Web Services in the Java EE container. These standards contain a few big improvements and many little enhancements that add up to a signi.cantly more powerful Web Services programming platform.
New annotations, for example, make it easier to write Web Services applications. And the delegation, in JAX-WS 2.0 [JSR 224], of the Java/XML binding to JAXB 2.0 [JSR 222] greatly improves the usability of JAX-WS as compared with JAX-RPC. The deployment model has been greatly simpli.ed by WS-Metadata 1.0 [JSR 181] and an improved 1.2 release of WSEE [JSR-109].

Chapters 1 and 2 review these JWS standards in detail and describe how they improve on the previous set of JWS standards. Chapters 3 through 10 focus on writing code. To really understand the power and ease of use of the new Java Web Services, you need to start writing code. And that is primarily what this book is about. Chapters 3 through 10 are packed with code examples showing you how to best take advantage of the powerful features, avoid some of the pitfalls, and work around some of the limitations. Chapter 11 looks to the future and offers some ideas, along with a prototype implementation, for a WSDL-centric approach to creating Web Services that might further improve JWS as a platform for Service-Oriented Architecture.

I started writing this book in 2002, when JAX-RPC .rst appeared on the scene. I soon ran into trouble, though, because I wanted it to be a book for programmers and I had a hard time writing good sample code with JAXRPC. Four years later, when I started playing around with beta versions of the GlassFish Java EE 5 application server, I noticed that things had signi.- cantly improved. It was now fun to program Web Services in Java and I recommitted myself to .nishing this book.
The result is a book with lots of code showing you how to deal with SOAP, WSDL, and REST from inside the Java programming language. Hopefully this code, and the writing that goes with it, will help you master Java Web Services and enable you to start using Java as a powerful platform for SOA.

Filetype : pdf
First printing, April 2007
Page : 605
Download SOA Using Java Web Services