tailieunhanh - Java Database Programming Bible- P9

Java Database Programming Bible- P9: Welcome to Java Database Programming Bible. This book is for readers who are already familiar with Java, and who want to know more about working with databases. The JDBC Application Programming Interface has made database programming an important aspect of Java development, particularly where Web applications are concerned. | Chapter 15 Using JSPs XSL and Scrollable ResultSets to Display Data The JavaBean required to apply the XSL transform is shown in Listing 15-11. For ease of checkout a main method is included. Caution The only deployment problem you are likely to encounter is that the path for the stylesheet defaults to Tomcat s bin directory unless you specify the path fully. Listing 15-11 XSL transform bean package import . import import import import import public class DetailPageTransformBean z A private String xslFileName null private byte xmlSource null private ByteArrayInputStream xmlInputStream null public DetailPageTransformBean tv public void setXmlSource byte xmlSource xmlSource xmlInputStream new ByteArraylnputStream xmlSource public void setXslFileName String xslFileName xslFileName File f new File xslFileName if Cannot find file xslFileName public byte applyTransform byte xmlSource setXmlSource xmlSource return applyTransform public byte applyTransform -401- Team-Fly Please purchase PDF Split-Merge on to remove this watermark. Chapter 15 Using JSPs XSL and Scrollable ResultSets to Display Data ByteArrayOutputStream outputstream new ByteArrayOutputStream try XSLTProcessor processor new XSLTInputSource xmllnputStream new XSLTInputSource xslFileName new XSLTResultTarget outputStream catch Exception e e return public static void main String args File f new File int id 1000 DetailPageXMLBean xmlBean new DetailPageXMLBean DetailPageTransformBean transformBean new DetailPageTransformBean id .

TỪ KHÓA LIÊN QUAN