Find us on Facebook Follow us on Twitter

Hottest Pass4sure 310-083 exam with braindumps | brain dumps | 3D Visualization 310-083 exam simulator is the best prep tool that uses updated exam prep - braindumps - and examcollection to prepare you for the 310-083 test - brain dumps - 3D Visualization

Pass4sure 310-083 dumps | 310-083 real questions |

310-083 Sun Certified Web Component Developer for J2EE 5

Study pilot Prepared by SUN Dumps Experts

Exam Questions Updated On : 310-083 Dumps and real Questions

100% real Questions - Exam Pass Guarantee with lofty Marks - Just Memorize the Answers

310-083 exam Dumps Source : Sun Certified Web Component Developer for J2EE 5

Test Code : 310-083
Test appellation : Sun Certified Web Component Developer for J2EE 5
Vendor appellation : SUN
: 276 real Questions

do this splendid supply state-of-the-art real test Questions.
To rate success in 310-083 exam. Humans conform with that a student believe to possess sharp brain. Although its miles genuine but it isnt entirely real on account that in conjunction with the pupil, the instruct or the teacher need to besides be rightly certified and knowledgeable. I experience blessed that I was acquainted with this in which I met such awesome educators who taught me a artery to clear my 310-083 test and were given me through them with a breeze. I thank them with the lowest of my coronary heart.

extraordinary source of first rate 310-083 intellect dumps, remedy answers.
This instruction kit has helped me pass the exam and rotate out to be 310-083 licensed. I couldnt be more excited and grateful to for such an spotless and dependable coaching device. I am capable of affirm that the questions within the package deal are actual, this isnt always a faux. I selected it for being a dependable (advocated with the useful resource of a chum) manner to streamline the exam coaching. fancy many others, I couldnt near up with the cash for studying complete time for weeks or maybe months, and has allowed me to squeeze down my preparation time and nonetheless rate a incredible give up result. Remarkable acknowledge for assiduous IT professionals.

simply attempted 310-083 question bank as soon as and i'm convinced.
As i am into the IT area, the 310-083 exam, changed into censorious for me to seem, but time restraints made it daunting for me to set together well. The easy to memorize answers made it a lot less complicated to prepare. It worked fancy a complete reference pilot and i used to be amazed with the result. I referred to the observe manual with 2 weeks to travel for the exam. I managed to finish every the questions well beneath stipulated time.

actual 310-083 questions and accurate solutions! It justify the charge.
First of every I need to stutter thanks to you people. I believe cleared 310-083 exam through subscribing in your hold a glance atmaterial. So I preferred to percentage my fulfillment in your internet site. Thank you once again. Thanks very lots on yourremarkable help. I believe cleared my 310-083 with 90%.

No more concerns while preparing for the 310-083 exam.
Im scripting this because I need yo stutter artery to you. i believe efficiently cleared 310-083 exam with 96%. The test questions and answers chain made with the useful resource of your crew is first rate. It not simplest offers a real sense of a web exam however each offerseach question with precise explananation in a easy language which is easy to apprehend. I am extra than joyful that I made the birthright desire through purchasing for your check series.

discovered an genuine source for actual 310-083 exam questions.
I organized 310-083 with the succor of and determined that they believe quite suitable stuff. I will pass for otherSUN tests as well.

Got maximum 310-083 Quiz in real test that I prepared.
I asked my brother to present me some recommendation concerning my 310-083 test and he informed me to buckle up on account that i used to be in for a remarkable journey. He gave me this killexams.coms deal with and informed me that became every I wanted as a artery to ensure that I spotless my 310-083 test and that too with arrogate marks. I took his recommendation and signed up and Im so satisfied that I did it since my 310-083 test went extraordinary and i handed with birthright score. It became fancy a dream near actual so thanks.

easy artery to pass 310-083 exam with these and exam Simulator.
I used to be lots upset in the ones days because of the fact I didnt any time to set together for 310-083 exam prep due to my some each day ordinary artwork I believe to expend most time on the manner, an extended distance from my domestic to my artwork vicinity. I was a lot concerned approximately 310-083 exam, because of the fact time is so near, then within the destiny my buddy knowledgeable approximately, that turned into the rotate to my life, the acknowledge of my every problems. I need to effect my 310-083 exam prep at the artery effortlessly thru using my pc and is so trustworthy and high-quality.

strive out those actual 310-083 questions.
This is absolutely the achievement of, now not mine. Very person pleasant 310-083 exam simulator and undoubted 310-083 QAs.

Party is over! Time to study and pass the exam.
I believe searched best dump for this particular concern be counted over online. But I could not locate the birthright one that completely explains first-class the wanted and essential matters. At the very time as i discovered brain sell off material i used to be genuinely surprised. It actually included the crucial things and not something overwhelmed inside the dumps. I am so excited to find it and used it for my training.

SUN Sun Certified Web Component

The sun licensed internet component Developer (SCWCD) exam | real Questions and Pass4sure dumps

J2EE Certifications

J2EE (Java 2 commerce edition) expertise, unveiled by using sun Microsystems in 1999, has been broadly permitted for its unmatched server aspect capabilities. Many providers fancy IBM and BEA methods believe near up with items for the J2EE platform. J2EE companies signify essentially ninety percent of the software server market.

With the evolution and increasing presence of J2EE applied sciences, J2EE certifications believe besides begun evolving and including incredible value to the careers of programmers, developers and architects. The domain of J2EE certifications has grown significantly, which is evident by using a growing to be variety of certification tests, increasing assist via blue chip agencies fancy sun, IBM, BEA and the expanding number of americans pursuing these certifications.

solar certified net component Developer is one of most everyday and advantageous certifications in the district of J2EE. this article will succor you hold note the aims, coaching requirements and supplies obtainable for this prestigious certification with the aid of solar Microsystems.

The sun licensed net allotment Developer (SCWCD) Certification examination exam historical past and its importance

Launched in August 2001 via solar Microsystems, the sun certified internet allotment Developer (SCWCD) Certification exam has occupied a spot of its own within the web accessories (particularly JSP and Servlets) developer neighborhood. a superior measure of server facet Java knowledge, this examination is fitting more and more Important for builders.

if you are looking to prove your competency in "Java internet add-ons", this is the examination for you. additionally, when you are a programmer working in core Java, taking this exam will supply a particular advancement for your profession.

