This discussion is archived
10 Replies Latest reply: Jan 31, 2013 9:12 PM by r035198x RSS

java code vrs JSTL

984162 Newbie
Currently Being Moderated
I'm beginning to study jsp I have a knowledge in the Java language, let me know if you need to learn JSTL for JSP pages or just know java

is more easy for me make the JSP page with java code. thanks for you answers
  • 1. Re: java code vrs JSTL
    gimbal2 Guru
    Currently Being Moderated
    981159 wrote:
    I'm beginning to study jsp I have a knowledge in the Java language, let me know if you need to learn JSTL for JSP pages or just know java
    Yes, learn JSTL! Its really easy.
    is more easy for me make the JSP page with java code. thanks for you answers
    It is a maintenance hell. Do yourself a favor and learn to use servlets & JSPs together, using servlets for your server side business logic (Java code) and JSPs for rendering ('drawing') the view ('page') using absolutely no Java code in the JSP. You'll thank yourself later.


    Btw: can you explain to yourself why you posted this in the concurrency forum and not in the Javaserver Pages forum?
  • 2. Re: java code vrs JSTL
    rukbat Guru Moderator
    Currently Being Moderated
    +... thread moved from Concurrency to JSP.+
  • 3. Re: java code vrs JSTL
    984162 Newbie
    Currently Being Moderated
    thanks for reply now I have clear the situation, sorry for the publication in the wrong category ,

    Edited by: 981159 on 10-ene-2013 14:17
  • 4. Re: java code vrs JSTL
    r035198x Pro
    Currently Being Moderated
    Be aware though that JSP is old and has now been deprecated from Java EE.
  • 5. Re: java code vrs JSTL
    gimbal2 Guru
    Currently Being Moderated
    r035198x wrote:
    Be aware though that JSP is old and has now been deprecated from Java EE.
    No it isn't, the spec even got an update still in JEE 6.

    JSP has been deprecated for use as the view technology for JSF, that much is true. And you can draw some premature conclusions from the fact that it is not in the JEE tutorial anymore, in favor of JSF itself. Lets see what JEE 7 is going to bring to the table before making any such statements though.
  • 6. Re: java code vrs JSTL
    r035198x Pro
    Currently Being Moderated
    gimbal2 wrote:
    r035198x wrote:
    Be aware though that JSP is old and has now been deprecated from Java EE.
    No it isn't, the spec even got an update still in JEE 6.

    JSP has been deprecated for use as the view technology for JSF, that much is true.
    I don't see the difference. The EE6 spec contains a spec that deprecated JSP presentation (it's primary use). Just being on the spec list of APIs doesn't mean that it's not deprecated. In fact that's what deprecation entails, the API is kept but not used internally and discouraged for further use.
  • 7. Re: java code vrs JSTL
    gimbal2 Guru
    Currently Being Moderated
    r035198x wrote:
    the API is kept but not used internally and discouraged for further use.
    Discouraged where? By whom?
  • 8. Re: java code vrs JSTL
    r035198x Pro
    Currently Being Moderated
    gimbal2 wrote:
    r035198x wrote:
    the API is kept but not used internally and discouraged for further use.
    Discouraged where? By whom?
    Erm, in the spec where it is deprecated. By the authors and users of the same spec.
    Don't really know what your point is here.
  • 9. Re: java code vrs JSTL
    984162 Newbie
    Currently Being Moderated
    so I'm making a mistake when I'm studying JSP JSF should study?
  • 10. Re: java code vrs JSTL
    r035198x Pro
    Currently Being Moderated
    981159 wrote:
    so I'm making a mistake when I'm studying JSP JSF should study?
    It's difficult to say if you are or not. It used to be a common question in enterprise architecture exams. When do you use JSP vs using JSF.

    These days the emphasis is on ease of development with many frameworks striving to solve as many common developer problems as they can so you can concentrate on writing only the business logic for your project. With plain JSPs you need to handle many cross cutting concerns yourself and develop filters and application controllers to deal with those concerns (otherwise you reuse by copy paste!). Because JSF (and many other frameworks) is a full MVC framework they already provide all those filters and application controllers while also improving the view with components, validation, templating and asynchronous request processing. Perhaps there are applications out there that don't need any of these, if they exist then those are the applications one could consider using plain JSPs for. It would be a shame if a developer has to take time from writing and testing business logic to developing functionality already made available by most frameworks. Also the arrival of Play! and other stateless MVC frameworks makes it even less likely that you'll find an application where an honest architecture choice process will pick JSP as most applicable.

    But your question is should you learn it? Well, there are lots of companies in the industry that have systems that use JSPs either alone or with other frameworks. Not only that but some of those companies have not changed their architecture choices to move away from it for various plausible reasons. Then there is products developed using JSP based technologies like Oracle ADF which uses JSF 1.2 (which used JSPs). If you intend to work for those companies or with those products at some point then you'll have to learn it to be most effective at your job. My suggestion was not necessarily to stop learning it, but to be aware of where JSPs stand in relation to other technologies.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points