aspose file tools*
The moose likes JSP and the fly likes Simple examples of JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Simple examples of JSP" Watch "Simple examples of JSP" New topic
Author

Simple examples of JSP

dhwani mathur
Ranch Hand

Joined: May 08, 2007
Posts: 621
Hi all


can anyone help me
on to where i can get some simple
examples in JSP for practice as i am a beginner
which things i must practice in order to
move towards creating a gud web page.
Thanks in advance.

Dhwani:>Its always too soon to quit.
Nalini Gupta
Greenhorn

Joined: Dec 21, 2007
Posts: 4
For designing a good web page you need good knowledge on HTML,JSP is for handling dynamic requests and responses as simple static HTML cannot do,

Do excercise on basic tags how to include java code etc..

I hope you understand
:thumb:
Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
It would be better if you go through some good book like 'Head First servlets & JSP'


Hakuna Matata!
dhwani mathur
Ranch Hand

Joined: May 08, 2007
Posts: 621
hi thr

thanks Nalini and Pranav for your kind help

but now i am in one more doubt if anyone can help

me on it i have created a html web page in
dreamweaver now on the
form action event i need to call a jsp
in order to pass data from html form
to jsp for furthur processing


so i am confused now to where i must write
my code for jsp in dreamweaver?



below shown is my code if anyone can help




any help on the above will
be realy
great thanks in advance

Dhwani:>Its always too soon to quit.
dhwani mathur
Ranch Hand

Joined: May 08, 2007
Posts: 621
Hi All!!!

i am happy to inform that i have
created a JSP but now


i am in a different
doubt i am veryfying my abc.jsp using
web browser option it shows a window saying
write name of your site now what i must
write here ?or it gives other option below saying
create FTP server etc...


i am working in LAN
ie i am working on client machine so will
i proceed now please if anyone can help

it will be realy great thanks in advance

Dhwani:>Its always too soon to quit.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Howdy, partner.

Here's a simple example where you send 2 parameters to a JSP page.
This first page can be pure HTML (you can call it form.html):



Note that on the action attribute of the form tag, we're specifying a page called result.jsp. This is the page that will receive these parameters, and in this case it has to be in the same directory of the form.html page. Here's the code of the result.jsp page:



Now, just check the form.html page, hit the Submit button and your form will be submitted. A tip for you: take a look at some JavaScript samples too... learn the main HTML tags and their attributes... learn as much as you can about Java and good OO design... then, read the Head First! Servlets and JSP book, and you'll find a lot of nice things! You'll learn that a JSP page is not the place to put Java code boy, there are so many things to learn!

Well, I hope this helps.
Take care, partner.
[ December 28, 2007: Message edited by: Roberto Perillo ]

Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

Originally posted by Roberto Perillo:
You'll learn that a JSP page is not the place to put Java code

Robert is quite correct.

Since you are just starting out, developing good coding habits at the start is always a good idea. JSPs should not be used for processing data, but to create the display. As such, your action should submit to a servlet (rather than a JSP) to perform the data processing. When the servlet is finished with its job, it can forward to a JSP to show the results.

There are some articles that might be helpful to you at this point. Please take a look at this article and this article.
[ December 28, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple examples of JSP