When to use jsp,and when to use servlet?

I think that jsp and servlet can realize the same functions, because when run a jsp, it is transferred to a servlet program, so when to use jsp and when to use servlet?
I am now developing the input interface for a website, I just use jsp and javabean to connect to weblogic and database, and I didn't use servlet, Is there any unseemliness?
Thank you!

IMHO I use servlets to control the flow between my jsp's based on a number of factors in a webapp. For instance, user authorization. If a user has the authorization to conduct various administrative functions on an application (like change user rights, reset passwords etc) they will have access to specific buttons or links on some screens that others will not. I use servlets to establish what access rights a user has and direct them to the appropriate pages. I also use servlets to test data validity on form input screens. I know that I can also do this with JavaScript but that can be disabled by the client and in order to prevent that I also double check the form input from a servlet. All my jsp's do is display the results of a business process (which is held in a JavaBean or EJB) and the servlets act as the controllers for the application, connecting to multiple databases, verifying application state, flow control etc. I try to keep the jsp as simple as possible as some of them are maintained by html developers who lack the necessary experience to write java code. I hope this helps.

Similar Messages

  • When to choose JSP and When to choose Servlet in Web Application

    Hi,
    I know that using JSP over servlet has only one advantage like for huge Application you can devide presentation layer from business logic. Is there any other advantage.
    Also, if anyone can tell me how to handle FTP request in Servlet as HttpServlet supports only HTTP.
    Thanks.
    Subs

    Depends on what you're rying to accomplish. If you want to generate a bunch of HTML then JSP is the way to go. If you just want to extend the server (i.e. add functionality that isn't specific to any one screen of your application), then Servlets are the way to go.
    Additionaly, if you have a lot of HTML forms, and want to do it right, check out Struts. This would be the case if you wanted to both extend the server and generate HTML. It's an MVC framework available from Jakarta. It's fairly tried and true at this point. It makes it very easy to maintain, extend, and develop with. It also comes with a wealth of custom tag libraries out of the box. I have developed two projects with it so far and find it a pleasure to work with.
    http://jakarta.apache.org/struts/index.html
    Regards,
    Kyle

  • I am trying to use ichat and when I try to log in it says my account has been suspended bc of suspicious use...help

    i am trying to use ichat and when I try to log in it says my account has been suspended bc of suspicious use...help

    Hi,
    I would guess this is  an AIM valid Screen Name such as an Apple issued @mac.com account.
    I would also guess you travel to other countries.
    There have been several posts about @mac.com names and people who travel and use their Screen Name elsewhere having the name Suspended.
    Can you Log in here  https://settings.aim.com/ ?
    Is this where you saw the Suspended message ?
    For AIM issued name the answer is to change your Password as this tends to prove you own the account.
    This does not work for Apple IDs used as  AIM Valid Screen Names as AIM can't tell when the password is changed (They can only see it when you log in)
    AIM's Suspended Account page has an email ([email protected]) on it to contact if your account remains Suspended.
    However you need to be very clear that you have an Apple Issued Name and that you know that resetting the password that works for AIM Names and that you would like them to reset the account.
    More recently this has been a sticking point.  It seems the Contact you get does not always know about the agreement that AIM recognises Apple Issued IDs as Valid Screen Names and that the AIM  servers can only view the passwords at specific times (or at least confirm them) so you changing it will make no difference and that they have to step in manually.
    10:39 PM      Saturday; October 20, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    What does the error say?
    A couple of thoughts: the file is corrupted or is password-protected. Corruption is more likely to cause Numbers to crash & Numbers cannot open password-protected Excel files. Try using one of the free Office clones & see what happens.

  • I am running OS10.6.8 and have a mail box duplication. I use gmail and when I open my mail I have both the Apple Mail and another set of boxes for Gmail. Both get all mail and when I delete from one, it deletes from the other. How can I get rid of the dup

    I am running OS10.6.8 and have a mail box duplication. I use gmail and when I open my mail I have both the Apple Mail and another set of boxes for Gmail. Both get all mail and when I delete from one, it deletes from the other. How can I get rid of the dup

    Hi,
    According to your descriptioin, I don't think this is system problem, it should be Intel driver problem. It would be contact Intel to confirm this issue whether this is their driver problem.
    Roger Lu
    TechNet Community Support

  • I lost my connection when I was using internet and when I want to reconnect to airport it give me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hi,
    I lost my airport connection when I was using internet and when I wanted to re-reconnect to airport it gave me connection timeout error, I changed my password on router but still doesn't work. How can i fix my problem?

    Hello there hastibahreini,
    It sounds like you were using your Wi-Fi network from your Airport base station and the connection cut out. You have reset the password on the device but the issue persists. I would try the 3 resets outlined in the following article in order to help resolve the issue. If it persists, is the Wi-Fi connection issue happening on more than one device or computer?
    Resetting an AirPort base station FAQ
    http://support.apple.com/kb/ht3728
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • I am using iphone5 and when sending sms within 160 characters i am getting 2 sms counts deduction & i hear the message send sound twice. what is wrong here. can some one please help me here???

    i am using iphone5 and when sending sms within 160 characters i am getting 2 sms counts deduction & i hear the message send sound twice. what is wrong here. can some one please help me here???
    APPLE need to do something here!!!!!!1

    Hi...
    Thanks for your repaly .
    and i am not bale to post a question in developer forum i tried hard but i didnt get .Can you plz explain me how to post a question in developer forum this is very helpfull for me.Because i never did this thing.

  • Ive just upgraded to Mountain lion, I was using Safari and tried to use iCloud tabs. When I open it up there are no tabs there, anyone have any ideas on how to get it working?

    Ive just upgraded to Mountain lion, I was using Safari and tried to use iCloud tabs. When I open it up there are no tabs there, anyone have any ideas on how to get it working?

    Can you check system update? I think I did a system Update 1st, a day before installing OSX Lion and there is a Safari update. If not try logging in iCloud.

  • When to use inheritance and when not to?

    I've just been trying find out when to use inheritance and when not to use inheritance? I know that inheritance gives advantages such as code reuse and maintainability. But when are their times not to use inheritance that may effect the design of a project?
    Also when should one consider aggregation over inheritance(is-a relationship)?
    thanks,
    plandis

    Hi
    Answering this question usually requires a few books, so, I'm sorry, it's not really as simple as choosing between using a screwdriver vs. a hammer.
    But, very short, inheritance should ideally only be used when there exist a strict 'is-a' relationship. However, sometimes it may be clever to inherit when you have a 'is-almost-a' relationship... And sometimes this is a stupid move. This depends on the context/circumstances.
    Aggregation is normally considered a 'has-a' relationship, thereby differing clearly from inheritance. The old 'car' model says "a car is-a vehicle and has-some (at least) wheels."
    The wheels are aggregated to the car class, that itself is inherited from vehicle.
    However, this is just a good rule-of-thumb and there may be circumstantial reasons for not following these guidelines.

  • When to use AMF and when to use RTMP??

    Hello can someone explain the difference??
    I am using all the defaults for the configurations files
    (remoting and datamanagement) and my app works perfectly on
    development mode where everything is on localhost, but when we try
    it on pre-production it keeps throwing an error saying that it
    couldn't connect to the RTMP channel. The only thing that changes
    between these two modes is that on development i access everything
    on localhost and on pre-production we point to another server.
    I am totally clueless why this is happening, i am bit
    confused why data-management uses RTMP and why remoting uses AMF,
    so if anyone could explain it to me it would be great.
    Thanks

    There's no special reason why one uses RTMP vs. AMF. Data
    management service can also use AMF and Remoting can also use RTMP.
    The only real requiement is that Data management service needs to
    be able to receive updates from the FDS/LCDS server. This can be
    achieved by using a channel that is capable of receiving pushed
    updates from the server (eg. RTMP) or a channel that is capable of
    polling for updates on the server (i.e. AMF-polling). Therefore,
    when you use AMF with Data management service, you need to have
    polling enabled with a polling interval.
    In terms of why AMF works but RTMP doesn't is that AMF
    channel uses AMF format over the HTTP protocol whereas RTMP channel
    uses simple TCP socket (and not HTTP). Therefore in some
    environments, RTMP will be blocked by the firewalls but AMF won't
    since it's like regular HTTP traffic. In this case, you can use AMF
    polling instead or use RTMPT which is new in LCDS 2.5.

  • When to use wsimport and when to use wsgen?

    When do you use wsimport and when do you use wsgen?
    Thanks.

    JBStonehenge wrote:
    You are right: wsgen is on the server side, wsimport is on the client side.guess that's what i get for not reading both doc pages. i've used them before, but couldn't remember which was which. i did a quick check of the wsimport docs and misread the page, posting my original reply above ( [wsgen |http://java.sun.com/javase/6/docs/technotes/tools/share/wsgen.html] docs for reference as well).

  • HT201269 i have 4s used one and i been using it since a while ago and use my i cloud on it but when i upgrade

    i have 4s used one and i been using it since a while ago and  i cloud was working fine but when i upgrade it was asking me for the previse user i cloud ? what should i do

    Looks like its fixed.     I am syncing it now.      A lot of the answers are for the new iphone so i had to mess with a bunch of settings as well.  My old phone is now an 8 gig ipod.  the books app no longer works and that *****.....but better than nothing...

  • I am using CS6 and when I go to save an image for Web the image does not retain its quality

    I am using CS6 and when I go to save an image for Web the image does not retain its quality. The first week I did this it worked just fine and now the images save very pixely.
    Here is a screenshot of my image on the artboard as I am editing it
    Here is a screenshot of the image as I'm trying to save it for Web
    As you can see, the image becomes pixely. I have tried to save it as every type of png and jpeg but nothing seems to work. I have no idea why it has started to do this. Please help!

    Change None to Art optimized then click apply(alteast in CS5 there was an apply, believe they removed that in CS6 as so many people missed that part).

  • When to use @Resource and when to use @EJB for dependency injection

    Hi,
    When do you use
    @Resource and when do you use @EJB for dependency injection?
    Thanks

    Captain obvious: Use @EJB for injection of EJBs, and @Resource for everything else.
    There was a discussion about this very topic quite recently, perhaps you can find it through the search.

  • I purchased a used computer and when I go to Itunes to buy music I am rejected. I am using the correct address and password

    I purchased a used computer and when I go to Itunes to buy music I am rejected. I am using the correct address and password

    Error "The serial number is not valid for this product" | Creative Suite

Maybe you are looking for

  • Problem integrating own javascripts in a Custom build component

    Hi all, I have created an own component and included in the IC WebClient (CRM 2007). The component contains a view with a custom layout implemented directly in the related *.htm page in the respective BSP Application. This works great if I just add s

  • Error: (-36) SrcErr:YES Copying /.journal to (null)

    Not a huge concern since TM is still backing up successfully, but I didn't see this specific error in the troubleshooting guide. Maybe I'm a little OCD but when I see any errors in logs I get a bit twitchy. Anyway, my TM log is: Starting standard bac

  • PS CS3 unknown file type (?)

    Hi I've been working in PS CS3 with some images and went to open them tonight and PS gives me an error 'unknown file types' these images were created in PS CS3 and are .jpg Any ideas?

  • Nano and videos

    G'day! I know this topic has probably been done to death, but I'm out of ideas. I've had my 8GB Nano 5th Gen for a few months and everything is working flawlessly. There's just one thing I can't figure out. I know that Nano supports .mp4 video files,

  • How to authenticate keychain restored from Time Machine

    Crashed my macbook pro and restored from Time Capsule. How can I verify that the keychain restored is correct?