Attention! Your ePaper is waiting for publication!
By publishing your document, the content will be optimally indexed by Google via AI and sorted into the right category for over 500 million ePaper readers on YUMPU.
This will ensure high visibility and many readers!
Your ePaper is now published and live on YUMPU!
You can find your publication here:
Share your interactive ePaper on all platforms and on your website with our embed function
The Java EE 5 Tutorial (PDF) - Oracle Software Downloads
The Java EE 5 Tutorial (PDF) - Oracle Software Downloads
The Java EE 5 Tutorial (PDF) - Oracle Software Downloads
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
PART II<br />
<strong>The</strong>WebTier<br />
Part Two explores the technologies in the web tier.<br />
75
PART II <strong>The</strong>WebTier Part Two explores the technologies in the web tier. 75
- Page 1 and 2:
The Java EE 5Tutorial For Sun Java
- Page 3 and 4:
Contents Preface ..................
- Page 5 and 6:
Contents Starting and Stopping the
- Page 7 and 8:
Contents 5 JavaServer PagesTechnolo
- Page 9 and 10:
Contents 8 CustomTags in JSP Pages
- Page 11 and 12:
Contents 11 Using JavaServer FacesT
- Page 13 and 14:
Contents Component, Renderer, and T
- Page 15 and 16:
Contents 17 Binding between XML Sch
- Page 17 and 18:
Contents SAAJ Messages ............
- Page 19 and 20:
Contents The Remove Method ........
- Page 21 and 22:
Contents 27 The Java Persistence Qu
- Page 23 and 24: Contents 30 SecuringWeb Application
- Page 25 and 26: Contents Building, Deploying, and R
- Page 27: Contents Enterprise Beans .........
- Page 30 and 31: Preface 30 ■ Web application inte
- Page 32 and 33: Preface Application Server Document
- Page 34 and 35: Preface Default Paths and File Name
- Page 36 and 37: Preface TABLE P-4 Symbol Convention
- Page 39 and 40: 1C HAPTER 1 Overview Developers tod
- Page 41 and 42: FIGURE 1-1 Multitiered Applications
- Page 43 and 44: Applets A web page received from th
- Page 45 and 46: As shown in Figure 1-3, the web tie
- Page 47 and 48: services in the form of a container
- Page 49 and 50: Web Services Support Web services a
- Page 51 and 52: Once a Java EE unit has been produc
- Page 53 and 54: The different roles are not always
- Page 55 and 56: Java EE 5 APIs FIGURE 1-7 Java EE P
- Page 57 and 58: JavaServer Faces JavaServer Faces t
- Page 59 and 60: Java Architecture for XML Binding (
- Page 61 and 62: A Java EE component can locate its
- Page 63: TABLE 1-1 Application Server Tools
- Page 66 and 67: Required Software 66 2 3 4 5 Next S
- Page 68 and 69: Starting and Stopping the Applicati
- Page 70 and 71: Building the Examples 70 1. Select
- Page 72 and 73: Debugging Java EE Applications Debu
- Page 77 and 78: 3 CHAPTER 3 Web Applications Gettin
- Page 79 and 80: FIGURE 3-2 Java Web Application Tec
- Page 81 and 82: Web Modules FIGURE 3-4 Response The
- Page 83 and 84: FIGURE 3-5 Web Module Structure web
- Page 85 and 86: Deploying with the Admin Console 1.
- Page 87 and 88: To update the project in NetBeans I
- Page 89 and 90: To use the Ant tool, execute the fo
- Page 91 and 92: To deploy the example using NetBean
- Page 93 and 94: 7. In the Add Initialization Parame
- Page 95 and 96: TABLE 3-1 Web Components That Accep
- Page 97 and 98: Accessing Databases fromWeb Applica
- Page 99 and 100: 4 CHAPTER 4 What Is a Servlet? Java
- Page 101 and 102: tut-install/javaeetutorial5/example
- Page 103 and 104: Handling Servlet Life-Cycle Events
- Page 105 and 106: You can specify an event listener u
- Page 107 and 108: ■ Multiple threads within a web c
- Page 109 and 110: Initializing a Servlet To ensure th
- Page 111 and 112: An HTTP request URL contains the fo
- Page 113 and 114: ook from the bookstore database. Fi
- Page 115 and 116: ■ Modify the request headers and
- Page 117 and 118: Programming Customized Requests and
- Page 119 and 120: FIGURE 4-3 Duke’s Bookstore with
- Page 121 and 122: You can direct the filter to be app
- Page 123 and 124: If the resource is static, the incl
- Page 125 and 126:
The web context is used by the Duke
- Page 127 and 128:
You can also set the timeout period
- Page 129 and 130:
Tracking Service Requests To track
- Page 131 and 132:
Further Information about Java Serv
- Page 133 and 134:
5 CHAPTER 5 What Is a JSP Page? Jav
- Page 135 and 136:
" prefix="c" %> Localized Dates
- Page 137 and 138:
TABLE 5-1 Duke’s Bookstore Exampl
- Page 139 and 140:
“Scripting in JSP Pages”). Alth
- Page 141 and 142:
FIGURE 5-2 Book Catalog The Example
- Page 143 and 144:
After the page has been translated
- Page 145 and 146:
A registry of content type names is
- Page 147 and 148:
... As explained in “The Life Cy
- Page 149 and 150:
tasks are performed, all done in a
- Page 151 and 152:
The web container evaluates a varia
- Page 153 and 154:
After declaring an enum constant ca
- Page 155 and 156:
The inputText tag displays a UIInpu
- Page 157 and 158:
■ Configure the page with the pag
- Page 159 and 160:
Resolving Expressions The unified E
- Page 161 and 162:
Implicit Objects The JSP expression
- Page 163 and 164:
ne lt gt le ge true false null inst
- Page 165 and 166:
In this example, the expression ref
- Page 167 and 168:
} public void setDatabase(BookDBAO
- Page 169 and 170:
A property set from a constant stri
- Page 171 and 172:
To use a custom tag in a JSP page,
- Page 173 and 174:
Including theTag Library Implementa
- Page 175 and 176:
Including an Applet The scope of th
- Page 177 and 178:
Unable to start plugin. Setting P
- Page 179 and 180:
TABLE 5-9 EL Evaluation Settings fo
- Page 181 and 182:
Alternatively, a page author can se
- Page 183 and 184:
6 CHAPTER 6 JavaServer Pages Docume
- Page 185 and 186:
6. Click Open Project. 7. In the Pr
- Page 187 and 188:
Here is the same page i
- Page 189 and 190:
You can include the xmlns attribute
- Page 191 and 192:
Note that jsp:root is required beca
- Page 193 and 194:
TABLE 6-2 EL Operators and JSP Docu
- Page 195 and 196:
To illustrate this, here is an exam
- Page 197 and 198:
This syntax notation summarizes the
- Page 199 and 200:
7 CHAPTER 7 JavaServer Pages Standa
- Page 201 and 202:
Using JSTL See “Troubleshooting D
- Page 203 and 204:
CoreTag Library select * from PUBL
- Page 205 and 206:
Iterator i = cart.getItems().itera
- Page 207 and 208:
Arrays of objects as well as arrays
- Page 209 and 210:
The redirect tag sends an HTTP red
- Page 211 and 212:
TABLE 7-5 Example XPath Expressions
- Page 213 and 214:
 
- Page 215 and 216:
The setBundle and bundle Tags You c
- Page 217 and 218:
oth tags to update the database inv
- Page 219 and 220:
The following excerpt from tut-ins
- Page 221 and 222:
The rest of the JSTL functions
- Page 223 and 224:
8 CHAPTER 8 CustomTags in JSP Pages
- Page 225 and 226:
Figure 8-1 shows the flow of a requ
- Page 227 and 228:
Types ofTags Simple tags are invoke
- Page 229 and 230:
DeferredValue A deferred value attr
- Page 231 and 232:
Communication betweenTags Custom ta
- Page 233 and 234:
To learn how to configure the examp
- Page 235 and 236:
ody-content Attribute You specify t
- Page 237 and 238:
To declare an EL variable exposed b
- Page 239 and 240:
Encapsulating Reusable Content Usin
- Page 241 and 242:
CustomTag Examples This section int
- Page 243 and 244:
formatting of the book price is det
- Page 245 and 246:
${color.key} = ${color.value} T
- Page 247 and 248:
listener Element A tag library can
- Page 249 and 250:
Tag files bundled in a JAR require
- Page 251 and 252:
TABLE 8-10 attribute Subelements (C
- Page 253 and 254:
TABLE 8-11 variable Subelements (Co
- Page 255 and 256:
Tag Handlers forTags with Attribute
- Page 257 and 258:
public void doTag() throws JspExcep
- Page 259 and 260:
Tag Handlers forTagsThat DefineVari
- Page 261 and 262:
} } String type = data.getAttribute
- Page 263 and 264:
... connectionId false Tag Handl
- Page 265 and 266:
The template is a JSP page that has
- Page 267 and 268:
} double sale = book.getPrice() * .
- Page 269 and 270:
The table of screen definitions is
- Page 271 and 272:
9 CHAPTER 9 Scripting in JSP Pages
- Page 273 and 274:
Using Scripting Disabling Scripting
- Page 275 and 276:
} %> JSP Scriptlets A JSP scriptlet
- Page 277 and 278:
Tag handler methods defined by the
- Page 279 and 280:
If a tag handler needs to iterative
- Page 281 and 282:
} } Connection connection; if (cid
- Page 283 and 284:
10 CHAPTER 10 JavaServer FacesTechn
- Page 285 and 286:
Another important goal of JavaServe
- Page 287 and 288:
tut-install/javaeetutorial5/example
- Page 289 and 290:
Adding the view and form Tags All J
- Page 291 and 292:
Hi. My name is Duke. I’m think
- Page 293 and 294:
Hi. My name is Duke. I’m think
- Page 295 and 296:
In the case of the Guess Number exa
- Page 297 and 298:
UserNumberBean guessNumber.UserNum
- Page 299 and 300:
These behavioral interfaces are as
- Page 301 and 302:
TABLE 10-2 The UI Component Tags (C
- Page 303 and 304:
When a component is bound to an obj
- Page 305 and 306:
Navigation Model Validation Model J
- Page 307 and 308:
Backing Beans calls the action meth
- Page 309 and 310:
Configuring a Bean JavaServer Faces
- Page 311 and 312:
UserNumberBean.validate method, whi
- Page 313 and 314:
page 316) by calling FacesContext.r
- Page 315 and 316:
Update ModelValues Phase After the
- Page 317 and 318:
11 CHAPTER 11 Using JavaServer Face
- Page 319 and 320:
Chapter 12, “Developing with Java
- Page 321 and 322:
The uri attribute value uniquely id
- Page 323 and 324:
Using the CoreTags The tags include
- Page 325 and 326:
Adding UI Components to a Page Usin
- Page 327 and 328:
Unlike nearly every other JavaServe
- Page 329 and 330:
An editable text component in a Jav
- Page 331 and 332:
The required attribute causes the p
- Page 333 and 334:
■ Your shopping cart contains {0}
- Page 335 and 336:
A commandLink tag must include a ne
- Page 337 and 338:
The column tags represent columns o
- Page 339 and 340:
The url attribute specifies the pat
- Page 341 and 342:
panelGroup tag. This is because sty
- Page 343 and 344:
The value attribute of the selectOn
- Page 345 and 346:
FIGURE 11-6 An Example List Box Cre
- Page 347 and 348:
“UISelectItems Properties” on p
- Page 349 and 350:
localize dynamic data. If you are n
- Page 351 and 352:
The error messages that these tags
- Page 353 and 354:
Converting a Component’sValue To
- Page 355 and 356:
Please refer to the Customizing For
- Page 357 and 358:
TABLE 11-6 convertNumber Attributes
- Page 359 and 360:
The bookcatalog.jsp page uses setPr
- Page 361 and 362:
■ Nest a validator tag inside the
- Page 363 and 364:
#{MyBean.currentOption} In addition
- Page 365 and 366:
This tag gets the name of the custo
- Page 367 and 368:
Binding Converters, Listeners, andV
- Page 369 and 370:
Referencing a MethodThat Performs N
- Page 371 and 372:
value="#{cashier.name}" required="t
- Page 373 and 374:
Using a CustomValidator To register
- Page 375 and 376:
Using Custom Objects In the rendere
- Page 377 and 378:
12 CHAPTER 12 Developing with JavaS
- Page 379 and 380:
TABLE 12-1 Acceptable Types of Comp
- Page 381 and 382:
private String title = null; public
- Page 383 and 384:
public String getShippingOption() {
- Page 385 and 386:
Let’s separate the newsletters in
- Page 387 and 388:
See “Backing Beans” on page 307
- Page 389 and 390:
} text = "???" + key + "???"; } //
- Page 391 and 392:
Creating a Custom Converter As expl
- Page 393 and 394:
} } } buffer.append(input[i]); } St
- Page 395 and 396:
Implementing Action Listeners An Ac
- Page 397 and 398:
According to this validator, the da
- Page 399 and 400:
If your JavaServer Faces applicatio
- Page 401 and 402:
protected ValueExpression formatPat
- Page 403 and 404:
After setting the components’ ren
- Page 405 and 406:
A backing bean method that performs
- Page 407 and 408:
13 CHAPTER 13 Creating Custom UI Co
- Page 409 and 410:
You do not need to create a custom
- Page 411 and 412:
Understanding the Image Map Example
- Page 413 and 414:
alt="#{bundle.ChooseLocale}" usemap
- Page 415 and 416:
The value attributes of the area ta
- Page 417 and 418:
Creating Custom Component Classes A
- Page 419 and 420:
The rendering of the map and input
- Page 421 and 422:
Notice that encodeBegin renders onl
- Page 423 and 424:
“Creating the Component Tag Handl
- Page 425 and 426:
To specify where state is saved for
- Page 427 and 428:
Identifying the RendererType During
- Page 429 and 430:
Retrieving the ComponentType As exp
- Page 431 and 432:
} } Boolean(immediate.getExpression
- Page 433 and 434:
Defining the Custom ComponentTag in
- Page 435 and 436:
14 CHAPTER 14 Configuring JavaServe
- Page 437 and 438:
■ Using value elements, set the p
- Page 439 and 440:
The managed-bean element can contai
- Page 441 and 442:
equest areaCode #{initParam.defaul
- Page 443 and 444:
This example initializes an arra
- Page 445 and 446:
... newsletters java.util.ArrayLis
- Page 447 and 448:
... com.sun.bookstore6.resources.
- Page 449 and 450:
Configuring Navigation Rules As exp
- Page 451 and 452:
navigate from one particular page i
- Page 453 and 454:
java.lang.String ... The render-k
- Page 455 and 456:
shape java.lang.String The compo
- Page 457 and 458:
To make sure that the FacesServlet
- Page 459 and 460:
7. In the Add Context Parameter dia
- Page 461 and 462:
Restricting Access to JavaServer Fa
- Page 463 and 464:
3. Add a param-value element to the
- Page 465 and 466:
15 CHAPTER 15 Internationalizing an
- Page 467 and 468:
public void chooseLocaleFromLink(Ac
- Page 469 and 470:
style="color: red; text-decoration:
- Page 471 and 472:
Character Encoding A character enco
- Page 473 and 474:
Calls to setContentType set the cha
- Page 475 and 476:
PART III Web Services Part Three ex
- Page 477 and 478:
16 CHAPTER 16 BuildingWeb Services
- Page 479 and 480:
You may specify an explicit interfa
- Page 481 and 482:
Building, Packaging, and Deploying
- Page 483 and 484:
Hello port = service.getHelloPort()
- Page 485 and 486:
Types Supported by JAX-WS JAX-WS de
- Page 487 and 488:
17 CHAPTER 17 JAXB Architecture Bin
- Page 489 and 490:
FIGURE 17-2 Steps in the JAXB Bindi
- Page 491 and 492:
Binding XML Schemas This section de
- Page 493 and 494:
TABLE 17-2 JAXB Mapping of XML Data
- Page 495 and 496:
TABLE 17-4 JAXB Annotations Associa
- Page 497 and 498:
TABLE 17-6 JAXB Annotations Associa
- Page 499 and 500:
JAXB Examples TABLE 17-8 JAXB Annot
- Page 501 and 502:
TABLE 17-11 Java-to-Schema JAXB Exa
- Page 503 and 504:
-help Display a brief summary of th
- Page 505 and 506:
TABLE 17-13 Schema-to-Java Bindings
- Page 507 and 508:
■ setPartNum(String value); ■ g
- Page 509 and 510:
Basic JAXB Examples This section de
- Page 511 and 512:
import javax.xml.bind.Marshaller; i
- Page 513 and 514:
Why Customize? In most cases, the d
- Page 515 and 516:
* ■ schemaLocation is a URI re
- Page 517 and 518:
FIGURE 17-3 Customization Scope Inh
- Page 519 and 520:
given schema or binding declaration
- Page 521 and 522:
■ customizes the Javadoc tool an
- Page 523 and 524:
For inline annotations, the declar
- Page 525 and 526:
3. Select the inline-customize fold
- Page 527 and 528:
Class Binding Declarations The foll
- Page 529 and 530:
}; public static String printShortT
- Page 531 and 532:
Binding Declaration Files The follo
- Page 533 and 534:
... binding-declarations ... Cla
- Page 535 and 536:
If you are using JDK 6, perform the
- Page 537 and 538:
The default content order for @XmlT
- Page 539 and 540:
Interface XmlAdapter and annotation
- Page 541 and 542:
AdapterPurchaseListToHashMap with f
- Page 543 and 544:
The @XmlRootElement annotation maps
- Page 545 and 546:
There is an order of precedence as
- Page 547 and 548:
Why StAX? 18 CHAPTER 18 Streaming A
- Page 549 and 550:
■ A StAX pull parser can filter X
- Page 551 and 552:
Cursor API As the name implies, the
- Page 553 and 554:
TABLE 18-2 XMLEvent Types (Continue
- Page 555 and 556:
TABLE 18-3 Example of Iterator API
- Page 557 and 558:
Using StAX In general, StAX program
- Page 559 and 560:
Resources, Namespaces, and Errors T
- Page 561 and 562:
XMLInputFactory f = XMLInputFactory
- Page 563 and 564:
writer.writeAttribute("http://c","c
- Page 565 and 566:
Example Code However, there may be
- Page 567 and 568:
Note that next() just returns an in
- Page 569 and 570:
6. In the Projects tab, right-click
- Page 571 and 572:
Building and Running the Cursor-to-
- Page 573 and 574:
Building and Running the Event Exam
- Page 575 and 576:
Filtering the Stream The final step
- Page 577 and 578:
Creating an Event Producer/Consumer
- Page 579 and 580:
Creating a StreamWriter The next st
- Page 581 and 582:
Further Information about StAX For
- Page 583 and 584:
19 CHAPTER 19 SOAP with Attachments
- Page 585 and 586:
FIGURE 19-1 SOAPMessage Object with
- Page 587 and 588:
The SAAJ API provides the Attachmen
- Page 589 and 590:
In the section “Code Examples”
- Page 591 and 592:
SOAPHeader header = message.getSOAP
- Page 593 and 594:
The outermost element in this XML
- Page 595 and 596:
Getting a SOAPConnection Object Th
- Page 597 and 598:
Adding Content to the Header To add
- Page 599 and 600:
Adding a Document to the SOAP Body
- Page 601 and 602:
The other two SOAPMessage.createAtt
- Page 603 and 604:
The following line of code removes
- Page 605 and 606:
the SOAPHeader object. So, for exam
- Page 607 and 608:
Using SOAP Faults In this section,
- Page 609 and 610:
The following SOAP 1.1 code fragmen
- Page 611 and 612:
Code Examples newDetail. Not all SO
- Page 613 and 614:
For the Request class to be runnabl
- Page 615 and 616:
mustUnderstand is true Header name
- Page 617 and 618:
} while (attrs.hasNext()){ QName at
- Page 619 and 620:
6. In the Arguments field, type the
- Page 621 and 622:
message.addAttachmentPart(attachmen
- Page 623 and 624:
The missing files are activation.ja
- Page 625 and 626:
Further Information about SAAJ For
- Page 627 and 628:
PART IV Enterprise Beans Part Four
- Page 629 and 630:
20 CHAPTER 20 Enterprise Beans Ente
- Page 631 and 632:
What Is a Session Bean? A session b
- Page 633 and 634:
What Makes Message-Driven Beans Dif
- Page 635 and 636:
To create an enterprise bean that a
- Page 637 and 638:
Web Service Clients A web service c
- Page 639 and 640:
Naming Conventions for Enterprise B
- Page 641 and 642:
FIGURE 20-4 Life Cycle of a Statele
- Page 643 and 644:
21 CHAPTER 21 Getting Started with
- Page 645 and 646:
} public BigDecimal yenToEuro(BigDe
- Page 647 and 648:
@EJB private static Converter conve
- Page 649 and 650:
} try { InitialContext ic = new Ini
- Page 651 and 652:
Running the converter Application C
- Page 653 and 654:
Modifying the Java EE Application T
- Page 655 and 656:
22 CHAPTER 22 The cart Example Sess
- Page 657 and 658:
Stateful session beans also may:
- Page 659 and 660:
@PrePassivate methods are invoked b
- Page 661 and 662:
Building, Packaging, and Deploying
- Page 663 and 664:
Undeploying the cart Example To und
- Page 665 and 666:
Building, Packaging, and Deploying
- Page 667 and 668:
Timer timer = timerService.createTi
- Page 669 and 670:
private static final Logger logger
- Page 671 and 672:
ant run This task first retrieves t
- Page 673 and 674:
23 CHAPTER 23 A Message-Driven Bean
- Page 675 and 676:
The Message-Driven Bean Class The c
- Page 677 and 678:
Creating the Administered Objects f
- Page 679 and 680:
ant run Ignore the message that sta
- Page 681 and 682:
PART V Persistence Part Five explor
- Page 683 and 684:
Entities 24 CHAPTER 24 Introduction
- Page 685 and 686:
Persistent Fields If the entity cla
- Page 687 and 688:
public final class LineItemKey impl
- Page 689 and 690:
■ For one-to-one bidirectional re
- Page 691 and 692:
Mapped superclasses are not queryab
- Page 693 and 694:
The javax.persistence.Discriminator
- Page 695 and 696:
Application-Managed Entity Managers
- Page 697 and 698:
cascade element set to REMOVE or AL
- Page 699 and 700:
} .setParameter(1, name) .getResult
- Page 701 and 702:
25 CHAPTER 25 Persistence in theWeb
- Page 703 and 704:
A resource-local entity manager can
- Page 705 and 706:
public final class ContextListener
- Page 707 and 708:
public void buyBooks(ShoppingCart c
- Page 709 and 710:
26 CHAPTER 26 Persistence in the EJ
- Page 711 and 712:
eferencedColumnName="REVISION") })
- Page 713 and 714:
In order, two entities use compound
- Page 715 and 716:
@IdClass(order.entity.PartKey.class
- Page 717 and 718:
SPECIFICATION is mapped to the fiel
- Page 719 and 720:
@NamedQuery( name="findAllOrders",
- Page 721 and 722:
You will see the output from the SQ
- Page 723 and 724:
appclient-command-common: [exec] Co
- Page 725 and 726:
@JoinColumn(name="PLAYER_ID", refer
- Page 727 and 728:
AutomaticTable Generation in the ro
- Page 729 and 730:
[echo] running application client c
- Page 731 and 732:
27 CHAPTER 27 The Java Persistence
- Page 733 and 734:
Example Queries update_statement ::
- Page 735 and 736:
Navigating to Single-Valued Relatio
- Page 737 and 738:
See also: “NULL Comparison Expres
- Page 739 and 740:
TABLE 27-1 BNF Symbol Summary (Cont
- Page 741 and 742:
[where_clause] [groupby_clause] [ha
- Page 743 and 744:
oolean_primary ::= state_field_path
- Page 745 and 746:
IdentificationVariables An identifi
- Page 747 and 748:
SELECT c FROM Customer c INNER JOIN
- Page 749 and 750:
FROM Player AS p, IN (p.teams) t WH
- Page 751 and 752:
TABLE 27-2 Query Language Order Pre
- Page 753 and 754:
SELECT t FROM Team t WHERE t.league
- Page 755 and 756:
TABLE 27-4 String Expressions (Cont
- Page 757 and 758:
Two strings are equal only if they
- Page 759 and 760:
SELECT COUNT(o) FROM Order o The fo
- Page 761 and 762:
PART VI Services Part Six explores
- Page 763 and 764:
28 CHAPTER 28 Introduction to Secur
- Page 765 and 766:
FIGURE 28-1 Initial Request Web Cli
- Page 767 and 768:
FIGURE 28-5 Invoking an Enterprise
- Page 769 and 770:
■ Auditing: The means used to cap
- Page 771 and 772:
Transport-Layer Security Transport-
- Page 773 and 774:
This tutorial does not document how
- Page 775 and 776:
Securing the Application Server Thi
- Page 777 and 778:
FIGURE 28-6 Mapping Roles to Users
- Page 779 and 780:
Some OtherTerminology The following
- Page 781 and 782:
For applications, you define securi
- Page 783 and 784:
Establishing a Secure Connection Us
- Page 785 and 786:
mechanism can alleviate this concer
- Page 787 and 788:
procedure outlined in the next sect
- Page 789 and 790:
Signing Digital Certificates After
- Page 791 and 792:
There are at least two ways to enab
- Page 793 and 794:
Further Information about Security
- Page 795 and 796:
29 CHAPTER 29 Securing Java EE Appl
- Page 797 and 798:
Although transparent to the applica
- Page 799 and 800:
} } ... // who have the security ro
- Page 801 and 802:
If the @DeclareRoles annotation is
- Page 803 and 804:
hr-department This role includes
- Page 805 and 806:
Specifying Method Permissions Using
- Page 807 and 808:
■ The method element uses the ejb
- Page 809 and 810:
Mapping Security Roles to Applicati
- Page 811 and 812:
The run-as identity applies to the
- Page 813 and 814:
The following is a listing of annot
- Page 815 and 816:
■ confidentiality: This element s
- Page 817 and 818:
Accepting Unauthenticated Users Web
- Page 819 and 820:
6. Build, package, and deploy the e
- Page 821 and 822:
Enterprise Bean Example Application
- Page 823 and 824:
[exec] Bel Canto [exec] Kafka on th
- Page 825 and 826:
package converter.secure.ejb; impor
- Page 827 and 828:
supported false -1
- Page 829 and 830:
Discussion: Securing the Duke’s B
- Page 831 and 832:
Using Programmatic Login Programmat
- Page 833 and 834:
false Securing EIS Applications You
- Page 835 and 836:
30 CHAPTER 30 SecuringWeb Applicati
- Page 837 and 838:
Working with Security Roles If you
- Page 839 and 840:
Specifying Security Roles Using Dep
- Page 841 and 842:
Checking Caller Identity Programmat
- Page 843 and 844:
checking the provided role name aga
- Page 845 and 846:
applications for annotations that s
- Page 847 and 848:
} } //.... } myCart.getTotal(); //.
- Page 849 and 850:
Defining Security Requirements forW
- Page 851 and 852:
example POST GET exampleRole CO
- Page 853 and 854:
GET POST CLIENT When the same u
- Page 855 and 856:
When you try to access a web resour
- Page 857 and 858:
HTTP basic authentication is not a
- Page 859 and 860:
Using Login Forms When creating a f
- Page 861 and 862:
FIGURE 30-4 Certificate-Based Mutua
- Page 863 and 864:
■ You can define a transport guar
- Page 865 and 866:
for the JSP page used in this examp
- Page 867 and 868:
hello1_formauth index index /ind
- Page 869 and 870:
Mapping Application Roles to Applic
- Page 871 and 872:
3. Enter a user name and password c
- Page 873 and 874:
Example: Basic Authentication with
- Page 875 and 876:
Specifying the Security Constraint
- Page 877 and 878:
Mapping Application Roles to Applic
- Page 879 and 880:
3. A default login form displays. E
- Page 881 and 882:
3. Clean out files from the previou
- Page 883 and 884:
specify that users in the applicati
- Page 885 and 886:
shown below (modifications from the
- Page 887 and 888:
If the username and password you en
- Page 889 and 890:
31 CHAPTER 31 The Java Message Serv
- Page 891 and 892:
■ The application business model
- Page 893 and 894:
The next section introduces the JMS
- Page 895 and 896:
FIGURE 31-3 Point-to-Point Messagin
- Page 897 and 898:
■ Messages Figure 31-5 shows how
- Page 899 and 900:
In addition to injecting a connecti
- Page 901 and 902:
MessageProducer producer = session.
- Page 903 and 904:
JMS Message Selectors If your messa
- Page 905 and 906:
TABLE 31-2 JMS Message Types (Conti
- Page 907 and 908:
In a Java EE application, some of t
- Page 909 and 910:
6. Sends one or more messages to th
- Page 911 and 912:
cd producer 2. To create all the re
- Page 913 and 914:
a. Right-click the synchconsumer pr
- Page 915 and 916:
6. In a different terminal window,
- Page 917 and 918:
} } else { System.out.println("Mess
- Page 919 and 920:
The output of the program looks lik
- Page 921 and 922:
Writing the Client Program for the
- Page 923 and 924:
The output of the program looks lik
- Page 925 and 926:
Destination type is queue Reading m
- Page 927 and 928:
FIGURE 31-6 Sending Messages from O
- Page 929 and 930:
ant delete-remote-factory Remember
- Page 931 and 932:
Creating Robust JMS Applications In
- Page 933 and 934:
c. Select the ackequivexample folde
- Page 935 and 936:
producer.setPriority(7); ■ You ca
- Page 937 and 938:
You establish the unique identity o
- Page 939 and 940:
program contains a DurableSubscribe
- Page 941 and 942:
are acknowledged. A transaction rol
- Page 943 and 944:
This example shows how to use a que
- Page 945 and 946:
FIGURE 31-10 Transactions: JMS Clie
- Page 947 and 948:
Quantity to be ordered is 3 Retaile
- Page 949 and 950:
Using Session Beans to Produce and
- Page 951 and 952:
It may implement a @PostConstruct c
- Page 953 and 954:
■ Bean-managed transactions: You
- Page 955 and 956:
32 CHAPTER 32 Java EE Examples Usin
- Page 957 and 958:
FIGURE 32-1 A Java EE Application:
- Page 959 and 960:
Coding the Message-Driven Bean: Mes
- Page 961 and 962:
Building, Deploying, and Running th
- Page 963 and 964:
A Java EE ApplicationThat Uses the
- Page 965 and 966:
3. Creates a MessageConsumer for th
- Page 967 and 968:
Building, Deploying, and Running th
- Page 969 and 970:
Building, Deploying, and Running th
- Page 971 and 972:
An Application ExampleThat Consumes
- Page 973 and 974:
Creating Resources for the consumer
- Page 975 and 976:
Sending message: This is message 1
- Page 977 and 978:
ant undeploy You can also delete th
- Page 979 and 980:
FIGURE 32-4 A Java EE Application T
- Page 981 and 982:
An Application ExampleThat Deploys
- Page 983 and 984:
An Application ExampleThat Deploys
- Page 985 and 986:
To deploy the replybean module on t
- Page 987 and 988:
Replace remote-system-name with the
- Page 989 and 990:
33 CHAPTER 33 Transactions A typica
- Page 991 and 992:
FIGURE 33-1 Transaction Scope TX1{
- Page 993 and 994:
Summary ofTransaction Attributes Ta
- Page 995 and 996:
Synchronizing a Session Bean’s In
- Page 997 and 998:
In a stateful session bean with a J
- Page 999 and 1000:
FIGURE 33-3 Updating Multiple Datab
- Page 1001 and 1002:
34 CHAPTER 34 Resource Connections
- Page 1003 and 1004:
Resource Injection A JDBC connectio
- Page 1005 and 1006:
package com.example; public class S
- Page 1007 and 1008:
Like a database connection, a mail
- Page 1009 and 1010:
This compiles the source code and c
- Page 1011 and 1012:
35 CHAPTER 35 Connector Architectur
- Page 1013 and 1014:
FIGURE 35-2 Resource Adapter Module
- Page 1015 and 1016:
Outbound Contracts The Connector ar
- Page 1017 and 1018:
The component performs its interact
- Page 1019 and 1020:
PART VII Case Studies Part Seven pr
- Page 1021 and 1022:
36 CHAPTER 36 The Coffee Break Appl
- Page 1023 and 1024:
Common Code 5. When an order is pla
- Page 1025 and 1026:
The Coffee Break servers send two k
- Page 1027 and 1028:
With the creation of the request me
- Page 1029 and 1030:
Ordering Coffee The other kind of m
- Page 1031 and 1032:
} childName = new QName("price"); S
- Page 1033 and 1034:
In the following code fragment, doP
- Page 1035 and 1036:
} } else { StringBuffer concat = ne
- Page 1037 and 1038:
} // Retrieve orderID from message
- Page 1039 and 1040:
... When this tag is proc
- Page 1041 and 1042:
■ “The CoffeeBreakBean JavaBean
- Page 1043 and 1044:
com.sun.cb.CheckoutFormBean reques
- Page 1045 and 1046:
Building, Packaging, and Deploying
- Page 1047 and 1048:
FIGURE 36-2 Order Form Building, Pa
- Page 1049 and 1050:
37 CHAPTER 37 The Duke’s Bank App
- Page 1051 and 1052:
Session Beans The Duke’s Bank app
- Page 1053 and 1054:
method, like all methods in session
- Page 1055 and 1056:
FIGURE 37-2 Database Tables Custome
- Page 1057 and 1058:
Customer Info tab: ■ View custome
- Page 1059 and 1060:
Note - The source code for the web
- Page 1061 and 1062:
In the Duke’s Bank application, C
- Page 1063 and 1064:
The page fragment template/links.js
- Page 1065 and 1066:
The action attribute has the expres
- Page 1067 and 1068:
After the customer has been authent
- Page 1069 and 1070:
Building, Packaging, and Deploying
- Page 1071 and 1072:
FIGURE 37-6 Account List Building,
- Page 1073 and 1074:
PART VIII Appendixes Part Eight con
- Page 1075 and 1076:
A APPENDIX A Java Encoding Schemes
- Page 1077 and 1078:
B APPENDIX B About the Authors Java
- Page 1079 and 1080:
Index Numbers and Symbols @DeclareR
- Page 1081 and 1082:
annotations (Continued) @XmlTransie
- Page 1083 and 1084:
client applications, JMS (Continued
- Page 1085 and 1086:
Converter implementation classes (C
- Page 1087 and 1088:
detachNode method, 591 Detail inter
- Page 1089 and 1090:
event and listener model (Continued
- Page 1091 and 1092:
IOR security, 814-816 isCallerInRol
- Page 1093 and 1094:
JavaServer Faces standard UI compon
- Page 1095 and 1096:
jsp:output element, 194 JSP pages,
- Page 1097 and 1098:
listeners HTTP, 775 IIOP, 775 local
- Page 1099 and 1100:
objects, administered (JMS), 897-89
- Page 1101 and 1102:
queues (Continued) creating, 898-89
- Page 1103 and 1104:
security (Continued) programmatic,
- Page 1105 and 1106:
SSL (Continued) connectors Applicat
- Page 1107 and 1108:
transactions (Continued) session be
- Page 1109 and 1110:
unified expression language (Contin
- Page 1111 and 1112:
web modules (Continued) viewing dep
Inappropriate
Loading...
Inappropriate
You have already flagged this document.
Thank you, for helping us keep this platform clean.
The editors will have a look at it as soon as possible.
Mail this publication
Loading...
Embed
Loading...
Delete template?
Are you sure you want to delete your template?
DOWNLOAD ePAPER
This ePaper is currently not available for download.
You can find similar magazines on this topic below under ‘Recommendations’.