CrazyEngineers
  • JSP or Servlet?

    ce_neha

    Member

    Updated: Oct 25, 2024
    Views: 1.1K
    Hi ,

    What should we used a servlet or a jsp?
    In which type of applications we can find a servlet better to be used?







    Please assist
    Thanks!
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Mahesh Dahale

    MemberNov 26, 2009

    well, JSP may be great for serving up dynamic Web content and separating content from presentation
    JSP as a high-level abstraction of servlets
    servlets excellent for server-side processing
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberNov 26, 2009

    ce_neha
    Hi ,

    What should we used a servlet or a jsp?
    In which type of applications we can find a servlet better to be used?
    Hi ce_neha,

    If your application is web based like having more focus on UI[User Interface] than Java programming - I will say go for JSPs but if your application is more dependent on Java rather than UI. Go for Servlets.

    And if you say, it is a mix of both then I would always recommend to make your UI in JSP only and do Java programming part in Servlets. It is considered as a bad practice if someone use "Java" in JSPs [scriptlets should be avoided] and "HTML" tags in "Java"

    Hope , I cleared your doubt. If still any doubts, feel free to ask. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • ce_neha

    MemberNov 27, 2009

    Hi ,

    I read somewhere that "JSP only deals with textual data, you will have to continue to use servlets when communicating with Java applets and applications."

    Please clarify the above statement,what applications are we referring to?
    or explain it with an example.




    Thanks.
    Are you sure? This action cannot be undone.
    Cancel
  • sarveshgupta

    MemberNov 27, 2009

    Will clear your doubt give some time
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberDec 5, 2009

    ce_neha
    Hi ,

    I read somewhere that "JSP only deals with textual data, you will have to continue to use servlets when communicating with Java applets and applications."

    Please clarify the above statement,what applications are we referring to?
    or explain it with an example.

    Thanks.
    Hi ce_neha,

    I think you read it here - #-Link-Snipped-#

    Well they mean to say that JSP just allow you to handle UI part. It will not allow a Java program(Here a servlet specifically) to communicate with other Java programs and its methods. So in that case you will have to go for Servlets only. And again as I said before also. All your Java code should be kept in servlets only. Use JSP only for UI purpose. Though it provides you few feature of incorporating Java code but avoid using it if you are making an application keeping dynamic thing in mind.

    Feel free to ask if still not clear. 😀

    Thanks !
    Are you sure? This action cannot be undone.
    Cancel
  • callyD

    MemberDec 6, 2009

    My understanding is JSP is for those who are not hardcore Java programmers. It offers ease of programming. Servlets are for hardcore java programmers. Servlets offer more flexibility to implement complex validation rules.
    Are you sure? This action cannot be undone.
    Cancel
  • sookie

    MemberDec 7, 2009

    callyD
    My understanding is JSP is for those who are not hardcore Java programmers. It offers ease of programming. Servlets are for hardcore java programmers. Servlets offer more flexibility to implement complex validation rules.
    Please change your understanding for making better web applications in future. I seriously hate people who add JAVA code in JSP pages. Just because of such understandings and coding practices only, security of web applications become a major issue at times.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register