Web Application for Polycom Phones UC Software 5.0.0
Polycom, Inc. 66
To develop a dynamic XML application:
1 Use the following to create a addstock.xhtml example:
Table 57: Sample Code - addstock.XHTML Example
<html xmlns="http://www.w3.org/1999/xhtml">
<!- - HEADER START - ->
<head>
<title>Stocks</title>
</head>
<!- - HEADER END - ->
<!- - BODY START - ->
<body>
<!- - ADD STOCK FORM START - ->
<form method="POST" action="GetQuote.jsp">
<p>Symbol<input type="text" name="stockname"/>
<input type="submit" value="Get Quote"/></p>
</form>
<!- - ADD STOCK FORM END - ->
</body>
<!- - BODY END - ->
</html>
2 Configure the Web server to serve the above XHTML file.
For example, if you are using Apache Tomcat to try this example, then put this file into the
webapps\PLCM folder of Tomcat.
3 Write an application that is going to retrieve the stock information from a data service provider.
For the following table, the application will retrieve stock information from Yahoo and send it to the
microbrowser. This application is written using a Java Server Page (JSP). Name the file
GetQuote.jsp.
Table 58: Retrieving Stock Information Example
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@page
import="java.io.File,java.io.IOException,java.net.URL,java.awt.image.BufferedImage,j
avax.imageio.ImageIO"%>
<html>
<head>
<title>Stock Quote</title>
</head>
<body>
<%
// GETTING THE PATH WHERE BMP FILE HAS TO BE SAVED
String bmpFilePath = application.getRealPath(File.separator) + "quote.bmp";