Forums Register Login

JSF Vs JSP Vs JSTL

+Pie Number of slices to send: Send
Hello All
Is there any guideline on when to use JSF, again when to use JSP and When to use JSTL?

Any reply would be greatly appreciated as I am preparing for my exams...
Regards
Mohamed Farouk
+Pie Number of slices to send: Send
JSF already uses JSPs. JSTL can be used in current implementations of JSF as far as I know. Your question doesn't make a lot of sense.
+Pie Number of slices to send: Send
Hello Gregg

Thanks for your reply, As an architect trying to defend arguements about which techonology to use (JSP, JSF or JSTL) when asked, I have no clear answer.

Can i say use JSF as it is latest? - Not sensible...
Can i say use JSP as it has been stable and used before in many projects? Not sensible...
Can I say use JSP with Custom tags as I have used in previous project?
Can I say use JSP with JSTL as some one recommends?

Do you thing the above replies will convince a technologist who is looking for more sensible answer on my decisions.

There should be a guideline to differentiate these technologies and when to apply what.
The following is what I would like to provide as a answer to questions
I prefer to use JSP as my application UI screens do not requires that feature?

I prefer to use JSTL with JSP and avoid JSF if your screens and application does not require that feature?

I prefer to use JSF as your application requires this feature?

Hope it makes sense please can you comment on this, I would like to hear from you...
Thanks
+Pie Number of slices to send: Send
JSTL+JSP is a concrete implementation. In very rough terms, like coding a set of instructions in assembly language.

JSF is an abstract implementation. Once again, very roughly, like coding specifications instead of instructions. Usually, the trade-off is between flexibility versus ease of development and maintenance.

You can use JSTL on JSF pages, but judiciously. Depending on the JSF release, JSTL may end up mucking around with JSF's understanding of the world.

However, please note that JSF/JSP is not "either/or". You can mix raw JSP's (and servlets), JSTL JSP's, JSF, and even Struts in the same webapp and they'll all play happily together. Use whatever is most effective for the action in question.
+Pie Number of slices to send: Send
Hello Tim
Great to hear from you, thanks for your comments, But one thing of what you said has made me ask you again the same question:

"Use whatever is most effective for the action in question"

So can you tell me what is most effective for what type of actions:
JSF is effective for actions like?
JSP is effective for actions like?
JSTL is effective for actions like?
Servlets is effective for actions like?

Hope those answers will give me the guidelines on what to use on what conditions...

Please help I am asking this as I was told there are lot of questions around best practice on usage of these when I am gonna sit for my SCEA beta architect exam...

I would appreciate your way of thinking on these technologies..
+Pie Number of slices to send: Send
I doubt my opinions would be a good reference for a certification exam, but one of the main reasons I've never bothered to acquire certs is that the Real World is generally more complex than the cert world.

I usually don't use straight JSP's these days except for one or two significant exceptions:

1. Login/password failed pages when using form-based authentication

2. Home page for a webapp.

When outputting non-HTML (such as PDF's or graphics), I normally use servlets, although sometimes JSPs are good for XML output. Struts action processors are also good for non-HTML output.

Anything with any sort of dynamic content - whether inbound (forms) or outbound (query/update results) I usually would be using JSF. I've always felt that Struts is probably capable of heavier workloads than JSF, but that's just a feeling not backed by hard measurements, and so far I haven't done anything that JSF couldn't handle.

The reasons for cases 1 and 2 above are as follows:

1. When using container-based authentication, the container hijacks and caches the original HTTP request, presents the login page, and (if successful) then resumes the original request. Because the login page is done out of the mainstream logic flow, it may find it difficult to access the full line of server services, depending on what server the app is running under. Thus, my login pages are minimalistic and don't make unneccesary infrastructure demands.

2. The site lead-in page (Home page, Hello page) is the place where users will go by default. Unlike some people, who think it's perfectly OK to put a Flash app on their lead-in page with all the secondary links done in Flash, I assume the worst of the user's browser. That is, primarily text displays (some of us use non-graphical browsers) and no assumption of support for cookies, JavaScript, Java applets or other features which might either be either switched off or never installed.

I have a 64-bit machine and Flash-only websites are just one big blank page to my browser. A major auto brand lost a sale to their non-Flash competitor recently.

There's another reason why my hello page is a JSP. As I recall, the hello page in a web.xml is a document, rather than a URL. JSF pages don't have document IDs, only their templates do, and you can't just bring up the template - to work properly you need the JSF context. So some of my sites have a hello JSP that does nothing but redirect to a JSF hello page URL. Such is life.

By the above, you can see I don't have any "silver bullet" rules, though I do have some standards designed to enhance user-friendliness.
+Pie Number of slices to send: Send
Thats an answer. I got your view of looking at it . I really appreciate your time and effort to reply for my questions.

I thank you again for your great answer...
+Pie Number of slices to send: Send
Thats an answer. I got your view of looking at it . I really appreciate your time and effort to reply for my questions.

I thank you again for your great answer...
Uh oh, we're definitely being carded. Here, show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 15037 times.
Similar Threads
System Unavailable
Web Application Testing require your suggestions please?
How to include Dynamic tag lib in the jsp
Servlet vs JSP vs JSF
SCWCD vs SCBCD
scriptlets Vs EL/JSTL
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:19:09.