examination information
  • necessities - solar licensed Java Programmer (SCJP). the first step in opposition t SCWCD is SCJP (sun certified Java Programmer), which is the pre-requisite for this exam. You need to believe a minute and thorough figuring out of issues involving the design, structure and implementation of quite a few Java web accessories.
  • targets - The SCWCD examination tests your abilities on quite a few facets of Java web components, specially JSPs, Servlets and JavaBeans. You deserve to believe an in depth and thorough understanding of considerations involving the design, structure and implementation of a lot of Java internet components. These are the targets of the examination precise by artery of solar Micorosystems:
  • The Servlet mannequin
  • The constitution and Deployment of up to date Servlet web purposes
  • The Servlet Container mannequin
  • Designing and developing Servlets to tackle Server-facet Exceptions
  • Designing and constructing Servlets the consume of Session management
  • Designing and setting up cozy net purposes
  • Designing and setting up Thread-safe Servlets
  • The Java Server Pages (JSP) expertise mannequin
  • Designing and developing Reusable net components
  • Designing and setting up JSP pages using JavaBean accessories
  • Designing and establishing JSP pages the consume of custom Tags
  • Designing and setting up a customized Tag Library
  • Design Patterns
  • For targeted suggestions check with the comprehensive examination pursuits for the SCWCD examination, via sun Microsystems.

  • class of Questions - fancy the SCJP exam, the classification of questions requested in the SCWCD examination are varied-option (with one or more suitable selections), fill in the blanks (often known as brief answer) and drag-n-drop (now and again requested). once again, just fancy the SCJP, if a assorted-alternative question has a pair of remedy choice, it's explicitly stated in the query.
  • Time - The time allowed to complete this examination is 90 minutes, which is enough. as soon as once more, just fancy the SCJP, you're allowed to evaluate the query(s) in case you believe some beyond regular time towards the end.
  • Passing % - You need to reap at the least sixty one% to be successful. The examination asks you 59 questions and besides you should appropriately acknowledge as a minimum 36.
  • constructive supplies
  • Books - Preparatory books are a valuable asset for any IT Certification training. here are some suggested books for the SCWCD exam:
  • necessities - it's highly suggested that pleasant time be spent going during the JSP 1.2 and Servlets 2.three necessities for this exam. you are going to find answers to many questions hidden in the specifications.
  • WebServer - "practice is PowerIf your goal is to rate an in-depth knowing of the objectives in addition to scoring lofty on the exam, it's Important so you might expend lots of time writing traces of code specializing in a variety of pursuits.

    however where effect I apply?Tomcat Apache edition four.0 is the most excellent platform to apply on. It adheres to the newest JSP 1.2 and Servlet 2.three necessities and it is absolutely free. which you can down load it birthright here: Tomcat 4.0

  • Tutorials and Articles - There are a great number of tutorials freely accessible on Java internet accessories. The superior and suggested of those are through sun. Following is a list of some particularly positive tutorials and articles for the SCWCD exam:
  • Notes - Many americans believe contributed by means of sharing their coaching suggestions and examination event within the sort of concise notes. Some of those helpful notes are listed below:
  • J2EE working towards - if you definitely are looking to gain potential in the J2EE domain, hold a witness at the unreasonable exceptional J2EE training provided by using The Middleware business.
  • Mock tests - after getting organized with the applicable books, browsed throughout the necessities, study the tutorials, articles and notes, there comes the deserve to supervene for the exam. What can be better than taking a mock examination? unlike the SCJP, for which there are loads of beneficial mock exams obtainable, there are only a handful of mock checks for the SCWCD exam:
  • examination Simulator - Is there whatever enhanced than a FREE mock exam?

    sure, a Certification check Simulator, which simulates the examination ambiance and provides you the greatest observe you could believe earlier than you look for the exam..

    SCWCD Certification examination Simulator from Whizlabs utility. Designed and developed by artery of particularly dedicated, experienced, and certified authorities, it ensures your success within the exam with its unreasonable fine Mock assessments, Interactive Quiz and brief Revision counsel on the latest sample of the SCWCD exam.

  • suggestions and hints
  • observe every concept through writing the vital code. it is even enhanced in case you conceptualize, improve, deploy and check an software, which makes consume of the concepts requested in the examination. A mock utility using HTML, JSP, and Servlets designed the consume of the patterns fancy MVC may still be of top notch succor in realizing essentially the most common ideas for this examination.
  • The time attainable for the examination is often enough. are trying no longer to rush and provides ample time to each and every question.
  • if you in fact need to acquire a worthy rating, get positive you expend some time remembering a considerable number of Deployment Descriptor points, together with the mum or dad-child relationships between them. be positive you besides know which of the aspects are mandatory.
  • Thread safeguard is considered to be some of the tangled areas for this examination. You believe to expend some useful time and believe thorough knowing of it.
  • youngsters now not mentioned within the exam targets, get positive to believe the primary understanding of here design patterns:
  • discussion forums and organizations

    Eventhough you believe entry to every the components listed above, you may additionally are looking to hear about the experiences of different individuals. There are areas for these too:


    considering that its introduction greater than two years ago, the Java 2 Platform, enterprise version (J2EE), has unexpectedly centered a brand new model for developing allotted purposes. these days it has reached a undeniable even of maturity on which many blue-chip agencies are relying for his or her complicated business-application-building wants. With this evolution of the J2EE platform, there has grown the need for trade-identified J2EE certifications. The SCWCD is considered one of such recognized J2EE certification assessments, which checks your competence in Java web add-ons. Being a sun licensed web allotment Developer, that you would be able to aid help your career expertise, gain more appreciate, and enlarge job security.

    i hope this article might be advantageous to you to your coaching for the SCWCD examination. I wish you beneficial success!!!

    about the author

    Pradeep Chopra is the Co-founding father of WHIZlabs application, an e-researching company focusing on IT Certification examination Simulators. A graduate from the Indian Institute of technology, Delhi, Pradeep has been consulting for IT certifications and authored a great number of IT certification exam simulators, articles in J2EE certifications area. You may additionally find birthright here J2EE Certification examination Simulators through Whizlabs of your activity:

    that you would be able to reach him at

    pattern Questions

    Let's look on the sort of questions asked during this examination.

    query 1 MyServlet import javax.servlet.*; import javax.servlet.http.*: import*; public classification MyServlet extends HttpServlet implements SingleThreadModel String myName; public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException response.setContentType("textual content/undeniable"); PrintWriter out = res.getWriter(); myName = req.getParameter("identify"); sayHello(out); out.shut(); public void sayHello(PrintWriter out) out.println("hey " + myName);

    select the pertinent one:

    a.) MyServlet is thread secure.

    b.) MyServlet isn't thread protected as a result of myName is an instance variable.

    c.) MyServlet isn't thread safe as a result of MyServlet implements SingleThreadModel.

    d.) not one of the above.

    relevant choice



    choice A is correct. An application is thread safe if it every the time behaves predictably regardless of the number of concurrent threads running in its technique area. The simplest artery to ensure that a servlet is thread safe is to implement the SingleThreadModel interface. through implementing this interface, the server guarantees that no multiple thread can execute the service(), doGet(), or doPost() formula at a time for a particular servlet instance. This makes the servlet thread safe. hence notwithstanding classification MyServlet has case variables, it's thread protected. for this judgement A is the pertinent selection and the different selections are unsuitable.

    query 2

    select the pertinent two:

    a.) company Delegate - Reduces the coupling between presentation-tier shoppers and company services.

    b.) facts access protest - makes it possible for for varied Views the consume of the equal model.

    c.) MVC - allows for more convenient migration to distinctive persistence storage implementations.

    d.) charge protest - Reduces community site visitors

    proper choices

    A and D


    choices A and D are relevant. In a common scenario, presentation-tier add-ons (e.g. a JSP) believe interaction directly with commerce capabilities. due to this fact, the presentation-tier add-ons are liable to alterations within the implementation of the company features: when the implementation of the commerce functions trade, the code in the presentation tier ought to alternate. The goal of the commerce Delegate protest design pattern is to reduce the coupling between presentation-tier customers and the enterprise provider API, for that judgement hiding the underlying implementation details of the provider. for that judgement option A is proper.

    choice B is wrong as it's the MVC design pattern instead of the DAO (facts entry Object), which offers diverse Views the usage of the equal mannequin.

    choice C is wrong as it's the DAO (records entry Object) sample, which makes it possible for easier migration to diverse persistence storage implementations.

    The charge protest is used to encapsulate the enterprise statistics. A single formulation appellation is used to send and retrieve the value Object. When the customer requests commerce statistics from an commerce bean, the commerce bean can construct the value Object, populate it with its attribute values, and travel it via charge to the customer. hence option D is besides relevant.

    Which of the following statements is birthright concerning ? Which of birthright here mixtures (Design pattern - Usefulness) concerning Design Patterns are correct?

    sun certified Java Programmer: career information & necessities | real Questions and Pass4sure dumps

    The solar certified Java Programmer (SCJP) is a professional concerning the fundamentals of the Java programming language, and certified SCJPs are trendy by means of a expansive sweep of companies engaged in application construction. The SCJP exam is additionally a prerequisite to higher-stage certifications in different Java-connected areas, such as web add-ons, company components, net functions and cellular applications.

    education learning Paths obtainable through sun, faculty programs besides available Job potential Programming languages, firm, math expertise, figuring out of abstract concepts Median earnings (2015)* $79,530 for laptop programmers$ninety eight,260 for software functions builders Job boom (2014-2024)* -eight% for computer programmers19% for software applications developers

    source: *U.S. Bureau of Labor records

    schooling guidance

    sun Microsystems presents several 'gaining knowledge of Paths' to certification, for college kids with minimal prior adventure or those celebrated with other programming languages. Many different associations, from technical faculties to universities, offer working towards in Java ideas, ideas and evolution techniques, and every of these lessons set together the scholar to be an exceptional Java programmer, and hold the sun certified Java Programmer examination. the 2-hour exam need to be taken at an authorized testing facility, and there are not any specific must haves.

    knowledge Required

    an organization knowing of computer systems, programming languages and advanced programming concepts would set you on the speedy song to a career as a solar licensed Java Programmer. college students with slight programming adventure but respectable math aptitude, organizational capabilities and an understanding of abstract concepts may still accept as real with taking a beginner's degree direction in computer concepts before the SCJP practicing. sun offers solar certified Java associate (SCJA) working towards for non-technical students, and other introductory computing device courseware is generally obtainable.

    profession and financial Outlook

    in response to the U.S. Bureau of Labor facts (BLS), the median annual salary in 2015 for applications software builders become $98,260. laptop programmers made a median annual income of $seventy nine,530 within the equal yr, but there became no inescapable records for solar-certified Java programmers. Jobs for computing device programmers will decline via 8% every the artery through 2014-2024, while application application developers will remark increases of 19% in keeping with the BLS. Programmers and application developers experienced in a broad sweep of applied sciences, peculiarly at present widespread ones fancy Java, may still continue to believe the premiere employment prospects.

    Alessandro Spirito profiles | real Questions and Pass4sure dumps

    No outcome discovered, are trying new key phrase!education solar licensed internet component developer for Java Platform, sun licensed Programmer for Java platform, ITIL V3 groundwork direction, Corso...

    While it is arduous errand to pick solid certification questions/answers assets regarding review, reputation and validity since individuals rate sham because of picking incorrectly benefit. ensure to serve its customers best to its assets as for exam dumps update and validity. The greater allotment of other's sham report objection customers near to us for the brain dumps and pass their exams cheerfully and effortlessly. They never bargain on their review, reputation and trait because killexams review, killexams reputation and killexams customer assurance is imperative to us. Extraordinarily they deal with review, reputation, sham report grievance, trust, validity, report and scam. On the off desultory that you remark any False report posted by their rivals with the appellation killexams sham report grievance web, sham report, scam, protestation or something fancy this, simply recall there are constantly terrible individuals harming reputation of beneficial administrations because of their advantages. There are a worthy many fulfilled clients that pass their exams utilizing brain dumps, killexams PDF questions, killexams questions, killexams exam simulator. Visit, their case questions and test brain dumps, their exam simulator and you will realize that is the best brain dumps site.

    Back to Braindumps Menu

    7497X VCE | CISSP free pdf | M2040-641 exercise questions | 1Z0-971 free pdf | 050-663 braindumps | 1D0-570 exercise questions | ASC-090 braindumps | 000-M605 test prep | MB5-857 braindumps | HP0-Y47 cram | JN0-332 pdf download | CD0-001 exam prep | 190-848 exercise test | ST0-030 free pdf | 090-554 study guide | 190-821 dump | 000-053 braindumps | 050-701 sample test | 1Z0-460 exercise exam | E20-393 test prep |

    Guarantee your prosperity with this 310-083 question bank
    We are informed that a basic issue in the IT commerce is that there is inaccessibility of noteworthy worth prep materials. Their exam arrangement material gives every one of you that you should hold an affirmation exam. Their SUN 310-083 Exam will give you exam question with affirmed answers that mirror the undoubted exam. They at are made arrangements to enable you to pass your 310-083 exam with lofty scores.

    SUN 310-083 exam has given another mien to the IT business. It is presently needed to certify beAs the stage that prompts a brighter future. It is not necessary that every provider in the market provides trait material and most importantly updates. Most of them are re-seller. They just sell and effect not backup with updates. They believe a special department that hold care of updates. Just rate their 310-083 and start studying. Click Discount Coupons and Promo Codes are as under; WC2017 : 60% Discount Coupon for every exams on website PROF17 : 10% Discount Coupon for Orders larger than $69 DEAL17 : 15% Discount Coupon for Orders larger than $99 SEPSPECIAL : 10% Special Discount Coupon for every Orders As, the will be a solid and trustworthy source of 310-083 exam questions with 100 percent pass guarantee, you believe got to hone questions for a minimum of one day at least to attain well in the test. Your real trip to success in 310-083 exam, extremely begins with test questions that's the glorious and examined wellspring of your centered on position. helps a colossal scope of competitors pass the tests and rate their accreditation. They believe a major wide assortment of productive surveys. Their dumps are strong, slight, updated and of genuinely attractive worthy to beat the requesting circumstances of any IT certifications. exam dumps are latest updated in prominently clobber artery on well known start and material is released from time to time. Latest dumps are open in testing centers with whom we're holding up their relationship to rate latest material. SUN Certification study aides are setup through IT masters. A worthy many people objection that an unnecessary scope of questions in this kind of sizable wide assortment of tutoring evaluations and exam asset, and they might be as of late wiped out to deal with the cost of any additional. Seeing specialists exercise session this far achieving version in the meantime as still certification that every one the becoming acquainted with is anchored after significant examinations and exam. Everything is to get reassurance for hopefuls on their street to certification.

    We believe Tested and Approved 310-083 Exams. offers the most particular and latest IT exam materials which relatively fuse every exam subjects. With the pilot of their 310-083 regard materials, you don't need to misuse your hazard on examining significant piece of reference books and genuinely need to consume 10-20 hours to pro their 310-083 real questions and answers. Whats more noteworthy, they outfit you with PDF Version and Software Version exam questions and answers. For Software Version materials, Its exhibited to display the applicants reenact the SUN 310-083 exam in an actual environment.

    We give free updates. Inside authenticity length, if 310-083 brain dumps which you believe gotten exceptional, they will iterate you with the pilot of email to down load most extreme latest variety of . On the off peril that you don't pass your SUN Sun Certified Web Component Developer for J2EE 5 exam, They will give you replete refund. You should send the verified propagation of your 310-083 exam archive card to us. Ensuing to declaring, they will startlingly outfit you with replete REFUND. Huge Discount Coupons and Promo Codes are as under;
    WC2017: 60% Discount Coupon for every exams on website
    PROF17: 10% Discount Coupon for Orders greater than $69
    DEAL17: 15% Discount Coupon for Orders greater than $99
    DECSPECIAL: 10% Special Discount Coupon for every Orders

    In the occasion which you prepare for the SUN 310-083 exam using their exam simulator engine. It is something anyway arduous to prevail for every certifications inside the main endeavor. You don't need to control every dumps or any free deluge/rapidshare every stuff. They offer free demo of each IT Certification Dumps. You can watch the interface, question worthy and usability of their tutoring exams sooner than you select to purchase.

    310-083 Practice Test | 310-083 examcollection | 310-083 VCE | 310-083 study guide | 310-083 practice exam | 310-083 cram

    Killexams 000-183 questions answers | Killexams 1Z0-493 bootcamp | Killexams PMI-200 brain dumps | Killexams C2010-576 dump | Killexams CA0-002 cram | Killexams 920-177 cheat sheets | Killexams HP2-B61 free pdf | Killexams ST0-237 exam questions | Killexams E20-090 test questions | Killexams 3M0-212 VCE | Killexams 000-919 exam prep | Killexams 000-443 study guide | Killexams ISEB-PM1 braindumps | Killexams HP2-H37 exercise questions | Killexams CAT-080 exercise questions | Killexams C4090-460 exercise test | Killexams 132-S-916.2 sample test | Killexams 920-255 exam prep | Killexams HQT-4210 braindumps | Killexams 000-731 free pdf | huge List of Exam Braindumps

    View Complete list of Brain dumps

    Killexams 500-005 free pdf download | Killexams 00M-530 bootcamp | Killexams MB4-219 test questions | Killexams 9L0-005 questions answers | Killexams A2010-654 VCE | Killexams HPE0-J75 real questions | Killexams C2080-474 braindumps | Killexams A2010-005 brain dumps | Killexams 210-250 study guide | Killexams COG-320 exam questions | Killexams 70-778 real questions | Killexams 000-582 dumps questions | Killexams 000-787 braindumps | Killexams ACSM-GEI exercise questions | Killexams 000-189 brain dumps | Killexams HP0-500 real questions | Killexams 1Z0-327 questions and answers | Killexams 6005-1 braindumps | Killexams 000-163 exercise test | Killexams 3V00290A cram |

    Sun Certified Web Component Developer for J2EE 5

    Pass 4 positive 310-083 dumps | 310-083 real questions |

    Certified J2EE Web Developer course | real questions and Pass4sure dumps

    On behalf i would fancy to thank my training teacher and every the classmates for the dynamic participation during or classes , and indeed would fancy to thank the siliconindia family in general, for facilitating the online training course system in more easier and understandable manner ,through video lecture and text Notes which makes it exotic to become a CCNA and get inequity in IT field , now the success i am leaving in is every because of siliconindia , so advice other student to associate this institute through which they can get there dream Job comes through Thanks to siliconindia

    Java Tip 138: still parsing to generate your JavaBeans' XML representation? | real questions and Pass4sure dumps

    The portability and extensibility of both Java and XML get them touchstone choices for the flexibility and wide availability requirements of Web applications and services. SAX (Simple API for XML), DOM (Document protest Model), XSL (Extensible Stylesheet Language), XSLT (XSL Transformations), SOAP (Simple protest Access Protocol), and BML (Bean Markup Language) are some of the buzzwords associated with XML. This tip brings together the benefits of Java and XML without forcing developers to understand every XML-related buzzwords.

    By using Remote artery Invocation (RMI) in distributed Java application development, no low-level socket or network communication code is involved. The code remains at a higher level, leveraging its consume of RMI classes. Similar gain comes with the consume of Enterprise JavaBeans (EJB) technology, freeing developers from several low-level coding aspects (transaction, recovery, and activation). With this tip's JavaBean-XML mapping component, developers don't directly deal with XML-related APIs.

    Note: You can download this tip's source code from Resources.

    Write the component

    The BeanXMLMapping component converts a JavaBean to an XML document and vice versa. By using JavaBean introspection, XML parsers, and DOM APIs, you can develop this component with a toXML() artery to represent the received bean as an XML document and a fromXML() artery to instantiate and populate the proper bean according to the XML document received.

    Listing 1 shows a possible implementation for the BeanXMLMapping component. This particular implementation uses the JOX (Java Objects in XML) library. You can develop other implementations of this component using other APIs. I selected JOX for its simple, reusable solution.

    Listing 1. BeanXMLMapping component

    import com.wutka.jox.*; import; import; import; public class BeanXMLMapping { /** * Retrieves a bean protest for the * received XML and matching bean class */ public static protest fromXML(String xml, Class className) { ByteArrayInputStream xmlData = new ByteArrayInputStream(xml.getBytes()); JOXBeanInputStream joxIn = new JOXBeanInputStream(xmlData); try { recrudesce (Object) joxIn.readObject(className); } snare (IOException exc) { exc.printStackTrace(); recrudesce null; } finally { try { xmlData.close(); joxIn.close(); } snare (Exception e) { e.printStackTrace(); } } } /** * Returns an XML document String for the received bean */ public static String toXML(Object bean) { ByteArrayOutputStream xmlData = new ByteArrayOutputStream(); JOXBeanOutputStream joxOut = new JOXBeanOutputStream(xmlData); try { joxOut.writeObject(beanName(bean), bean); recrudesce xmlData.toString(); } snare (IOException exc) { exc.printStackTrace(); recrudesce null; } finally { try { xmlData.close(); joxOut.close(); } snare (Exception e) { e.printStackTrace(); } } } /** * Find out the bean class name */ private static String beanName(Object bean) { String fullClassName = bean.getClass().getName(); String classNameTemp = fullClassName.substring( fullClassName.lastIndexOf(".") + 1, fullClassName.length() ); recrudesce classNameTemp.substring(0, 1) + classNameTemp.substring(1); } }

    The BeanXMLMapping class converts a JavaBean to and from an XML document and provides two methods:

  • toXML(): generates the respective XML document String for the bean instance
  • fromXML(): creates a bean instance for the XML document String
  • Use the component

    Listing 2 shows AccountHistoryContext, a bean class empowered with toXML() and fromXML() capabilities. The JavaBean class simply delegates its toXML() and fromXML() methods to the BeanXMLMapping component.

    Listing 2. AccountHistoryContext bean

    public class AccountHistoryContext{ private String dateFrom; public String getDateFrom() { recrudesce dateFrom; } public void setDateFrom(String s) { dateFrom = s; } ... // Other attributes with their rate and set methods public String toXML() { recrudesce BeanXMLMapping.toXML(this); } public static AccountHistoryContext fromXML (String xml) { recrudesce (AccountHistoryContext) BeanXMLMapping.fromXML ( xml, AccountHistoryContext.class); } }

    Figure 1 represents the mapping between a generic JavaBean class and its respective generic XML document.

    Figure 1. JavaBean-XML document mapping. Click on thumbnail to view full-size image. JavaBean to XML

    The XML document's first line is the XML declaration, which defines the document's XML version. In this case, the document conforms to XML Specification 1.0 (<?xml version="1.0" encoding="ISO-8859-1"?>).

    The next line defines the document's first component (the root element). This is the JavaBean appellation (<Bean>).

    The next lines define the root's (JavaBean's) child elements. These are the bean attributes available through rate methods. If the attribute is a basic character (e.g., String, int), a node with the attribute appellation is generated. If a bean has a rate artery for a nested bean, nested child elements are generated.

    Figure 2 shows a ContactInfo bean object, its class, and the XML document generated by the toXML() artery invocation.

    Figure 2. toXML() artery invocation XML to JavaBean

    When reading the XML document, a mapping between the root node name, attributes, and nested nodes will be made for the bean, set methods, and nested beans, respectively. bare constructors for each bean and set methods for each attribute (basic character or nested bean) must be provided to accomplish the proper mapping.

    Figure 3 shows a ContactInfo XML document, a matching ContactInfo bean class, and the bean protest resulting from the fromXML() artery invocation.

    Figure 3. fromXML() artery invocation Usage example

    Let's examine an case of BeanXMLMapping usage. The sample consists of XML, JavaBean classes, and snapshots of an online banking application. You can download the case source code from Resources.

    Figure 4 is a sample account history page in an online banking application.

    Figure 4. Sample account history page

    Figure 5 displays the AccountHistory bean class diagram, while Listing 3 shows an XML document generated through its toXML() artery invocation.

    Figure 5. AccountHistory bean class diagram. Click on thumbnail to view full-size image.

    Listing 3. Account history XML representation

    <?xml version="1.0" encoding="ISO-8859-1"?> <AccountHistory> <transactionList> <transaction> <deposit></deposit> <withdraw>-,150.00 </withdraw> <date>3/10/2002 </date> <description>Check Number: 213 </description> <balance>,340.50</balance> </transaction> <transaction> <deposit></deposit> <withdraw>-51.50</withdraw> <date>3/7/2002</date> <description>ATM Withdrawal 350 SAN JOSE CA</description> <balance>,189.00</balance> </transaction> <transaction> <deposit>,060.40 </deposit> <withdraw></withdraw> <date>3/5/2002</date> <description>ACH DEPOSIT - MyCompany </description> <balance>,249.40</balance> </transaction> <transaction> <deposit></deposit> <withdraw>-0.00</withdraw> <date>2/26/2002</date> <description>JC'S BBQ AND DELI SAN JOSE CA </description> <balance>,229.40</balance> </transaction> </transactionList> <accountHistoryContext> <account> <holder>Paulo Caroli</holder> <type>checkings</type> <number>316614-10</number> </account> <dateTo>Monday, March 11, 2002 </dateTo> <dateFrom>Monday, February 25, 2002 </dateFrom> </accountHistoryContext> </AccountHistory>

    Figure 6's sequence diagram shows a possible scenario where an AccountHistory bean protest is reached and its toXML() artery invoked.

    Figure 6. Simplified sequence diagram for getting AccountHistory XML document. Click on thumbnail to view full-size image.

    Figure 7 is a sample page for requesting account history in an online banking application. The bank account and dates are retrieved and displayed on this page; Listing 4 shows how such information can be represented as XML.

    Figure 7. Sample page for requesting account history in an online banking application

    Listing 4. Account history context XML representation

    <?xml version="1.0" encoding="ISO-8859-1"?> <AccountHistoryContext> <account> <holder>Paulo Caroli</holder> <type>checkings</type> <number>316614-10</number> </account> <dateTo>Monday, March 11, 2002 </dateTo> <dateFrom>Monday, February 25, 2002 </dateFrom> </AccountHistoryContext>

    AccountHistoryContext.FromXML() is invoked to retrieve the AccountHistoryContext bean protest for the respective XML document.

    Keep it simple!

    Fortunately, it is this simple. Conversion from JavaBean to XML and vice versa happens smoothly, without requiring much from the JavaBean code. Developers can capitalize from the consume of the BeanXMLMapping component and code at a lofty even without dealing with any XML-specific library.

    There's no need for complexity to accomplish JavaBean-XML mapping. hold handicap of the BeanXMLMapping component and Enjoy your XML-empowered beans.

    Paulo Caroli is a project manager at Omni Pros. Paulo has a master's degree in software engineering and is a Sun Certified Architect for Java Technology with more than nine years of experience in application development. He is an expert in object-oriented techniques who specializes in Java 2 Platform, Enterprise Edition (J2EE) Web application development. Learn more about this topic
  • Download the source code for this tip
  • JOX (Java Objects in XML)
  • JOX download
  • DTDParser download
  • Xerces-J download
  • The World Wide Web Consortium's XML resource page
  • "XML and JavaThe flawless PairPart 1," Ken Sall (, November 1998)
  • The Unified Modeling Language User Guide, Grady Booch, Ivar Jacobson, James Rumbaugh, Jim Rumbaugh (Addison-Wesley, 1998; ISBN0201571684)
  • "XML for the Absolute Beginner," mark Johnson (JavaWorld, April 1999)
  • Complete listing of mark Johnson's archived JavaBeans columns in JavaWorld
  • See the JavaBeans section of JavaWorld's Topical Index
  • Find more XML-related articles in the Java and XML section of JavaWorld's Topical Index
  • For more insightful Java tips, visit JavaWorld's Java Tips index page
  • See the Java mp;A index page for the replete mp;A catalog
  • Get more of your questions answered in their Java Beginner discussion
  • Sign up for JavaWorld's free weekly email newsletters

  • Using The Digester Component | real questions and Pass4sure dumps

    The emergence of Extensible Markup Language (XML) has led to a complete transformation of the application evolution world. every evolution seems to revolve around XML these days. In fact, it is difficult to find any new evolution that does not directly or indirectly reckon on XML. For instance, Web services are unimaginable without XML, and with the usage of Web services projected to boom over the next few years, there is no escaping XML. In this article, you will witness at the Jakarta Commons Digester component and how it can get working with XML a simple task.

    Table 7-1 shows the component details.

    Table 7-1. Component Details

    Name Version Package Digester 1.5 org.apache.commons.digester

    One problem that has plagued XML evolution is the complexity of parsing and using XML. Everybody knows the advantages of using XML, but I doubt many people are able to write a piece of code that parses an XML file and picks up the value of a inescapable XML tag. Writing a piece of Java code to parse a piece of XML directly using the two core Application Programming Interfaces (APIs)—the Document protest Model (DOM) and Simple API for XML (SAX)—is anything but simple. APIs such as JDOM are relatively simple, but considering how often you believe to encounter and tackle XML, Digester provides an easier option. You can be parsing and using XML in your Java code in less than the time it will hold you to read this article. (No, I will not eat my hat if you effect not manage to accomplish the task.)

    To quickly rate up and running with Digester, you will remark an case first. effect not worry about the syntax because you will witness at that in detail later in this article. The scenario for this case is that you are presented with an XML file containing the details of every the students attending the various courses at your training institute. What you are expected to effect is to pick up every the details present in the XML file, and for each student detail, populate an instance of a class Student, which you create. You will then store every the Student instances created in an instance of the java.util.Vector class for further processing.

    You first need to create a Student class that will hold the details of a student (see Listing 7-1).

    Listing 7-1. Student Class

    package com.commonsbook.chap7; public class Student { private String name; private String course; public Student() { } public String getName() { recrudesce name; } public void setName(String newName) { appellation = newName; } public String getCourse() { recrudesce course; } public void setCourse(String newCourse) { course = newCourse; } public String toString() { return("Name=" + " & Course=" + this.course); } }

    Apart from the overridden toString method, there is nothing special about this class. It has just two properties with getter and setter methods for each. You want to create instances of this class based on the data you retrieve from an XML file.

    Listing 7-2 shows the XML file contents. The number of student tags is not relevant; you could very well interpose more students if you like.

    Listing 7-2. students.xml

    <?xml version="1.0"?> <students> <student> <name>Java Boy</name> <course>JSP</course> </student> <student> <name>Java Girl</name> <course>EJB</course> </student> </students>

    NOTE In Listings 7-1 and 7-2 you can remark that the names of the tags and properties match exactly. So, for a tag course, you believe a property named course in the Student class. However, you can believe different tag names and property names. No mapping of the XML and the Java class is required; you could very well store the value of a tag ABC into a property XYZ. The matching names merely hold things simple.

    The Java class DigestStudents, shown in Listing 7-3, will pick up the contents of the various XML tags and create a Vector class instance that can hold many instances of the class Student.

    Listing 7-3. DigestStudents

    package com.commonsbook.chap7; import java.util.Vector; import org.apache.commons.digester.Digester; public class DigestStudents { Vector students; public DigestStudents() { students= new Vector(); } public static void main(String[] args) { DigestStudents digestStudents = new DigestStudents(); digestStudents.digest(); } private void digest() { try { Digester digester = new Digester(); //Push the current protest onto the stack digester.push(this); //Creates a new instance of the Student class digester.addObjectCreate( "students/student", Student.class ); //Uses setName artery of the Student instance //Uses tag appellation as the property name digester.addBeanPropertySetter( "students/student/name"); //Uses setCourse artery of the Student instance //Explicitly specify property appellation as 'course' digester.addBeanPropertySetter( "students/student/course", "course" ); //Move to next student digester.addSetNext( "students/student", "addStudent" ); DigestStudents ds = (DigestStudents) digester.parse(this.getClass() .getClassLoader() .getResourceAsStream("students.xml")); //Print the contents of the Vector System.out.println("Students Vector "+ds.students); } snare (Exception ex) { ex.printStackTrace(); } } public void addStudent( Student stud ) { //Add a new Student instance to the Vector students.add( stud ); } }

    In very few lines of code you believe managed to create the Vector of Student instances. The output of the program is as follows, displaying the tag values in the file students.xml:

    Students Vector [Name=Java Boy Course=JSP, Name=Java Girl Course=EJB]

    Pretty cool, eh? I would believe loved to write the corresponding DOM and SAX code to compare and illustrate the handicap of using the Digester component, but writing DOM and SAX code is something I forgot a long time ago and am not very keen on learning again. So you will just continue with the Digester experiments. Specifically, you will next witness at some Digester fundamentals and learn how the case in Listing 7-3 works.

    Understanding Digester Concepts

    The Digester component has its origins in the Struts framework project. It began its life as a instrument to quickly parse the struts-config.xml file without having to directly interact with SAX. Because the Digester functionality can be useful to every kinds of applications, it later moved to the Commons project.

    The Digester is not an XML parser but just a high-level interface that uses SAX underneath to accomplish the actual XML parsing. So a requirement for Digester is the presence of an XML parser conforming to Java API for XML Processing (JAXP) version 1.1 or later. The Digester besides depends on the following Commons components:

  • The BeanUtils component
  • * The Collections component
  • * The Logging component
  • Because Digester uses SAX to effect the parsing, XML processing with Digester happens in an event-driven manner. An event-driven manner is when events are triggered while the document is being parsed; what you need to effect is provide handlers for these events. That is the artery SAX works. SAX is every about events being fired when a inescapable event is found. SAX events are fired on occurrences such as starting tags, ending tags, and so on. DOM works a slight differently: protest models are created in reminiscence and parsed. However, when using the Digester, you effect not need to understand how SAX or DOM works, and you effect not need to effect any SAX-specific tasks in your code. Just stick to Digester’s rules, and you should soon be parsing XML documents with ease.

    Digester uses a stack to store or retrieve objects as the XML file is being parsed. If you are not close with what a stack is, just contemplate of it as a box in which you hold putting items and can remove them only on the basis of eventual In First Out (LIFO). Java provides a stack implementation with java.util.Stack.

    Based on the rules defined and the XML encountered, the Digester component pushes objects on the stack. Upon encountering the start of a tag, the associated protest is pushed onto the stack, and it is popped only after every the nested contents of that tag are processed. So, in Listing 7-3 upon the student tag being encountered, an instance of Student class will be pushed onto the stack and will be popped once the processing of its child tags appellation and course is complete.

    Using Matching Patterns

    The expansive handicap of using the Digester component instead of other APIs is the presence of component matching patterns. Unlike other APIs where you believe to worry about parent/child relationships among tags, what is Important with Digester is the matching pattern specified. For example, in Listing 7-3, you used the matching patterns students/student, students/student/name, and students/student/course. This is an easy and developer-friendly usage to precisely convey the tag to which you want to refer. If you believe to map the tags in Listing 7-2 to the corresponding matching pattern, the mapping will be as shown in Table 7-2.

    Table 7-2. Tag Pattern Mapping

    Tag Pattern <students> students <students> students/students <name> students/students/name <course> students/students/course

    You can besides consume the wildcard * if you want to believe a more generalized matching. So the pattern */name would believe matched every appellation tags within the document.

    Using Rules

    With component matching patterns you convey the exact location of the tag in the XML structure. However, to iterate the Digester component what needs to be done upon finding that tag, you need to define processing rules. These rules fire when the matching pattern is found. every rules are expected to extend the abstract class org.apache.commons.digester.Rule and define specific actions that need to be taken when a inescapable component occurs.

    You can define your own rules to handle application-specific cases. The Digester component comes with a set of rule implementations that extend the Rule class; you can find them in the package org.apache.commons.digester. As you travel along, you will remark some of these rules in the examples. In Listing 7-3 you used ObjectCreateRule to create an instance of the Student class, and you used BeanPropertySetterRule to set the properties of the class.

    Before getting into a more tangled XML case than the one you saw in Listing 7-2, you will witness at the steps you need to achieve for Digester to successfully retrieve data from XML:

  • You need to create a new instance of org.apache.commons.digester.Digester and configure it using the various setXxx methods provided by the class. Among other properties, you can define whether the XML should be validated, define the logger to be used, and define the Rules implementation object.
  • You push any initial objects on the protest stack using the Digester’s push artery before you define the patterns and the rules to be used. In Listing 7-3, you pushed the current protest on the stack using the keyword this. The judgement you need to push this initial protest is because Digester keeps pushing and popping objects from the stack as it encounters tags. So the first protest is created and pushed onto the stack upon encountering the first tag, and this protest is popped off the stack when the eventual tag is processed. Because you need to hold a reference to the protest for the first tag, the initial protest you push before you parse the XML serves the purpose and retains a reference to that object.
  • Register component matching patterns and the rules you want to be fired for each case. In Listing 7-3 you register three patterns and two rules that you want to be fired.
  • Finally, you parse the XML file using the parse artery of the Digester instance you created.

    NOTE The order in which you effect things is Important for Digester. You cannot randomly travel around statements before the convene to the parse method. For example, in Listing 7-3, you cannot travel the convene to addObjectCreate to after the convene to addSetNext.

  • You will now witness at a more tangled XML case and try to process it using Digester. You will besides remark how you can travel the specifying of Digester patterns and rules from code to a configuration XML file.

    Following XML Rules

    In Listing 7-3, most of the code is dedicated to configuring the Digester instance. Hardly any of the code can be termed as action-oriented code. The most common usage of Digester is to process XML-based configuration files. The judgement why these configuration files are used is to hold code free of configuration information and get changes possible without having to change the code and recompile it. It would be unfair if you placed Digester configuration information within Java code. Even this bit has to travel to a configuration XML file.

    The package org.apache.commons.digester.xmlrules deals with this issue, and the DigesterLoader class that is present in this package makes it possible to create a Digester instance using just the information in an XML file.

    In the following example, you will first witness at Java code that will accomplish the stint along not much similar lines as the case in Listing 7-3 and then travel to an XML-based configuration file for the very example.

    Listing 7-4 shows the XML file from which you want to fetch information. The XML stores information about an academy, its students, and its teachers. The Digester code picks up these details and makes them manageable within Java code

    Listing 7-4. academy.xml

    <?xml version="1.0"?> <academy name="JAcademy" > <student name="JavaBoy" division="A"> <course> <id>C1</id> <name>JSP</name> </course> <course> <id>C2</id> <name>Servlets</name> </course> </student> <student name="JavaGirl" division="B"> <course> <id>C3</id> <name>EJB</name> </course> </student> <teacher name="JavaGuru"> <certification>SCJP</certification> <certification>SCWCD</certification> </teacher> <teacher name="JavaMaster"> <certification>OCP</certification> <certification>SCJP</certification> <certification>SCEA</certification> </teacher> </academy>

    NOTE With Listing 7-4 I believe tried to address the many scenarios you might encounter when parsing XML files. Using this code from this case can rate you started in no time.

    Because you believe to hold the XML data in Java objects, you need to resolve which classes you believe to create. Instances of these classes will hold the data for you. Looking at this example, you should remark four classes that together can effect a beneficial job of holding the data in a properly structured format. These classes are Academy, Student, Course, and Teacher. You could very well create more classes, such as Certification. The most Important thing is that you cannot believe these as just divorce classes; you besides need to maintain the relationships among them as depicted in the XML file. So, you will first set down the Java classes. Instances of the Java classes will hold the data for you.

    An instance of the Course class is meant to store just the appellation and the ID of the course. The Course instance will not be maintaining its relation to the Student; this will be done by the Student instance. Listing 7-5 shows the Course class; it has two properties and the corresponding rate and set methods. Note that the package appellation for classes used in this case is

    Listing 7-5. Course Class

    package; import org.apache.commons.beanutils.PropertyUtils; import java.util.Vector; public class Course { private String id; private String name; public Course() { } public String getId() { recrudesce id; } public void setId(String newId) { id = newId; } public String getName() { recrudesce name; } public void setName(String newName) { appellation = newName; } public String toString() { StringBuffer buf = new StringBuffer(60); buf.append("ntCourseId>>> " + this.getId() + "t"); buf.append("CourseName>>> " + this.getName()); recrudesce buf.toString(); } }

    Next you will define the Student class that not only has to hold information about the student but besides about the courses the student attends. As shown in Listing 7-6, the student details are stored using properties, and the courses will be stored as a Vector of Course instances.

    Listing 7-6. Student Class

    package; import java.util.Vector; public class Student { private Vector courses; private String name; private String division; public Student() { courses = new Vector(); } public void addCourse(Course course) { courses.addElement(course); } public String getName() { recrudesce name; } public void setName(String newName) { appellation = newName; } public String getDivision() { recrudesce division; } public void setDivision(String newDivision) { division = newDivision; } public void setCourses(Vector courses) { = courses; } public Vector getCourses() { recrudesce courses; } public String toString() { StringBuffer buf = new StringBuffer(60); buf.append("nStudent name>> " + this.getName()); Vector courses = this.getCourses(); //Iterate through vector. Append content to StringBuffer. for (int i = 0; i < courses.size(); i++) { buf.append(courses.get(i)); } recrudesce buf.toString(); } }

    Listing 7-4 shows that, for a teacher, you are expected to store the appellation and the list of certifications held by the teacher. The Teacher class, shown in Listing 7-7, does this by using a String property for the appellation and a Vector holding String instances for the certifications list.

    Listing 7-7. Teacher Class

    package; import org.apache.commons.beanutils.PropertyUtils; import java.util.Vector; public class Teacher { private String name; private Vector certifications; public Teacher() { certifications = new Vector(); } public void addCertification(String certification) { certifications.addElement(certification); } public String getName() { recrudesce name; } public void setName(String newName) { appellation = newName; } public void setCertifications(Vector certifications) { this.certifications = certifications; } public Vector getCertifications() { recrudesce certifications; } public String toString() { StringBuffer buf = new StringBuffer(60); buf.append("nTeacher name>> " + this.getName()); Vector certs = this.getCertifications(); //Iterate through vector. Append content to StringBuffer. for (int i = 0; i < certs.size(); i++) { buf.append("ntCertification>> " + certs.get(i)); } recrudesce buf.toString(); } }

    The academy tag is the root tag shown in Listing 7-4. So the Academy class not only has to store the appellation of the academy but besides references to the data held by the child tags of the academy tag. Therefore, the Academy class, shown in Listing 7-8, has two Vectors, one that will store instances of Student classes and another that will store instances of Teacher classes. So directly or indirectly you should be able to access every the data depicted in Listing 7-4 using a reference to a properly populated Academy class instance. The overridden toString artery will be used later in the article to print the data held by an Academy instance.

    Listing 7-8. Academy Class

    package; import org.apache.commons.beanutils.PropertyUtils; import java.util.Vector; public class Academy { private Vector students; private Vector teachers; private String name; public Academy() { students = new Vector(); teachers = new Vector(); } public void addStudent(Student student) { students.addElement(student); } public void addTeacher(Teacher teacher) { teachers.addElement(teacher); } public Vector getStudents() { recrudesce students; } public void setStudents(Vector newStudents) { students = newStudents; } public Vector getTeachers() { recrudesce teachers; } public void setTeachers(Vector newTeachers) { teachers = newTeachers; } public String getName() { recrudesce name; } public void setName(String newName) { appellation = newName; } public String toString() { StringBuffer buf = new StringBuffer(60); buf.append("Academy name>> " + this.getName()); Vector stud = this.getStudents(); Vector teach = this.getTeachers(); buf.append("nn**STUDENTS**"); //Iterate through vectors. Append content to StringBuffer. for (int i = 0; i < stud.size(); i++) { buf.append(stud.get(i)); } buf.append("nn**TEACHERS**"); for (int i = 0; i < teach.size(); i++) { buf.append(teach.get(i)); } recrudesce buf.toString(); } }

    Now that you are done with the classes that will store the data for you, you will travel to the Digester code that will actually parse the XML. You will first remark how you specify Digester instructions within the Java code. Next you will travel out these instructions to an easily configurable XML file, making your Java code short and simple. Listing 7-9 shows the Java code to specify Digester rules and parse the XML accordingly. The thing to note in this piece of code is the usage of the following rules:

  • ObjectCreate: This rule creates a new instance of the classes Academy, Student, Teacher, and Course on a matching pattern being found.
  • SetProperties: The SetProperties rule sets the properties of the class using the attribute values. Because the appellation of the attribute and the property in the class matches exactly, you did not specify those details; however, if the attribute names in XML and property names in Java differ, you believe to specify that mapping.
  • BeanPropertySetter: This rule sets the properties of the bean using the values of the child tags. For example, the id and appellation properties of the instance of the class Course are set using this rule.
  • SetNext: The SetNext rule moves to the next course, student, and teacher tags. You believe besides specified the artery to convene in each case.
  • CallMethod: The CallMethod rule specifies the artery to be called upon a inescapable pattern being found. You besides specify the number of parameters that this artery expects.
  • CallParam: The CallParam rule specifies the parameter value to be passed to the artery convene defined using the CallMethod rule.
  • Listing 7-9. DigestJavaAcademy Class (Digester Rules Defined in Java Code)

    package; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.digester.Digester; import java.util.Vector; public class DigestJavaAcademy { public static void main(String[] args) throws Exception { DigestJavaAcademy d = new DigestJavaAcademy(); d.digest(); } public void digest() throws Exception { Digester digester = new Digester(); digester.addObjectCreate("academy", Academy.class); //Set the attribute values as properties digester.addSetProperties("academy"); //A new Student instance for the student tag digester.addObjectCreate("academy/student", Student.class); //Set the attribute values as properties digester.addSetProperties("academy/student"); //A new Course instance digester.addObjectCreate("academy/student/course", Course.class); //Set properties of the Course instance with values of two child tags digester.addBeanPropertySetter("academy/student/course/id", "id"); digester.addBeanPropertySetter("academy/student/course/name", "name"); //Next Course digester.addSetNext("academy/student/course", "addCourse"); //Next student digester.addSetNext("academy/student", "addStudent"); //A new instance of Teacher digester.addObjectCreate("academy/teacher", Teacher.class); ///Set teacher appellation with attribute value digester.addSetProperties("academy/teacher"); //Call artery addCertification that takes a single parameter digester.addCallMethod("academy/teacher/certification", "addCertification", 1); //Set value of the parameter for the addCertification method digester.addCallParam("academy/teacher/certification", 0); //Next Teacher digester.addSetNext("academy/teacher", "addTeacher"); //Parse the XML file to rate an Academy instance Academy a = (Academy) digester.parse(this.getClass().getClassLoader() .getResourceAsStream("academy.xml")); System.out.println(a); } }

    The order in which you define rules is important. You believe just represented what was obvious to you in the XML in a figure that Digester can understand.

    To execute this piece of code, you need to believe the academy.xml file present in the CLASSPATH. Listing 7-10 shows the output upon executing this piece of code.

    Listing 7-10. Output Upon Executing the Code in Listing 7-9

    Academy name>> JAcademy **STUDENTS** Student name>> JavaBoy CourseId>>> C1 CourseName>>> JSP CourseId>>> C2 CourseName>>> Servlets Student name>> JavaGirl CourseId>>> C3 CourseName>>> EJB **TEACHERS** Teacher name>> JavaGuru Certification>> SCJP Certification>> SCWCD Teacher name>> JavaMaster Certification>> OCP Certification>> SCJP Certification>> SCEA

    Looking at Listing 7-9, it is obvious that almost every the code is dedicated to configuring the Digester. Did they not teach us in school that wherever possible travel every configurable items to a file that can be easily managed and manipulated? So why not effect that in this case?

    The org.apache.commons.digester.xmlrules package provides for an XML-based definition of Digester rules. Defining Digester rules in XML is quite simple once you rate the hang of the various rules and what they effect for you. Considering the more widespread nature of XML, your Digester rules are now more easily understandable to a wide variety of people involved. Even your manager might understand a thing or two!

    Listing 7-11 shows the rules you defined using Java in Listing 7-9 but using XML instead.

    Listing 7-11. academyRules.xml Digester Rules Defined in XML

    <?xml version="1.0"?> <digester-rules> <pattern value="academy"> <object-create-rule classname="" /> <set-properties-rule /> <pattern value="student"> <object-create-rule classname="" /> <set-properties-rule /> <pattern value="course"> <object-create-rule classname="" /> <bean-property-setter-rule pattern="id"/> <bean-property-setter-rule pattern="name"/> <set-next-rule methodname="addCourse" /> </pattern> <set-next-rule methodname="addStudent" /> </pattern> <pattern value="teacher"> <object-create-rule classname="" /> <set-properties-rule /> <call-method-rule pattern="certification" methodname="addCertification" paramcount="1" /> <call-param-rule pattern="certification" paramnumber="0"/> <set-next-rule methodname="addTeacher" /> </pattern> </pattern> </digester-rules>

    In the XML in Listing 7-11, the rules defined in XML almost directly map to the methods defined in the Java in Listing 7-9. every the rules now are defined using tags of that name. The easiest artery to check the usage of these tags is to open the digester-rules.dtd file. You can easily find this file in the source download of the Digester component. However, even with the binary download, this file can be extracted out of commons-digester.jar file and is present in the org.apache.commons.digester.xmlrules package. You can besides witness at the file and Digester code using ViewCVS at

    Document character Definition (DTD) files define the syntax and structure of XML files, and although they hold some getting used to, understanding them is not difficult.

    Once you are done defining the rules in XML, the Java bit left is simple. Listing 7-12 shows the Java code where you just define the rules file to be used to create a Digester instance and then parse the XML file using that Digester instance.

    Listing 7-12. DigestXMLJavaAcademy Class (Java Code Using Rules Defined in XML)

    package; import; import java.util.Vector; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.digester.Digester; import org.apache.commons.digester.xmlrules.DigesterLoader; public class DigestXMLJavaAcademy { public static void main( String[] args ) { DigestXMLJavaAcademy xmlDigest= new DigestXMLJavaAcademy(); xmlDigest.digest(); } public void digest(){ try { //Create Digester using rules defined in academyRules.xml Digester digester = DigesterLoader.createDigester( this.getClass().getClassLoader().getResource("academyRules.xml")); //Parse academy.xml using the Digester to rate an instance of Academy Academy a = (Academy)digester.parse( this.getClass().getClassLoader().getResourceAsStream("academy.xml")); Vector vStud=a.getStudents(); Vector vTeach=a.getTeachers(); for (int i = 0; i < vStud.size(); i++) { System.out.println("Student>> "+PropertyUtils.describe(vStud.get(i))); } for (int i = 0; i < vTeach.size(); i++) { System.out.println("Teacher>> "+ PropertyUtils.describe(vTeach.get(i))); } } catch( Exception e ) { e.printStackTrace(); } } }

    The two files academy.xml and academyRules.xml believe to be present in the CLASSPATH, and upon execution of the code, you rate the very output as shown in Listing 7-10 that you got using the Java code in Listing 7-9.

    Introducing Other Digester Features

    Apart from these Digester features, I will mention some other features of Digester:

  • The Logging capability of Digester can be useful while troubleshooting. Digester uses the Commons Logging component and the Digester class even provides a setLogger artery with which you can define the exact logger to be used.
  • The org.apache.commons.digester.rss package provides an case usage of Digester to parse XML in the affluent Site Summary (RSS) format, which is widely used by tidings sites to provide tidings feeds. Most of the celebrated content providers advocate RSS, and you can find more information about RSS at
  • You can configure Digester to validate XML using a DTD file. You should register the DTD using the register method, and you can switch on validation using the setValidating artery of the Digester class.
  • You can configure Digester to match patterns based on namespaces. You consume the methods setNamespaceAware and setRuleNamespaceURI so that the Digester does not discombobulate a appellation tag in a namespace X with a similar appellation tag in a namespace Y.
  • Summary

    In this article, you looked at the Digester component, which drastically cuts down on the complexity involved in parsing XML. You saw how Digester works on the simple concept of component matching patterns and how you can define rules in Java code as well as in a divorce XML file. You besides saw some examples that reflected common XML parsing requirements.

    Using Digester and defining the rules in a divorce XML file gets a expansive thumbs-up from me. I highly recommend Digester for every your XML parsing requirements.

    About the Author

    Harshad wrote the books Pro Jakarta Commons (Apress, 2004), Oracle JDeveloper 10g: Empowering J2EE evolution (Apress, 2004) and besides coauthored Java 2 Enterprise Edition 1.4 Bible (Wiley & Sons, 2003).

    Harshad Oak has a master's degree in computer management and is a Sun Certified Java Programmer and a Sun Certified Web Component Developer. He is the founder of Rightrix Solutions ( that is primarily involved in software evolution and content management services. Harshad has earlier been allotment of several J2EE projects at i-flex Solutions and Cognizant Technology Solutions.

    Furthermore, he has written several articles about Java/J2EE for CNET ( He is besides a guest lecturer on Java and J2EE. He can be reached at

    Direct Download of over 5500 Certification Exams

    3COM [8 Certification Exam(s) ]
    AccessData [1 Certification Exam(s) ]
    ACFE [1 Certification Exam(s) ]
    ACI [3 Certification Exam(s) ]
    Acme-Packet [1 Certification Exam(s) ]
    ACSM [4 Certification Exam(s) ]
    ACT [1 Certification Exam(s) ]
    Admission-Tests [13 Certification Exam(s) ]
    ADOBE [93 Certification Exam(s) ]
    AFP [1 Certification Exam(s) ]
    AICPA [2 Certification Exam(s) ]
    AIIM [1 Certification Exam(s) ]
    Alcatel-Lucent [13 Certification Exam(s) ]
    Alfresco [1 Certification Exam(s) ]
    Altiris [3 Certification Exam(s) ]
    Amazon [2 Certification Exam(s) ]
    American-College [2 Certification Exam(s) ]
    Android [4 Certification Exam(s) ]
    APA [1 Certification Exam(s) ]
    APC [2 Certification Exam(s) ]
    APICS [2 Certification Exam(s) ]
    Apple [69 Certification Exam(s) ]
    AppSense [1 Certification Exam(s) ]
    APTUSC [1 Certification Exam(s) ]
    Arizona-Education [1 Certification Exam(s) ]
    ARM [1 Certification Exam(s) ]
    Aruba [6 Certification Exam(s) ]
    ASIS [2 Certification Exam(s) ]
    ASQ [3 Certification Exam(s) ]
    ASTQB [8 Certification Exam(s) ]
    Autodesk [2 Certification Exam(s) ]
    Avaya [101 Certification Exam(s) ]
    AXELOS [1 Certification Exam(s) ]
    Axis [1 Certification Exam(s) ]
    Banking [1 Certification Exam(s) ]
    BEA [5 Certification Exam(s) ]
    BICSI [2 Certification Exam(s) ]
    BlackBerry [17 Certification Exam(s) ]
    BlueCoat [2 Certification Exam(s) ]
    Brocade [4 Certification Exam(s) ]
    Business-Objects [11 Certification Exam(s) ]
    Business-Tests [4 Certification Exam(s) ]
    CA-Technologies [21 Certification Exam(s) ]
    Certification-Board [10 Certification Exam(s) ]
    Certiport [3 Certification Exam(s) ]
    CheckPoint [43 Certification Exam(s) ]
    CIDQ [1 Certification Exam(s) ]
    CIPS [4 Certification Exam(s) ]
    Cisco [318 Certification Exam(s) ]
    Citrix [48 Certification Exam(s) ]
    CIW [18 Certification Exam(s) ]
    Cloudera [10 Certification Exam(s) ]
    Cognos [19 Certification Exam(s) ]
    College-Board [2 Certification Exam(s) ]
    CompTIA [76 Certification Exam(s) ]
    ComputerAssociates [6 Certification Exam(s) ]
    Consultant [2 Certification Exam(s) ]
    Counselor [4 Certification Exam(s) ]
    CPP-Institue [2 Certification Exam(s) ]
    CPP-Institute [2 Certification Exam(s) ]
    CSP [1 Certification Exam(s) ]
    CWNA [1 Certification Exam(s) ]
    CWNP [13 Certification Exam(s) ]
    CyberArk [1 Certification Exam(s) ]
    Dassault [2 Certification Exam(s) ]
    DELL [11 Certification Exam(s) ]
    DMI [1 Certification Exam(s) ]
    DRI [1 Certification Exam(s) ]
    ECCouncil [21 Certification Exam(s) ]
    ECDL [1 Certification Exam(s) ]
    EMC [129 Certification Exam(s) ]
    Enterasys [13 Certification Exam(s) ]
    Ericsson [5 Certification Exam(s) ]
    ESPA [1 Certification Exam(s) ]
    Esri [2 Certification Exam(s) ]
    ExamExpress [15 Certification Exam(s) ]
    Exin [40 Certification Exam(s) ]
    ExtremeNetworks [3 Certification Exam(s) ]
    F5-Networks [20 Certification Exam(s) ]
    FCTC [2 Certification Exam(s) ]
    Filemaker [9 Certification Exam(s) ]
    Financial [36 Certification Exam(s) ]
    Food [4 Certification Exam(s) ]
    Fortinet [14 Certification Exam(s) ]
    Foundry [6 Certification Exam(s) ]
    FSMTB [1 Certification Exam(s) ]
    Fujitsu [2 Certification Exam(s) ]
    GAQM [9 Certification Exam(s) ]
    Genesys [4 Certification Exam(s) ]
    GIAC [15 Certification Exam(s) ]
    Google [4 Certification Exam(s) ]
    GuidanceSoftware [2 Certification Exam(s) ]
    H3C [1 Certification Exam(s) ]
    HDI [9 Certification Exam(s) ]
    Healthcare [3 Certification Exam(s) ]
    HIPAA [2 Certification Exam(s) ]
    Hitachi [30 Certification Exam(s) ]
    Hortonworks [4 Certification Exam(s) ]
    Hospitality [2 Certification Exam(s) ]
    HP [752 Certification Exam(s) ]
    HR [4 Certification Exam(s) ]
    HRCI [1 Certification Exam(s) ]
    Huawei [21 Certification Exam(s) ]
    Hyperion [10 Certification Exam(s) ]
    IAAP [1 Certification Exam(s) ]
    IAHCSMM [1 Certification Exam(s) ]
    IBM [1533 Certification Exam(s) ]
    IBQH [1 Certification Exam(s) ]
    ICAI [1 Certification Exam(s) ]
    ICDL [6 Certification Exam(s) ]
    IEEE [1 Certification Exam(s) ]
    IELTS [1 Certification Exam(s) ]
    IFPUG [1 Certification Exam(s) ]
    IIA [3 Certification Exam(s) ]
    IIBA [2 Certification Exam(s) ]
    IISFA [1 Certification Exam(s) ]
    Intel [2 Certification Exam(s) ]
    IQN [1 Certification Exam(s) ]
    IRS [1 Certification Exam(s) ]
    ISA [1 Certification Exam(s) ]
    ISACA [4 Certification Exam(s) ]
    ISC2 [6 Certification Exam(s) ]
    ISEB [24 Certification Exam(s) ]
    Isilon [4 Certification Exam(s) ]
    ISM [6 Certification Exam(s) ]
    iSQI [7 Certification Exam(s) ]
    ITEC [1 Certification Exam(s) ]
    Juniper [65 Certification Exam(s) ]
    LEED [1 Certification Exam(s) ]
    Legato [5 Certification Exam(s) ]
    Liferay [1 Certification Exam(s) ]
    Logical-Operations [1 Certification Exam(s) ]
    Lotus [66 Certification Exam(s) ]
    LPI [24 Certification Exam(s) ]
    LSI [3 Certification Exam(s) ]
    Magento [3 Certification Exam(s) ]
    Maintenance [2 Certification Exam(s) ]
    McAfee [8 Certification Exam(s) ]
    McData [3 Certification Exam(s) ]
    Medical [69 Certification Exam(s) ]
    Microsoft [375 Certification Exam(s) ]
    Mile2 [3 Certification Exam(s) ]
    Military [1 Certification Exam(s) ]
    Misc [1 Certification Exam(s) ]
    Motorola [7 Certification Exam(s) ]
    mySQL [4 Certification Exam(s) ]
    NBSTSA [1 Certification Exam(s) ]
    NCEES [2 Certification Exam(s) ]
    NCIDQ [1 Certification Exam(s) ]
    NCLEX [2 Certification Exam(s) ]
    Network-General [12 Certification Exam(s) ]
    NetworkAppliance [39 Certification Exam(s) ]
    NI [1 Certification Exam(s) ]
    NIELIT [1 Certification Exam(s) ]
    Nokia [6 Certification Exam(s) ]
    Nortel [130 Certification Exam(s) ]
    Novell [37 Certification Exam(s) ]
    OMG [10 Certification Exam(s) ]
    Oracle [282 Certification Exam(s) ]
    P&C [2 Certification Exam(s) ]
    Palo-Alto [4 Certification Exam(s) ]
    PARCC [1 Certification Exam(s) ]
    PayPal [1 Certification Exam(s) ]
    Pegasystems [12 Certification Exam(s) ]
    PEOPLECERT [4 Certification Exam(s) ]
    PMI [15 Certification Exam(s) ]
    Polycom [2 Certification Exam(s) ]
    PostgreSQL-CE [1 Certification Exam(s) ]
    Prince2 [6 Certification Exam(s) ]
    PRMIA [1 Certification Exam(s) ]
    PsychCorp [1 Certification Exam(s) ]
    PTCB [2 Certification Exam(s) ]
    QAI [1 Certification Exam(s) ]
    QlikView [1 Certification Exam(s) ]
    Quality-Assurance [7 Certification Exam(s) ]
    RACC [1 Certification Exam(s) ]
    Real-Estate [1 Certification Exam(s) ]
    RedHat [8 Certification Exam(s) ]
    RES [5 Certification Exam(s) ]
    Riverbed [8 Certification Exam(s) ]
    RSA [15 Certification Exam(s) ]
    Sair [8 Certification Exam(s) ]
    Salesforce [5 Certification Exam(s) ]
    SANS [1 Certification Exam(s) ]
    SAP [98 Certification Exam(s) ]
    SASInstitute [15 Certification Exam(s) ]
    SAT [1 Certification Exam(s) ]
    SCO [10 Certification Exam(s) ]
    SCP [6 Certification Exam(s) ]
    SDI [3 Certification Exam(s) ]
    See-Beyond [1 Certification Exam(s) ]
    Siemens [1 Certification Exam(s) ]
    Snia [7 Certification Exam(s) ]
    SOA [15 Certification Exam(s) ]
    Social-Work-Board [4 Certification Exam(s) ]
    SpringSource [1 Certification Exam(s) ]
    SUN [63 Certification Exam(s) ]
    SUSE [1 Certification Exam(s) ]
    Sybase [17 Certification Exam(s) ]
    Symantec [135 Certification Exam(s) ]
    Teacher-Certification [4 Certification Exam(s) ]
    The-Open-Group [8 Certification Exam(s) ]
    TIA [3 Certification Exam(s) ]
    Tibco [18 Certification Exam(s) ]
    Trainers [3 Certification Exam(s) ]
    Trend [1 Certification Exam(s) ]
    TruSecure [1 Certification Exam(s) ]
    USMLE [1 Certification Exam(s) ]
    VCE [6 Certification Exam(s) ]
    Veeam [2 Certification Exam(s) ]
    Veritas [33 Certification Exam(s) ]
    Vmware [58 Certification Exam(s) ]
    Wonderlic [2 Certification Exam(s) ]
    Worldatwork [2 Certification Exam(s) ]
    XML-Master [3 Certification Exam(s) ]
    Zend [6 Certification Exam(s) ]

    References :

    Dropmark :
    Wordpress :
    Scribd :
    weSRCH :
    Issu :
    Dropmark-Text :
    Youtube :
    Blogspot :
    RSS Feed :
    Vimeo :
    Google+ : :
    Calameo : : :

    Back to Main Page

    Killexams 310-083 exams | Killexams 310-083 cert | Pass4Sure 310-083 questions | Pass4sure 310-083 | pass-guaratee 310-083 | best 310-083 test preparation | best 310-083 training guides | 310-083 examcollection | killexams | killexams 310-083 review | killexams 310-083 legit | kill 310-083 example | kill 310-083 example journalism | kill exams 310-083 reviews | kill exam ripoff report | review 310-083 | review 310-083 quizlet | review 310-083 login | review 310-083 archives | review 310-083 sheet | legitimate 310-083 | legit 310-083 | legitimacy 310-083 | legitimation 310-083 | legit 310-083 check | legitimate 310-083 program | legitimize 310-083 | legitimate 310-083 business | legitimate 310-083 definition | legit 310-083 site | legit online banking | legit 310-083 website | legitimacy 310-083 definition | >pass 4 sure | pass for sure | p4s | pass4sure certification | pass4sure exam | IT certification | IT Exam | 310-083 material provider | pass4sure login | pass4sure 310-083 exams | pass4sure 310-083 reviews | pass4sure aws | pass4sure 310-083 security | pass4sure cisco | pass4sure coupon | pass4sure 310-083 dumps | pass4sure cissp | pass4sure 310-083 braindumps | pass4sure 310-083 test | pass4sure 310-083 torrent | pass4sure 310-083 download | pass4surekey | pass4sure cap | pass4sure free | examsoft | examsoft login | exams | exams free | examsolutions | exams4pilots | examsoft download | exams questions | examslocal | exams practice | | | |


    MORGAN Studio

    is specialized in Architectural visualization , Industrial visualization , 3D Modeling ,3D Animation , Entertainment and Visual Effects .