File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes web pages: which technology Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "web pages: which technology" Watch "web pages: which technology" New topic
Author

web pages: which technology

Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Hi Ranchers!

I need your input once more!

before I ask my question, I just want to say that I don't know much about web pages programming...

I want to do a dynamic web page, in Java related technologies.

As far as I know, I could do that in several ways :
- servlet
- JSP
- JSF
- Struts

I know JSF is just some extra tags to use in JSP. And, correct me if I'm wrong, JSP is compiled as servlet?

Among these technologies, If I were to learn one (for the future), which one would be a good bet?

I'm tempt to do a servlet because I know SWING very well... and it would be quite easy (for me) I believe.

JSP looks like a hard road to me.. and a jump in the past.

I did some JSF, I believe this could be good one day.. but they're no free web hosting for it as far as I know.

And struts.. well..don't know about it.

First of all.. is servlet a good way to do web pages? It sounds so easy, that I wonder why they are other ways of doing web pages...
Whays the downside of servlets?

Any comments will be appreciated.

Best Regards,
Alex
[ January 31, 2006: Message edited by: Alex Turcot ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

And, correct me if I'm wrong, JSP is compiled as servlet?

True.

which one would be a good bet?

Servlet + JSP. You could study to pass SCWCD.

I'm tempt to do a servlet because I know SWING very well... and it would be quite easy (for me) I believe.

Servlet and Swing have nothing in common. Swing is as you know some interface stuff. Servlet is not used for presentation, nor gui.

JSP looks like a hard road to me.. and a jump in the past.

Actually, it's not very hard once you know the basics.
But for putting this into practice, you'll probably want to learn more about EL and JSTL as well (which are also part of SCWCD)

Grab a book like Head First Servlet and JSP and you'll understand all the basics.

Have fun.


[My Blog]
All roads lead to JavaRanch
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Thanks for your response...

I made a mistake in my post however...
I forgot about applet, and I meant "applet" when comparing with SWING.

"I'm tempt to do an applet because I know SWING very well... and it would be quite easy (for me) I believe."

Is applet a good choice?

Regards,
Alex
[ January 31, 2006: Message edited by: Alex Turcot ]
Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

Hi Alex
You are right.JSP is a compiled into a servlet.
Regarding technologies,the downside of using servlets is there will be too many out.print statements in ur java code. besides your html code will be interspersed with the java code.

using servlet-jsp combination would be a good approach.
servlet for the navigation part and jsp for the view part.

U could start reading about struts,which is a framework rather than a technology.The ranch site for struts is a good place to start off with.i am not very familiar with Java Swings,i belive is also more or less based on MVC architecture.

hth
thanks
cheers
vinnym


Regards,Vinny M.
proud Fan of European Champion CHELSEA FC
"If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

JSP looks like a hard road to me.. and a jump in the past.


Huh? "a jump in the past"?

Applets, however, are considered passe by many.

In any case, I would avoid frameworks like JSF and Struts until you have a good handle on how Servlets and JSP work.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Thats really why I ask...

I would be tempt to do applets... but I know some people consider it to be history..

I did JSF for a while, even tho im not an expert at all.. I do understand how stuff works a little bit (simply made a mistake in my first post using "servlet" when really I meant "applet").

About JSP being a jump in the past, let me explain myself. It's just my personal opinion: pure JSP (meaning not with jsf for instance) is simply scripting and is quite far from OO programming. However I never did pure JSP and thats why I'm asking your opinions, because I don't know enough on the subject.

I'm looking for the best choice of technology to spend some time on..

Applet looked like the easy path, but again I read was outdated..

Thanks,
Alex
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

pure JSP (meaning not with jsf for instance) is simply scripting


You've been out of the loop for a while, haven't you?

With JSP 2.0 the move is strongly away from any scripting on the pages, and towards completely scriptless pages using technologies like the JSTL (JSP Standard Tag Library) and EL (Expression Language), and making use of custom actions developed using the new and simpler tag handling mechanisms.

Usually a servlet is used as a front controller to perform any processing, and then forwarding to a JSP page to render the view.
[ January 31, 2006: Message edited by: Bear Bibeault ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

is simply scripting and is quite far from OO programming.

You'll do all the OO programming in Java.
JSP is used for presentation and has all the necessary stuff.

You need to read something about JSP2.0.
There is a good start :
http://www.onjava.com/pub/a/onjava/2003/11/05/jsp.html
(but you'll need to know JSP basics first)
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
yea you could say that.. that I was out of the loop..

Thanks for the tips on jsp2.0.. I'll read more on the subject.

And I guess jsp2.0 is prefered to applets?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

It seems that you have a wrong conception of what JSP is.
The OO programming is done in Java behind.
JSP should be only used for presentation.

You should read something about JSP2.0 first.
http://www.onjava.com/pub/a/onjava/2003/11/05/jsp.html
(JSP basics needed)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Well, they're very different technologies.

Do you want to deliver an applet to the browser, or do you want to create a web application?
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
I see I lack so much of skills on the subject, Im having trouble just to fomulate my questions..


The only front end (web page) I did was with JSF. I had to use my JSF tags from a JSP.

So beside using JSP for JSF, to me, JSP was some scripting... I understand now that JSP 2.0 uses the JSTL... (I guess JSF is just some Extra tags..).

So they're some tags I can use in JSP to do my presentation.

Would it be true to say that JSF is actually JSP with extra tags on top of the Standards ones?

Big thanks to everyone for your help.
I was far far away..

Regards,
Alex
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

JSF is more than a simple collection tags.
From the J2EE Tutorial:

The main components of JavaServer Faces technology are as follows:
# An API for representing UI components and managing their state; handling events, server-side validation, and data conversion; defining page navigation; supporting internationalization and accessibility; and providing extensibility for all these features
# Two JavaServer Pages (JSP) custom tag libraries for expressing UI components within a JSP page and for wiring components to server-side objects
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Alex Turcot:
Would it be true to say that JSF is actually JSP with extra tags on top of the Standards ones?


JSF is just a web framework like Struts and Tapestry are. Do not confuse JSF with JSP/JSTL.

JSP is a server-side J2EE web-tier technology used for presentation.

JSTL is a tag library to use with JSP. Its main purpose is to replace scriplets and make the JSP page clean and clear.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
After going through the whole discussion. I would like to suggest you to learn servlet technology first after that you will get the idea.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

JSF is just a web framework like Struts and Tapestry are. Do not confuse JSF with JSP/JSTL.


I wouldn't call JSF a framework (and would not assimilate it to Struts either), but a technology used to simplify making user interfaces.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Satou kurinosuke:
I wouldn't call JSF a framework (and would not assimilate it to Struts either), but a technology used to simplify making user interfaces.


Sorry if my statement confused you. I meant that JSF is a web framework as popular Struts is a web framework. It doesn't mean that JSF is like Struts or does like Struts. Not at all.
Thanks.
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Thank you all.. I'll start from here.

Even tho I still got everything to learn on this topic, I do have a better overview now.

Thanks again,
Alex
Ramgopal Reddy
Greenhorn

Joined: Jan 28, 2006
Posts: 22
I know JSF is just some extra tags to use in JSP. And, correct me if I'm wrong, JSP is compiled as servlet?


Yes internaly jsp will compailed as a servlet.

JSP looks like a hard road to me.. and a jump in the past.

JSP is not hard,when you know the key part of JSP it is very easy,
For better you gothrough headfirst Servlets and JSP.


Ram's
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
The is a new technology some may name as Ajax. However it's something different. So imagine that you can no M no V no C. Of course you have no servlets, JSP, JSF, taglibs, applets, and many frameworks around them. So what you have? SOA. It means that you have set of service provider objects capable to serve SOAP requests(some name them webservices though). Now you load a static page with JavaScript engine on it. This engine reads UI definition from service providers and render UI, interact with users, validate data and send updates to service providers. So, this technology completely eliminate most of old servelt based technologies. UI coming is very sleek and appealing. So, if you are just starting, then you have a chance to leverage technologies on XXI century.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
 
wood burning stoves
 
subject: web pages: which technology