Communicating with Other Servers in Java

Encoder Quick Response Code in Java Communicating with Other Servers

Communicating with Other Servers
QR Code Drawer In Java
Using Barcode generator for Java Control to generate, create QR Code image in Java applications.
Decoding Quick Response Code In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
The fourth step sets the message body s from and recipient properties, using setFrom(Address fromUser) and setRecipient(MessageRecipientType type, Address toUser), respectively The type parameter is used to distinguish among TO, CC, and BCC recipients Optional step five sets the subject of the mail message, using the message object s setSubject(String subject) method Step six creates the actual message text using the message object s setContent(Object body, String type) method The body parameter specifies the text, and type indicates the MIME type (usually text/plain) Finally, the mail is sent with the static Transportsend(Message message) method Transport is an abstract class whose concrete implementation is supplied by the mail service provider, such as the Sun smtpjar file
Barcode Printer In Java
Using Barcode printer for Java Control to generate, create barcode image in Java applications.
Bar Code Reader In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
E-Mail Notification in the Product Support System
Print QR Code In C#.NET
Using Barcode drawer for .NET framework Control to generate, create QR Code image in VS .NET applications.
Draw QR Code 2d Barcode In VS .NET
Using Barcode drawer for ASP.NET Control to generate, create QR image in ASP.NET applications.
Back to the problem at hand The product support system needs to notify the appropriate support person, developer, or tester when an problem is routed to that person This routing occurs in the model component, in its addProblemLog() method (see the comlyricnotesupportModel class listing in 19) The routing event IDs are as follows: RPS RPD RQA Routed to product support Routed to product development Routed to test
QR Code ISO/IEC18004 Creator In Visual Studio .NET
Using Barcode drawer for .NET framework Control to generate, create QR Code image in Visual Studio .NET applications.
QR Printer In VB.NET
Using Barcode drawer for VS .NET Control to generate, create QR-Code image in VS .NET applications.
JSP AND OTHER WEB COMPONENTS
UPC A Generator In Java
Using Barcode printer for Java Control to generate, create UPC-A Supplement 5 image in Java applications.
Code 128 Code Set B Creation In Java
Using Barcode maker for Java Control to generate, create Code 128B image in Java applications.
In addProblemLog(), you can determine if the event ID is one of these three If so, call a new model method notifySupport(ProblemLog log), listed here:
Print Bar Code In Java
Using Barcode printer for Java Control to generate, create bar code image in Java applications.
GS1 DataBar Stacked Printer In Java
Using Barcode creation for Java Control to generate, create GS1 DataBar Stacked image in Java applications.
/** * Sends email to the appropriate support person */ public void notifySupport(ProblemLog log) throws SQLException, IOException { // Get the problem object String problemID = loggetProblemID(); setProblemID(problemID); Problem problem = getProblem();
ISBN - 10 Drawer In Java
Using Barcode printer for Java Control to generate, create ISBN - 10 image in Java applications.
EAN13 Encoder In None
Using Barcode generator for Font Control to generate, create GTIN - 13 image in Font applications.
JSP: The Complete Reference
ECC200 Scanner In Visual Studio .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in VS .NET applications.
Bar Code Generator In .NET Framework
Using Barcode drawer for .NET framework Control to generate, create barcode image in VS .NET applications.
// Create the subject line from the problem ID // and problem description StringBuffer sb = new StringBuffer(); sbappend("Problem ID: "); sbappend(problemID); sbappend(" "); sbappend(problemgetDescription()); String subject = sbtoString(); // Get the product object We need this to find out // the support ID's and the corresponding e-mail // addresses String productID = problemgetProductID(); setProductID(productID); Product product = getProduct(); // Determine the appropriate party to receive the mail String employeeID = null; String eventDescription = null; String eventID = loggetEventID(); if (eventIDequals("RPS")) { employeeID = productgetProductSupport(); eventDescription = "ROUTED TO PRODUCT SUPPORT"; } else if (eventIDequals("RPD")) { employeeID = productgetDeveloper(); eventDescription = "ROUTED TO DEVELOPMENT"; } else if (eventIDequals("RQA")) { employeeID = productgetTester(); eventDescription = "ROUTED TO TEST";
Data Matrix 2d Barcode Maker In None
Using Barcode generator for Font Control to generate, create Data Matrix ECC200 image in Font applications.
UPC-A Supplement 5 Creation In Objective-C
Using Barcode maker for iPad Control to generate, create UPC A image in iPad applications.
21:
Code 128C Encoder In None
Using Barcode generator for Font Control to generate, create Code 128C image in Font applications.
Code-39 Encoder In Visual Studio .NET
Using Barcode creation for Reporting Service Control to generate, create ANSI/AIM Code 39 image in Reporting Service applications.
Communicating with Other Servers
} else return; eventDescription += "\r\n"; eventDescription += loggetComments(); // Lookup that person's email address Employee employee = getEmployee(employeeID); String email = employeegetEmail(); // Send mail to the party Address fromUser = new InternetAddress ("support@lyricnotecom", "Product Support System"); Address toUser = new InternetAddress (email, employeegetName()); Properties props = new Properties(); propsput("mailhost", "maillyricnotecom"); Session mailSession = SessiongetInstance(props, null); Message body = new MimeMessage(mailSession); try { bodysetFrom(fromUser); bodysetRecipient(MessageRecipientTypeTO, toUser); bodysetSubject(subject); bodysetContent(eventDescription, "text/plain"); Transportsend(body); } catch (MessagingException e) { throw new IOException(egetMessage()); } }
JSP AND OTHER WEB COMPONENTS
JSP: The Complete Reference
Figure 21-2 shows this new feature in action A problem is reported against the MIDI Transposer product The call center agent fills out the problem report and selects Route to product support as the action When the agent clicks the Submit button, the problem is added to the database and the model s addProblemLog() method is called Because the event is RPS, the notifySupport() method is invoked, resulting in the message shown in Figure 21-3 being sent to the product support representative
Figure 21-2
Problem report that includes routing to product support
21:
Communicating with Other Servers
Figure 21-3
E-mail message sent to the product support representative
Summary
Just as programs other than Web browsers can be JSP clients, so JSP pages can be clients to other servers This chapter considers two such environments: I Obtaining data from a CGI server I Sending mail with the JavaMail API JSP, servlets, CGI, PHP, and ASP, as well as other server-side scripting environments all use a common technology for delivering content to their clients: the HTTP protocol The javanet package provides the URL and URLConnection classes, which have methods for accessing resources through HTTP The JavaMail API is a scalable and extensible architecture for modeling all parts of a mail system Implementations of specific mail protocols such as POP, SMTP, and IMAP are freely available
Copyright © OnBarcode.com . All rights reserved.