943,852 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 8709
  • JSP RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 20th, 2007
0

Help for learnign JSP

Expand Post »
hi to all

well i know html, css javascrpit php apache and mysql. but now i am learning jsp and I DONT HAVE ANY JAVA PROGRAMMING EXPERIENCE!!!


uptill now i just cant figure out whats java and jsp all about well i know its a serverside scripting for web development in java but to start validating forms creating shopping carts and ecommerce online transactions wowow that gonna be very veyr tough please help


thanks
Reputation Points: 11
Solved Threads: 1
Junior Poster
anastacia is offline Offline
142 posts
since Nov 2004
Mar 21st, 2007
0

Re: Help for learnign JSP

Hi

Why dont you give a try to http://www.jsptut.com/

May be it will help you out


suMit
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
staneja is offline Offline
63 posts
since Dec 2006
Mar 21st, 2007
0

Re: Help for learnign JSP

Quote ...
but to start validating forms creating shopping carts and ecommerce online transactions wowow that gonna be very veyr tough please help
And that's why you should start small...
Baby steps, not giant leaps.

And do NOT use that linked tutorial. It's about 7 years out of date, and teaches you exactly how you should NOT work.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Mar 21st, 2007
0

Re: Help for learnign JSP

Very funny
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
staneja is offline Offline
63 posts
since Dec 2006
Mar 21st, 2007
0

Re: Help for learnign JSP

it's not funny at all that people still think scriptlets are a pretty neat idea.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 3rd, 2007
0

Re: Help for learnign JSP

hi jwenting, I am also new to jsp. what do you suggest.
I am looking at reducing my learning time tremendously. I am ready to work. Already a programmer 12 yrs. Looking at java and jsp but have little know-how. I was already looking at the tutorial before i saw your advice.
Will be glad to hear from you.
I hope this does not qualify as a private message asking for help

Click to Expand / Collapse  Quote originally posted by jwenting ...
And that's why you should start small...
Baby steps, not giant leaps.

And do NOT use that linked tutorial. It's about 7 years out of date, and teaches you exactly how you should NOT work.
Reputation Points: 215
Solved Threads: 6
Posting Whiz in Training
jamello is offline Offline
219 posts
since Oct 2006
Apr 4th, 2007
0

Re: Help for learnign JSP

Get yourself some good books.
Head First Servlets and JSP for starters, and O'Reilly's JSP book (be sure to get the 3rd edition or later, the others are outdated).

Install Tomcat, read those books, and start experimenting.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Apr 13th, 2007
0

Re: Help for learnign JSP

Now I have not seen the site in the link above and jwenting and I have had words over "opinion" about what is right and what is not... Unfortunately, I find his posts to be very little help to most people, he seems to want to post to everything but usually says little more than, "good luck", or "go find out for yourself" type of things... which is just what he has done here... How can he be a moderator when he doesn't wish to help people, and his posts are so negative, I have no idea...

There is nothing wrong with learning to code however it works for you... You can learn using scriptlets, then when you feel comfortable you can move the scriptlets into a custom tag library, a change which takes very little effort. Then you can, if you choose, build robust servlet MVC applications...

He loves to say that things are 7 years out of date and since that site has been registered for 7 years he would have you believe the content was outdated the moment it was published...

Do what works for you, but don't stop learning just because you found 1 way, always search for newer, better ways, and don't get a closed mind like some people we know...

When you actually know what you're doing help people on tech lists rather than just shine them on, and remember the ancient Japanese proverb... "Junin Toiro" roughly translated... "10 people, 10 colors" which sounds more pleasant than the equivalent English phrase, "Different Strokes for Different Folks"... "Different Strokes" now that was a good TV show ;-)

Peace,
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
rgtaylor is offline Offline
83 posts
since Mar 2007
Apr 13th, 2007
0

Re: Help for learnign JSP

Now, for some programming advice...

using Java & JSP is not so hard...
You can put all the code into the JSP pages, you can separate some or all of your logic into servlets (small independant routines that run on the server) and leave you presentation logic in jsp files... you can use beans to store data between for passingbetween the logic and jsp, or jsp to jsp, and you can create custom tags to do specific logic that is unique to your site...

in the begining jsp did NOT have any way to loop through a code sequence repeatedly... this was a great weakness of JSP and so developers were forced to either
a) limit their output to fixed number of itterations... troublesome at best

b) create custom tags that would cause a loop.... common in professional applications where they wanted to hide the code...

c) use embedded Java (scriptlets) inthe code to control the loop...

This is just one example of why scriptlets were frequently needed.

Beans can also do more than just store information, you can program any logic into the bean code and trigger it either by the bean constructor or by a call into the bean from the jsp page... this use of beans removes the need, almost entirely, for servlets...

Then there is the MVC which stands for Model View Controller, a fancy way of saying separate logic, data storage "state", and presentation... in the MVC architecture model jsp "shows" the content to the user, and collects data via forms from the user... the forms are sent to the servlets on the server... the servlets handle the logic of processing the data and determine the results... the servlets place any output data, results, etc. into beans objects and save those into a scope that will persist, request, session or application... depending upon the need... the servlet then "forwards" the request to a jsp page, logic can choose between jsp pages if you like, to determine which one to show... this is a unique feature of Java over most other web coding languages... Java can pass the request off to another page, etc. to finish processing... most others cannot do that... that means that the servlet that processes your form, could pass the request to another servlet, and another and antoher, etc. prior to passing it off to the jsp page.... the jsp page, of course, shows the output....

