Application: A online album all people like to take pictures! They like to show their own, relatives, friends, vacation photos, and web is a good place they show. - Even relatives outside a thousand miles can be seen. I will focus on defining a separate Picture object. (The source code of this application can be obtained in Resources). This object describes the fields required to represent a photo: Title, Date, an optional title, and a point to the image source. An image requires some of its own fields: source file (GIF / JPEG) positioning, width, and height pixels (to help build
tag. Here you can see a very simple advantage, that is, if you use the file system instead When the database, you can store graphics files in the same directory as the data file. Finally, let us extend the image record with an element, which defines a set of thumbnails to use for content tables or elsewhere. Here I use the image content that is the same as the previously defined. One picture of XML representation can be like this: alex on the beach title> 1999-08-08 date> Trying in Vain To Get a Tan CAPTION> alex-beach.jpg src> 340 width> 200 height> image> < Thumbnails> alex-beach-sm.jpg src> 72 width> 72 height> image> alex-beach-med .jpg src> 150 width> 99 height> image> thumbnails> picture> Note, by using XML, you will put all the information on a separate image In a separate file, not to disperse it into 3-4 tables. We call this as .pix file - so your file system will be like this: Summer99 / alex-beach.pix summer99 / Alex-beach.jpg summer99 / alex-beach-sm.jpg summer99 / alex-beach-med.jpg summer99 / alex-snorkeling.pix ETC. Technology Second, how to peel off the skin of the cat. Similar It is more than one way to put XML data into JSP. There are some ways, (in fact, many other tools can also do the same excellent.) DOM: You can use classes to call DOM interfaces (Interface ) Analyze checks for XML files. XmlenTryList: You can use my code to load XML to NAM E-Value PAIRS in java.util.list. XPath: You can use an XPath processor (such as RESIN) to locate an element in an XML file via a path name. XSL: You can use some XSL processor to convert XML to HTML.