• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Simple examples of JSP

 
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be better if you go through some good book like 'Head First servlets & JSP'
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
I will suppress my every urge. But not this shameless plug:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic