This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Complete JSP Noob - Guide Info Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Complete JSP Noob - Guide Info Please" Watch "Complete JSP Noob - Guide Info Please" New topic
Author

Complete JSP Noob - Guide Info Please

Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
Been using J2SE for a while not and I'm just getting started in J2EE. I just designed my first website by hand using html, htpl, and css. I'd like to try adding some type of JSP or JSF to the site. Not sure what I'll have it do yet. Does anyone have any good guides for making my first JSP? Also, preferably I need it to include html examples on how messages are sent from the html (using forms I take it) to the JSP and handled, etc. Something extremely simple please, like I said, I am a complete web developer novice!

I know I can do a web search, but I find much better information from you guys that have already tried/used it.

Thanks a ton in advance.


SCJA
~Currently preparing for SCJP6
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
Just noticed the JSP FAQ section at the top of the forums. I think I will start there for now unless anyone has any good guide links.

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Be sure that whatever resources you use are up-to-date and avoid JSP scriptlets. The modern standard is to not put Java code in JSP pages, and to focus on using the JSTL and EL.

You might also want to read these JavaRanch Journal articles:

The Secret Life of JSPs

The Front Man

Avoid JSF for now (or in my opinion, forever) -- it'll just confuse you.
[ December 22, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dan Walin
Ranch Hand

Joined: Nov 11, 2003
Posts: 109
You said:


The modern standard is to not put Java code in JSP pages, and to focus on using the JSTL and EL.


Is it ok to add javascript? I find there are many things that seem to only work with javascript in a JSP. For example, dynamically changing selection options depending on the choice the user makes in prior selection choices. If there is a Java way of doing this kind of thing I would be happy to give up dependence on javascript.
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
Thanks Bear!! I'm sorry to hear about the JSF's... those were going to be my next target area for study. I thought using JSF's with Struts was considered "standard" these days?

Well, I want to get a feel for how to do most of these things the "hard way" first so that when I go to using Struts, Spring, or Stripes I can appreciate what it is they are supposedly making easier.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Originally posted by Dan Walin:
Is it ok to add javascript?
Java != JavaScript

If there is a Java way of doing this kind of thing I would be happy to give up dependence on javascript.
Any Java executes on the server in order to format the HTML page to be sent to the client,. Remember, JSP is a server-side concept. Once the page leaves the server, it's just HTML.
[ December 22, 2008: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Originally posted by Brian Legg:
Thanks Bear!! I'm sorry to hear about the JSF's... those were going to be my next target area for study. I thought using JSF's with Struts was considered "standard" these days?
You'll no doubt find other opinions, but I think that JSF is a steaming pile that should never have survived the conceptual phase. If you like to build 5-ton machines full of gee-gaws in order to wipe your mouth with a napkin, JSF may be for you. Personally, I like to use the simplest tool that gets the job done.

Sun's pushing JSF hard, That doesn't make it good.

Well, I want to get a feel for how to do most of these things the "hard way" first so that when I go to using Struts, Spring, or Stripes I can appreciate what it is they are supposedly making easier.
Very wise. Understanding the underlying principles will help you decide what's a useful tool, what's hype, and what just gets in the way.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Brian Legg:
[QB]Thanks Bear!! I'm sorry to hear about the JSF's... those were going to be my next target area for study. I thought using JSF's with Struts was considered "standard" these days?
Those are competitors, so I don't understand how you would use them together.

JSF is great, but you shouldn't start using it before you've a good grasp on JSP/Servlets. Also, you shouldn't be using a visual editor (Netbeans/Visual Studio) to drag'n'drop JSF components at all. Those editors ships with the Woodstock component library which is simply horrible. Dragging'n'dropping would also only lead to more confusion and trouble for newbies, because you won't be able to understand the autogenerated code as long as you don't have a good grasp on JSF (and you get that only by actually understanding it and being able to write it yourself).
[ December 22, 2008: Message edited by: Bauke Scholtz ]
Brian Legg
Ranch Hand

Joined: Nov 07, 2008
Posts: 488
Thanks for the replies all.

"Those are competitors, so I don't understand how you would use them together."

Everything I've read so far on JSF says that they were designed to be used with Struts and they are not competitors at all. This is coming from multiple IBM sources, so you may want to double check that. They do state you can use one or the other but... well, here is a direct quote:


The Struts framework is an open source framework for building Web applications just like the JavaServer Faces (JSF) technology. Both frameworks are intended to help developers apply the Model-View-Controller pattern for Web application architecture.

The Struts-Faces integration library allows developers to use Faces UI components at the front end of their applications, while still allowing the familiar controller function and flexibility of a Struts application. This gives developers the ease of the Faces event listener programming model, the richness of the Faces UI component libraries, the flexibility and control of Struts navigation control, and the power of the Struts validation framework.

When it comes time to decide which framework to use when developing your applications, the choice between JSF and Struts is not mutually exclusive. They are actually intended to be used together effectively in a variety of ways.


As for the comment about using editors, I completely agree! I don't use any drag-drop programs or make-your-life-easier technologies until I do it the hard way and understand it first. Otherwise when you move to a new technology that doesn't support the make-it-easy tools then you have no idea what your doing. My website so far is 100% hand coded, not counting copy/pasting lol.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Brian Legg:

Everything I've read so far on JSF says that they were designed to be used with Struts
Nonsense. They may be able to work seamlessly together, but JSF is certainly not designed for that.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

I wouldn't touch either with a ten-foot pole, but yeah, JSF, a J2EE standard, was not designed to sit atop Struts, a 3rd-party open-source project.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Complete JSP Noob - Guide Info Please
 
Similar Threads
help from Java web developers
Updating part of an html page on button click
access generated html
jasper Exception: unable to compile JSP
Swing or web?