What are JSP, Servlet , Bean in MVC ??..how does it function?

suppose there's a bean file (.java) consisting of SQL query, and a servlet (.java) used to show an image, and lastly a jsp page when clicked shows the image.............can you please explain how does this work,how the logic flows,what happens step by step.....i really need to understand this, thankz.

A JSP page is essentially an easy way to create an abstract behind the scenes servlet where its whole purpose is to serve HTML. JSP tags and java code within the page are processed on the server side first and then a response is sent containing the HTML.
The JSP can send its request to another handler or servlet that can do the processing.
I don't understand where a java bean comes into play in this situation.

Similar Messages

  • JSP- Servlet-- Bean-- JSP how to implement

    I have problem.
    My JSP will take a emplyee id .
    Now I want to show all the values regarding that employee in a JSP(JSP form) from the DB(Oracle).
    So Iam planning like
    JSP-->Servlet-->Bean-->JSP
    So my doubts are.
    1. Is it correct approach
    2.If it is correct then which part of the flow connects to DB and stores the value before putting to JSP.
    Iam using Tomcat 4.31
    Plz help me

    I have problem.
    My JSP will take a emplyee id .
    Now I want to show all the values regarding that
    employee in a JSP(JSP form) from the DB(Oracle).
    So Iam planning like
    JSP-->Servlet-->Bean-->JSP
    So my doubts are.
    1. Is it correct approach
    2.If it is correct then which part of the flow
    connects to DB and stores the value before putting to
    JSP.
    Iam using Tomcat 4.31
    Plz help meHI
    What you are probably proposing is an MVC design pattern. I wonder if u have heard of the struts framework. Sruts uses MVC design pattern wherein the servlet u are talking about acts as a controller(C) and the bean acts as the model(M) .The JSPs present the view(V). Hence the name MVC.
    Your approach is right. First get the employee ID from the jsp and get the corresponding data from database(This logic u implement in the servlet). Then save the fetched data in a bean so that the result jsp can fetch data from it.
    Now this is not a strict MVC approach.
    Learn more about struts. It presents a much more cleaner solution.

  • Sample jsp servlet bean (MVC) code

    We want to look into the JSP/Servlet/Bean area for our next project. We wish to understand the technology and as such want to hand build simple applications, and as such do not want to use JDeveloper just yet.
    We have searched and searched for suitable material but cannot anywhere find a sample application that :
    A. Lists contents of a databse table
    B. Each item in trhe list is a link to a page that allows that item, to be edited.
    C. A new item can be added.
    D. Uses the MVC model of JSP/Servlet and bean (preferably with no custom tags)
    There are examples that are too simplistic and do not cover the whole picture. Having spent over 100 GBP on books lately, only to be disappointed with the examples provided, we need to see some sample code.
    The samples provided by Oracle are too simplistic. They should really have provided ones built around the EMP and DEPT tables.
    Anyone know where we can get hold of this sample code.

    At the risk of sounding really dumb the examples are just too complex. There does not appear to be anywhere on the web where I can find a simple JSP/servlet/bean example of the type I described. There is enouigh material describing each individual component, but what I need is an example to cement the ideas, but the ones suggested are too much for a newbie. Even the much vaunted Pet Store thingy causes my eyes to glaze over.
    I dont expect anyone to have written something with my exact requirements, but surely to goodness there must be something that:
    1. On entry presents a search form on a table (e.g. EMP)
    2. On submission list all rows in EMp matchiung the criteria.
    3. The user can either click the link 'Edit' which opens up a form dispalying the row allowing the user to edit and save the changes, or click the 'New' button to show a blank form to create a new EMP.
    All this via a Controller servlet, with the database logic handled by a java bean, and all the presentation done via JSP.
    To me this is the most obvious and instructive example of this technology, but after days of trawling the web, and looking through a number of books, I cannot find such a thing.
    CGI with Perl DBI/DBD was a breeze to work with compared to this stuff ..... maybe ASP with SQL/Server would be a more fruitful use of time.

  • What are these EM-related accounts and how do I unlock them?

    Hi,
    I created a database manually so it can not be managed through Enterprise Manager yet. When I run the database configuration assistant to configure it with Enterprise Manager, in the alert log file, i get the error message:
    oracle.sysman.emcp.exception.EMConfigException: Failed to unlock all EM-related accounts
    What are these EM-related accounts and how do I unlock them?
    Thanks, hope somebody tries to help me. Any leads will be appreciated.

    alter user dbsnmp unlock;
    It gets locked by some Critical Patch Updates.
    You can also configure em/dbconsole with emca.

  • When I go to get add-ons (7.0.1), nothing shows up, except the "what are add-ons" info bubble. How do I make this work?.

    When I go to get add-ons (7.0.1), nothing shows up, except the "what are add-ons" info bubble. How do I make this work?. The rest of the functions in that section seem to work. And I can search MY add-ons, but not Available Add-ons.

    Click on Extensions on the left-side.

  • Now what do I do with this?  How does this solve my problem?

    Now what do I do with this?  How does this solve my problem with Adobe Photoshop Elements 10

    And exactly what? You need to be a lot more specific.
    Mylenium

  • What are the accounts that will hit while doing subcontracting process

    What are the accounts that will hit while doing subcontracting process?

    Hi Raj,
    In Case of Sub contract
    While doing Transfer Posting (Providing material to vendor) in MB1B or ME2O only Material document will be generated. No Accounting Document will be generated.
    While Receiving the Finished / Semifinished material both Material and Accounting documents will get generated and the accounting entries will be as under
    1. Stock Account (finished Account)                             BSX             - Debits    
    2. GR/IR clearing Account                                            WRX           - Credits   
    3. Change in Stock Account                                         BSV           - Credits  
    4. Processing Charges/Sub Contract Charges                FRL            - Debits   
    5. Stock Account (Raw Material)                                   BSX            - Credits  
    6. consumption from stock of material provided to vendor GBB(VBO)  - Debits   
    bye
    Sridhar Thota

  • There is a URL with all my apple hardware. When I sell a iPhone, I must cancel it from the list - how does it function?

    There is a URL with all my apple hardware. When I sell a iPhone, I must cancel it from the list - how does it function?

    There is no requirement that you add or delete items, but it can be helpful. The URL is https://supportprofile.apple.com/ and to delete, you click the "Edit Products" button near the top right of that page.

  • Jsp,servlet,bean question,please help

    The Tomcat Web server set up like this.......
    The directory structure is
    e:/sampleapp/WEB-INF/classes
    /lib
    And the web.xml is in the WEB-INF for the use of ay potential servlet.
    The basic understanding is that all the .java files go into the WEB-INF directory and the .class files go into the classes directory.
    All the .jsp files go into the sampleapp directory.Till here is correct I feel.
    Now for my qustion......
    I plan to use jsp,servlet and beans for a potential web application...,where do all these files go?,just the same as above or is there a difference.
    Hope that I have given a reasonable explaination to my question.
    Thanks for any replies
    AS

    All of your compiled servlet and java bean (java
    classes in general) will be placed into the following
    directory (under a directory structure matching the
    java package they are in):
    e:/sampleapp/WEB-INF/classesAll of your .jar files that are used as libraries (not
    your .jar files for applets):
    e:/sampleapp/WEB-INF/libAll of the rest of your JSP files, javascript files,
    HTML files, JAR files, images files, etc. will go into
    the following directory:
    e:/sampleappYou must make sure you put your sampleapp directory
    where tomcat can load it. Or use the admin tool to
    load it. If you make a .WAR file with a corresponding
    web.xml file in it, it will simplify loading it into
    tomcat. It also will help you do your servlet
    mappings, etc. I hope this helps.Thanks for your timely response.To add to it,let me tell you.
    The <b>bean</b> files are put into a package right,so they should be put into the WEB-INF/classes/<package name>
    What about The <b> servlet </b> files...... they are just put into the WEB-INF/classes/ directory????
    Kindly let me know.
    Thanks
    AS

  • Jsp / Servlet / bean / upload

    Hello,
    I use a jsp to enter several fields. These fields are sent to a servlet by using a bean (recorded in the current session). Until now there is no problem. The servlet receives all information. Now I must also send 5 files which must be stored on the server. I have thus to add in my jsp 5 file fields.
    My question :
    Is it possible to integrate the FileUpload package for uploader my files without anything to change in my code (by using of a bean to exchange the data between my jsp and my servlet). ??
    In other words, it is possible to use my bean to also transport files. ??
    Tank u for u help

    Yes it is possible..
    download cos.jar from www.oreily.com for file upload..
    it will read dat from the form as two parts ..
    parameter part and file part..
    and you can implement it throgh a servlet easily..
    for more follow oreily JSP/servlets Cookbook

  • What are the prerequisites for GATP and how to check SO in APO

    Hi
    I've created a Sales order in R/3. for this the availability check is being done in APO(SCM). when I press enter it is going to APO(SCM).
    now i want to see this Sales order in APO(SCM), what is transaction for this? and do i need to maintain any CIF model to see the Sales order in APO.
    pls give me some note on this.
    thanx in advance
    Satya
    Edited by: Wilian Segatto on Jan 25, 2010 4:40 PM

    Hello,
    Please refer Building block of GATP, you will able to get systimatic way how to use GATP functionality in R/3 and APO as well as what are the settings require for it.
    http://help.sap.com/bp_scmv150/BBLibrary/documentation/ATP_BB_ConfigGuide_EN_DE.doc

  • Change Drop Down from Other JSP/Servlet/Bean

    I am wanting to have a select box populate from a database query based on the information pulled from another select box as the user chooses it (ie a user chooses a state and the city choices populate or something like that). I am using JSP, Servlets and Beans. Seems that I need to us JSF, but I was wondering if there is another way or better way.
    Thanks for the thoughts.

    user12081556 wrote:
    I meant to put in my question above, aren't jsf tags just imbedded in some jsp/html code?Not jsp code no. I don't know whether it's possible to use jsf and jsp together, but I wouldn't try.
    While JSP has evolved over time from Html and Java code mixed together to standard tags responsible mostly for displaying the data, it's still an old "hack" that compiles jsp pages into servlets.
    JSF at least alleviates some of those problems and works nicely with proper xhtml formatted views too (and there's facelets etc. etc. etc.).
    Granted, if you're shown some jsp tags and jsf tags, you might not appreciate the difference in the technologies.

  • HT204053 My daughter and me use the same cloud ID and to buy songs and now all her contacts ended up on my new iphone 5  and I manually erased all from my phone and now they are gone from her phone.  How does she get back her contacts?

    My daughter and me use the same cloud and apple id to buy songs in the past.  I got first iphone 5 and after trying to set up itunes to phone I ended up with all my daughters contacts from her iphone on my iphone.  I then deleted them from my phone one by one and now they are gone from her phone as well.  How does she get them back on hers and what happen????  Help with cloud!

    That's what happens when you share the same iCloud account.  First, migrate his phone to a different iCloud account using a different ID (you can continue to share the same ID for other services such as iTunes if you want).  To do this, on his phone save any photo stream photos that he wants to keep to his camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If he are syncing notes with iCloud that he wants to keep, you'll need to open each of your notes and email them to him so he can later copy and paste the text into new notes created in his new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; this won't effect your phone), provide the password to turn off Find My iPhone and choose Keep on My iPhone when prompted.  Then sign back in with a different Apple ID to create his new account and choose Merge to upload the data.  After doing this, he can go to icloud.com and safely delete your data from his new account.
    Then, if your contacts were on your phone when you last backed it up to iCloud, you can restore them by following Winston Churchill's user tip here: https://discussions.apple.com/docs/DOC-4841.  This involves turning off your wifi after your phone restarts during the restore process, then saving the contacts on your phone and deleting them from iCloud prior to turning your wifi back on and allowing the restore process to finish.  You can turn off your wifi either by pulling the cord out of the WAN port in your wifi router, or by simply unplugging it.

  • What is "normal URL's load"? How does one do this?

    I osted that my pwerbook showed 4 bars (wireless) but said I was not connected. I have had man, many problems with my MBP regarding connecting to the internet wirelessly.
    iVmichael was kind enough to give the following response:
    "That URL throws an error in every browser I try, do 'normal' URL's load OK ?"
    What is a "normal URL load", and how do I do this.
    Thanks for the help.

    Normal URLs are sites like http://www.google.com or http://www.cnn.com and he is asking if those sites load normally (i.e. do you get the google search page or the CNN home page with the above links).

  • What is the point of tags, and how does one use them?

    I am completely mystified by tags. This is a new feature that is supposed to be wonderful and helpful, and some people have hailed them as a major improvement. However, I can't see what they are good for.
    If you put a tag on a file, it is added to the beginning of the filename in Finder, thus shortening the portion that is visible, which potentially makes it harder to identify the file. If you are thinking of telling me to abandon icon view in the Finder, forget it.
    Tags have to be added manually. How does that work if you have more than 24 files? I have about 3,000.
    It seems that you'd have to come up iwth a categorization scheme for alll the files on your disk. Ccmbine that with tagging them manually, won't that take a huge amount of t ime?
    What added benefit do tags give the user?
    We used to be able to add metadata to files with CMD+I. Now we can only add tags. Is this progress or regress and why?
    Incidentally, I am over 12 years of age.

    Thanks for the explanations. What this means in my situation is that tags are an unnecessary way of spending a lot of time making my file system more complicated, without adding any value whatsoever. Without tags, I can find any of my 3,000 files with a few clicks. (On my computer, Spotlight has cobwebs. I very rarely need it, but it's wonderful when I do.) Now that I know how tags work, I can ignore it.
    A human being can only perceive a quantity of seven without counting or grouping; hence we arrange things in structures to keep the number of entitites low on each level. You don't need to count three objects to know that they are all there, but you do need to count twelve objects. Which is why Home Alone was believable. We sort screws and nails in jars and toolboxes have compartments. Even the grocery store has a hierarchical arrangement. You don't find steaks in the bakery section, or breakfast cereal in the produce department.
    Some people aren't organized, and that's not a bad thing, but no folder, no tag, and no group is going to change a fundamental personality characteristic.
    Thanks everyone for showing me that in my case, there's no point to tags. That saves me a lot of time.

Maybe you are looking for

  • Error in creation of transfermations in BI7

    when i am creating transformations to 0FI_AR_3 datasource getting following error: Activate version of emulated 3.X datasource 0FI_AR_3 can't be displayed. Plz tell me what to do. Thanks and regards, nag

  • How to set up department ID printing on Canon IR Advanced C2020

    We have a few Mac users (ranging from Leopard to Lion) that need to be able to print to our network printers. When I set them up to print to the Toshiba network printers I get the option of "Print Mode" in the printer options and then I can add their

  • Error while creating data

    Hi, The below code is giving error in 4.7 but it works fine in ECC6. create data dynamic TYPE table OF (s_tabnam-low). how can i replace this in 4.7 Thanks, Rakesh.

  • Unable to access DFS shares when server 1 goes down

    Hello all, I have a test domain I am building in order to prepare for a new domain we are going to create. We currently have an SBS 2003 that is reaching the end of its' life. We are going to start fresh. I have setup domain-based DFS along with DFS

  • Acrobat 7 Professional - PDF Writer errors out in Print Queue

    Hello, I'm an IT Technician.  We've just imaged many of our machines and several of our secretaries use Adobe Acrobat 7 Professional so I re-deployed that application, along with the 7.1.3 update.  Everything works fine for me, including some of our