This makes it easier to work in larger projects because it encapulates the code segments into logically related pieces and they are "pluggable" meaning they don't care what the other pieces do, or how, they just do what they do... you can modify the jsp page to chnage the display, without any effect on the servlet, or bean....

Oh, the bean, I forgot to mention... the data that was saved int he bean, because the bean was saved in a scope that persisted, canbe read from the jsp page so it know exactly what the results of the servlet processing were... at least the part it cares about...

jsp's key items are useBean, getProperty and setProperty... for accessing those beans...

Servlets are a bit more trickly but basically they are Java Classes that extend the HttpServlet class and implement the "action" methods of that parent class, but only the ones you need... so you can only worry about what you need... frequestly these are doPost and doGet...

Beans are just Java classes which usually store properties as private variables, and use methods to set or get the values of these properties... as I said, they can do much more too, but they don't have to...

it can be as simple as

private String name = "";

public void setName(String name){
this.name = name; // this.name keyword indicates the bean's name variable as opposed to the local name variable
}

public String getName(){
return this.name;
}


database access from a jsp, servlet or bean is a simple matter... I created a class file in which I place my connection code so I can obfuscate the passwords and usernames for db access, something that is hard to do in ASP, php, etc...

The rest of building you high end applications is the creative use of JSP, Java, Javascript, CSS, HTML, XML, databses and etc. most of which you already know...
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
rgtaylor is offline Offline
83 posts
since Mar 2007
Apr 17th, 2007
0

Re: Help for learnign JSP

thanks rgtaylor for your reply. It is pretty much appreciated
I am very much involved with microsoft ASP.Net. Do you have any knowledge of this environment. If the answer is yes, can you highlight the asp.net counterpart or parallels of the features you just itemized in jsp. This would aid my "birdseye view" understanding of the subject matter. Thanks alot man!(I presume)

Click to Expand / Collapse  Quote originally posted by rgtaylor ...
Now, for some programming advice...

using Java & JSP is not so hard...
You can put all the code into the JSP pages, you can separate some or all of your logic into servlets (small independant routines that run on the server) and leave you presentation logic in jsp files... you can use beans to store data between for passingbetween the logic and jsp, or jsp to jsp, and you can create custom tags to do specific logic that is unique to your site...

in the begining jsp did NOT have any way to loop through a code sequence repeatedly... this was a great weakness of JSP and so developers were forced to either
a) limit their output to fixed number of itterations... troublesome at best

b) create custom tags that would cause a loop.... common in professional applications where they wanted to hide the code...

c) use embedded Java (scriptlets) inthe code to control the loop...

This is just one example of why scriptlets were frequently needed.

Beans can also do more than just store information, you can program any logic into the bean code and trigger it either by the bean constructor or by a call into the bean from the jsp page... this use of beans removes the need, almost entirely, for servlets...

Then there is the MVC which stands for Model View Controller, a fancy way of saying separate logic, data storage "state", and presentation... in the MVC architecture model jsp "shows" the content to the user, and collects data via forms from the user... the forms are sent to the servlets on the server... the servlets handle the logic of processing the data and determine the results... the servlets place any output data, results, etc. into beans objects and save those into a scope that will persist, request, session or application... depending upon the need... the servlet then "forwards" the request to a jsp page, logic can choose between jsp pages if you like, to determine which one to show... this is a unique feature of Java over most other web coding languages... Java can pass the request off to another page, etc. to finish processing... most others cannot do that... that means that the servlet that processes your form, could pass the request to another servlet, and another and antoher, etc. prior to passing it off to the jsp page.... the jsp page, of course, shows the output....

This makes it easier to work in larger projects because it encapulates the code segments into logically related pieces and they are "pluggable" meaning they don't care what the other pieces do, or how, they just do what they do... you can modify the jsp page to chnage the display, without any effect on the servlet, or bean....

Oh, the bean, I forgot to mention... the data that was saved int he bean, because the bean was saved in a scope that persisted, canbe read from the jsp page so it know exactly what the results of the servlet processing were... at least the part it cares about...

jsp's key items are useBean, getProperty and setProperty... for accessing those beans...

Servlets are a bit more trickly but basically they are Java Classes that extend the HttpServlet class and implement the "action" methods of that parent class, but only the ones you need... so you can only worry about what you need... frequestly these are doPost and doGet...

Beans are just Java classes which usually store properties as private variables, and use methods to set or get the values of these properties... as I said, they can do much more too, but they don't have to...

it can be as simple as

private String name = "";

public void setName(String name){
this.name = name; // this.name keyword indicates the bean's name variable as opposed to the local name variable
}

public String getName(){
return this.name;
}


database access from a jsp, servlet or bean is a simple matter... I created a class file in which I place my connection code so I can obfuscate the passwords and usernames for db access, something that is hard to do in ASP, php, etc...

The rest of building you high end applications is the creative use of JSP, Java, Javascript, CSS, HTML, XML, databses and etc. most of which you already know...
Reputation Points: 215
Solved Threads: 6
Posting Whiz in Training
jamello is offline Offline
219 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: how to get day on particular date
Next Thread in JSP Forum Timeline: jsp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC