Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 16th, 2004, 01:25 PM
Authorized User
 
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Martyn,
The book that i am using is Beginning JSP 2.0
Building Web Applications using JSP, JAVA, and Struts.

Would you mind forwarding me on your copy of your code the pizza example please if you don't mind so that i can compare.
Thanks,
Ps , I have not programmed in Perl before,
Done c,c++, and java but not perl.

PW
 
Old January 16th, 2004, 01:33 PM
Authorized User
 
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I downlaoded the code for this book of the following website.


http://support.apress.com/books.asp?bID=1861008317&s=0
Thanks
Patrick

PW
 
Old January 16th, 2004, 01:58 PM
Authorized User
 
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Martyn,
Sorry to bother you again!!!
Just to let you know.I removed Tomcat version four from my machine and installed tomcat version 5.0.16.exe
I then executed both of these programs again and they worked fine this time.
You know the class "param" that is being used in the process.jsp example , was this package included with the java standard tag library?
Thanks
Pat

PW
 
Old January 17th, 2004, 09:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm glad that you managed to solve your problem by installing Tomcat 5. I don't have much experience with anything other than version 3.2.1 and hardly any experience of Struts, etc., we will be upgrading soon, so hopefully I will be of more help to you then. I guess that the fact that I got confused over which book you were using didn't help. Quite how I've managed to be any help to you at all is beyond me, so let me take this opportunity to applogise for any confussion that I may have caused you.

Please don't hesitate to ask if you think that I can be of any help to you in the future.

Cheers

Martyn
 
Old January 17th, 2004, 09:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Patrick,

Here are the code examples that you asked for:

pizza.html
----------
<html>
<head>
  <title>Wrox Pizza's...Order Now!!!</title>
</head>

<body>
  <form action="process.jsp" method="post">
    <b>Name:</b>
    <input type="text" name="name" size="30"><br>
    <b>Address:</b>
    <input type="text" name="address" size="70">

    <br><br>
    <input type="radio" name="purchaseType" value="Home Delivery">
    <b>Home Delivery</b>
    <br>
    <input type="radio" name="purchaseType" value="Take Away">
    <b>Take Away</b>
    <br><br>

    <b>Select your pizza(s)...</b>
    <br>
    <input type="checkbox" name="margherita" value="Yes">
    <b>Margherita</b>
    <br>
    <input type="checkbox" name="hawaiian" value="Yes">
    <b>Hawaiian</b>
    <br>
    <input type="checkbox" name="pepperoni" value="Yes">
    <b>Pepperoni</b>
    <br><br>

    <b>Options...</b>
    <select name="size">
      <option>Small</option>
      <option selected>Medium</option>
      <option>Large</option>
    </select>
    <br><br>

    <input type="submit" value="Place Order">
  </form>
</body>

process.jsp
-----------
<html>
  <head>
    <title>Wrox Pizza's: New Order</title>
  </head>

<body>

  <b>Name:</b>
  <% out.println(request.getParameter("name")); %>
  <br>
  <b>Address:</b>
  <% out.println(request.getParameter("address")); %>
  <br>
  <b>Delivery:</b>
  <% out.println(request.getParameter("purchaseType")); %>
  <br>
  <b>Margherita?</b>
  <% out.println(request.getParameter("margherita")); %>
  <br>
  <b>Hawaiian?</b>
  <% out.println(request.getParameter("hawaiian")); %>
  <br>
  <b>Pepperoni?</b>
  <% out.println(request.getParameter("pepperoni")); %>
  <br>
  <b>Size:</b>
  <% out.println(request.getParameter("size")); %>
  <br>

</body>

</html>


Cheers

Martyn





Similar Threads
Thread Thread Starter Forum Replies Last Post
Plz give the advise about Sql 9i syllebus gemsuis Oracle 0 July 4th, 2006 02:23 PM
Please have a look and advise on my join mat41 SQL Language 2 August 9th, 2005 06:22 PM
OO Advise and Clarification rodmcleay General .NET 1 October 14th, 2004 09:51 PM
Problems with Java Mail Please advise "Chapter 9" PatrickWalsh JSP Basics 1 September 5th, 2004 06:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.