When or should XML be used and why for this situation?

I am developing a 3-tiered web application (database, server, browser) that will use JSP to display a form where the user will enter their name and address information, JDBC for the connection to a mySQL database.
When the user enters their name and address information on the JSP displayed using the broswer, the data when submitted will be placed in the database.
How could I use XML for this situation? Is it really needed at all since I know it can all be done using only JSP? I am just wondering how using XML could help?
Please give me any feedback you can...if you need more detail to what I am trying to do, let me know....
Thank you so much in advance!!!

Hi,
XML is really useful for representing data from different resources. E.g. it can take a database and represent it as an xml document or it could be an xml document hosted on an external server. By using XML in the jsps, the jsp is completed oblivious to where the xml data came from i.e. either a database or an xml doc. Using XML provides a level of abstraction so that the jsp only needs to know the methods to access/retrieve data not how to access the data i.e. it doesn't have to worry about how to connect to the database, and create sql statements.
In the situation described if you can be sure that the information that the jsp retrieves will be only from a database then you do not need to use xml, otherwise by using xml you adhere to good-old object design principles.
There is a paper on using xml and jsp see:
http://java.sun.com/products/jsp/html/JSPXML.html
Hope this helps.

Similar Messages

  • Should I be using 2D arrays for this problem (or) how do I go about solving

    An array is being used to represent an organizational hierarchy. This is done by using the array subscript to map to the employee-id and the value in each element to represent the employee-id of the supervisor of the employee.
    For example the first element in the array maps to the supervisor of employee-id 1, the second element maps to the supervisor of employee id 2. The corresponding value for the top person in the organization is set to -1.
    For example the following array ?
    7 5 7 10 -1 7 5 2 2 5
    translates to the following hierarchical structure -
    ? employee 5 is the top boss
    ? employees 2, 7, and 10 report to employee 5
    ? employees 8 and 9 report to employee 2
    ? employees 1, 3 and 6 report to employee 7
    ? employee 4 reports to employee 10
    The following diagram represents the organization structure
    5
    + --- 2
    | + --- 8
    | + --- 9
    |
    + --- 7
    | + --- 1
    | + --- 3
    | + --- 6
    |
    + --- 10
    + --- 4
    5 is at level 1 in the organization.
    2, 7 and 10 are at level 2
    1, 3, 4, 6, 8, 9 are at level 3
    Given an array of size N (the employee-ids being 1 to N), write a program to find the number of people in level L, where the top person in the organization is at level 1.

    Database is overkill!
    heres your assignment
    package myjava.demo;
    class DemoLevel{
         class LevelData{
            int members[];
            int size = 0;
            int level = 0;
            public String toString() { return "Level: " + level + " Size: " + size;}
        LevelData getNextLevel(int data[],LevelData current){
            LevelData nextlevel = new LevelData();
            nextlevel.level = current.level + 1;
            nextlevel.members = new int[data.length];
            for(int i = 0; i< data.length;i = i + 1){
                if(data[i] != -1 && current.members[data[i]-1] != 0){ //data[i] indicates i's parent. this ask if its a member of current
                    nextlevel.members[i] = data[i]-1; //store its parent. not needed in this algo. but better then true and false
                    nextlevel.size = nextlevel.size + 1;
                }else{ nextlevel.members[i] = 0;}
            return nextlevel;
        LevelData getFirstLevel(int data[]){
            LevelData firstlevel = new LevelData();
            firstlevel.level = 1;
            firstlevel.members = new int [data.length];
            for(int i = 0; i < data.length;i = i + 1){
                if(data[i] == -1){
                    firstlevel.members[i] =   -1;
                    firstlevel.size = firstlevel.size + 1;
                }else { firstlevel.members[i] = 0;}
            return firstlevel;
        void execute(){
            int data[] = { 7, 5, 7, 10, -1, 7, 5, 2, 2, 5};
            LevelData current = getFirstLevel(data);
            System.out.println(current);
            while(current.size != 0)
                current = getNextLevel(data,current);
                System.out.println(current);
    public class Demo {
        public static void main(String[] args) {
            DemoLevel dl = new DemoLevel();
            dl.execute();

  • My Ipod Touch conects to my wi-fi, but when I open safari, or any other app that needs internet, it doesnt work. what should I do and why is this happening?

    My sister bought me an ipod touch less than a month ago. when he first came, he was conecting normal to my wifi, but today, he isnt. I use the same wifi at my laptop, and its perfectly working. My ipod identify the network, conects to it, but when I open an app that needs it, it doesnt work. What should I do?
    And why is this happening?

    - Reset the iPod. Nothing will be lost
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections

  • When using Numbers with iCloud, a new version of the spreadsheet is created even when no reisions have been made. Why is this, and how do I make it stop?

    When using Numbers with iCloud, a new version is created every time I make a change. I do not want all these revised documents. When I change a document, I commit to that change. How do I shut off this multiple-revision feature of Numbers being pushed to iCloud.
    Also....
    When using Numbers with iCloud, a new version of the spreadsheet is created even when no revisions have been made. Why is this, and how do I make it stop?
    My files are growing.

    Your plugins list shows outdated plugin(s) with known security and stability risks.
    # Java Plug-in 1.5.0_11 for Netscape Navigator (DLL Helper)
    # Adobe Shockwave for Director Netscape plug-in, version 11.0
    Update the [[Java]] and [[Shockwave|Shockwave for Director]] plugin to the latest version.
    See
    http://java.sun.com/javase/downloads/index.jsp#jdk (you need JRE)
    http://www.adobe.com/shockwave/welcome/

  • Thank you for approving my feed iTunes . The only problem is, there is no art work, even though artwork was submitted correct sizes and formats were used. Why is this and how can the problem be rectified?

    Thank you for approving my feed iTunes . The only problem is, there is no art work, even though artwork was submitted correct sizes and formats were used. Why is this and how can the problem be rectified?

    Thanks for getting back. Hadn't got round to re uploading the amended feed. I just did it now.
    The only thing is, Feed Validator doesn't like it because of the picture size, and a couple of other things, it reeds the following:
    Sorry
    This feed does not validate.
    line 22, column 14: width must be between 1 and 144: 1400 [help] <width>1400</width>
                  ^
    line 23, column 15: height must be between 1 and 400: 1400 [help] <height>1400</height>
                   ^
    line 25, column 21: XML parsing error: <unknown>:25:21: not well-formed (invalid token) [help]
    <itunes:image href=http://www.whiteberg.com/Wdotfontitunes2.png" />
                         ^
    In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
    Your feed appears to be encoded as "utf-8", but your server is reporting "US-ASCII" [help]
    line 4, column 114: Self reference doesn't match document location [help]... dcast.xml" type="application/rss+xml" />
                                                 ^

  • What power supply attachement do you use and why?

    Hey All! im curious i use to use the AC wall plug that came with the magsafe charger but recently started using the power cord for more length. I started using it since im home most of the time and the outlets are pretty far from the sitting arrangements. So what do you use and why?
    Thanks!

    I use the longer one all the time, as I usually end up aways away from a plug, and its easier to fit into an outlet or power strip that is already overburdened with warts.
    I don't understand why one cord is grounded, and the other is not. The brick clearly doesn't need grounding, so why is the longer cord grounded? Is it some sort of weird law?
    When travelling, I ALWAYS throw the little short flip-out plug in though, just in case I am in some archiac building that has not been updated with 3-prong grounded wiring. I also heard that in Canada, most or all of the plugs are two-prong only.

  • Why is itunes so hard to use - and why can't apple fix it?

    why is itunes so hard to use - and why can't apple fix it
    I dont know anybody who likes the way itunes works.'
    This last version is beyond awful. It took an already hard to use program - but one that I had at least figured out and made it even harder.

    Wendy,
    If you are experiencing a particular problem, please post specifics, and most likely someone here will be able to help.

  • TS2551 When I open iphoto says I have 4500 pics I haven 't downloaded that many. When I looked I have pic of ebay home page facebook a lot of different web sites I've visited How do I stop this and why is this happening.

    When I open iphoto says I have 4500 pics I haven 't downloaded that many. When I looked I have pic of ebay home page facebook a lot of different web sites I've visited How do I stop this and why is this happening.

    This happens when someone drags the HD or a system folder icon to the iPhoto Window by accident. Solution: restore from back up created before this occurred.
    Regards
    TD

  • Query as Web Services!!! What are its uses and why do we need it?

    What are its uses and why do we need it.. if other tools like Dashboard and crystal reports and Webi can connect to universe and create reports and Analytics...

    Hello  Rajsan Madhavarajan  
    Query as a Web Service (QaaWS) is a SAP Business Objects (BOBJ)  client-side tool that allows users to create and publish Web Services that can be made available over the Web.  Once these web services are created and published,  they can be consumed like any other standard Web Service in software applications including Xcelsius and Crystal Reports.   But first we have to understand what exactly is a Web Service.
    Web Service
    A Web Service is a software system that supports  interoperable interaction over a network from one computer or machine to another but is more commonly defined as a client and a server communicating data over the Web using the HTTP Protocol. Using Web Services along with Business Objects allows a live connection of data to be used in applications such as Xcelsius and Crystal Reports through a semantic layer called a Universe.
    Query as a Web Service (QaaWS)
    The two main components in QaaWS are the Client Tool and the Server.  The QaaWS Client Tool gives the end user an easy to use wizard that allows them to create Universe queries and publish them as Web Services.  Once the QaaWS is published, any user can securely access the data that the Web Service contains as long as they have access to that server. Have a look on  image below that shows the information flow to and from the server via the client.
    Advantages to QaaWS:
    Very easy to use and intuitive interface Familiar look and feel for people who have used Web Intelligence
    Leverages existing Business Objects Universes Shares metadata with Web Intelligence, Desktop Intelligence and Crystal Reports
    Maintains Business Objects Enterprise Security
    Allows live data feeds to be incorporated into Xcelsius Dashboards and Crystal Reports

  • When im signing up in itunes and it says "This Apple ID has not yet been used with the iTunes Store."

    when im signing up in itunes and it says "This Apple ID has not yet been used with the iTunes Store."

    You have to sign into your account and verify that you have a valid payment mendo specified in your account
    Settings>iTunes and App Store>Apple ID>View Account

  • TS4006 I have iPhone 4 with updated latest iOS And i am using FIND IPHONE application. But everytime when ever i login in it and serch for the device its shows but never give me the location"NO LOCATION AVAILABLE".It is already connected with WIFI but no

    I have iPhone 4 with updated latest iOS And i am using FIND IPHONE application. But everytime when ever i login in it and serch for the device its shows the device  but never give me the location"NO LOCATION AVAILABLE".It is already connected with WIFI and i tried all the stuffs that has been written in the manual. Plese give me the Proper suggetion about this issue..!!

    If your router is not identified in a national database (don't recall who maintains it or where it is) then there is no location associated with it.  Hence your device cannot be located.  I suggest you try your test at some public wifi spot, like a bookstore or coffee shop.  These places usually have a location associated with their wifi router.

  • What is better to use and why?

    Hi,
    What is better to use and why?
    We have written follwing statements to check the existence of interested record in table.
    1).
    select count(*) from emp where deptno = 20;
    2).
    select 'X'
    from dual
    where exists (
    select 'X' from emp
    where deptno = 20);
    Thanks and Regards,
    Rushang Kansara

    Assuming a large table, number two would be the fastest. If empno in unique, you can leave out the where exists part and just select x from emp where empno = 20. If empno is not unique, then using where exists can be faster. Assuming that empno is not unique, query 1 may elect to scan the whole table looking for that empno. Number 2 can use the index and return your result in, typically, three LIOs.
    Again, it all depends on your indexing, size of tables, and uniqueness of key upon which you are searching.

  • What photo editing software is everyone using and why?

    I am trying to find a good photo editing software to use and before spending any money on it would like to hear everyones opinion on what they use and why? Originally I intended on purchasing aperture ... but I am under the impression that aperture is being discontinued so now I am searching again ... thanks for everyones input in advance....

    If after trying out iPhoto's editing capabilities for a while you find you want more capability give Adobe Photoshop Elements for Mac a try.  It's reasonably priced and can do about 75% or so of what the full Photoshop can do like these:
    There's a free, open source application that's a lot like the full Photoshop: GIMP for Mac.  Another full featured editor along these same lines is Pixelmator.
    Some Image Editors That Support layers:
    Photoshop Elements 11 for Mac - $79
    Pixelmator - $60
    GIMP for Mac - Free
    So there are a lot of choices out there to investigate.

  • Download the updated version of the software can not use and why?

    Download the updated version of the software can not use and why?

    It will help if you tell us what model of iPod touch you have, how and from where you downloaded the update, what version of iOS this update is, and details about the problem; "can not use" doesn't give us anywhere near enough information on which to base a diagnosis and offer suggestions.
    Regards.

  • What pacman and or AUR warpper/helper do you use and why?

    What pacman and or AUR warpper/helper do you use and why?
    Last edited by jrussell (2013-04-07 12:40:07)

    tomk wrote:
    None, because I don't need one.
    Just in case you meant to say "AUR wrapper/helper", I use cower.
    I forgot AUR, thanks

Maybe you are looking for