Hey Bear,
Thnx for the welcome... its been a while, sorry for the delay here. I'm working thru a book 'JSP Weekend Crash Course', if that helps.
Anyway, below are the html page, JSP page and bean source. To reiterate, the problem is that when submitting the html, which should call the JSP page (includes bean), the result is that the browser just displays the text contents of the JSP page. I'm uising Tomcat 3.2.1,
Java 1.3
Anyway here goes...
*** HTML: FruitOrder.html ***
<HTML>
<BODY>
<h2>
Fruit Order Form</h2>
Fruit:Mango<br>
Color:Orange<br>
Price PER Pound: $5.95 <br>
<FORM action="confirm.jsp" method="post">
Number of Pounds: <input type="text" name="quantity"><br>
<input type="submit" value="Order Fruit">
</FORM>
</BODY>
</HTML>
*** confirm.jsp ***
<jsp:useBean id="orderedFruit" class="Fruit" />
<jsp:setProperty name="orderedFruit" property="fruitName" value="Mango" />
<jsp:setProperty name="orderedFruit" property="color" value="Orange" />
<jsp:setProperty name="orderedFruit" property="price" value="5.95" />
<jsp:setProperty name="orderedFruit" property="quantity" param="quantity" />
<HTML>
<BODY>
<h2>Your Fruit Order:</h2>
<br><br>
Fruit: <jsp:getProperty name="orderedFruit" property="fruitName" /><br>
Color: <jsp:getProperty name="orderedFruit" property="color" /><br>
Price: $<jsp:getProperty name="orderedFruit" property="price" /><br>
Quantity: <jsp:getProperty name="orderedFruit" param="quantity" /><br>
Total: $<%=orderedFruit.getPrice()*orderdedFruit.getQuantityInPounds() %>
<p></p>
<a href="FruitOrder.html">Return to order form to adjust a quantity</a>
</BODY>
</HTML>
*** Fruit.java ***
public class Fruit {
private
String fruitName;
private int quantity;
private String color;
private boolean isCitrus;
private float price;
public String getFruitName() { return this.fruitName; }
public void setFruitName(String name) {
this.fruitName = name;
}
public int getQuantityInPounds() { return this.quantity; }
public void setQuantityInPounds(int quantity) {
this.quantity = quantity;
}
public String getColor() { return this.color; }
public void setColor(String color) {
this.color = color;
}
public float getPrice() { return this.price; }
public void setPrice(float price) {
this.price = price;
}
public boolean isCitrus() { return this.isCitrus; }
public void setCitrus(boolean isCitrus) {
this.isCitrus = isCitrus;
}
}
The bean compiles without exception. Apologies for the volume here, but thanks for taking the time to help, and encourage.
Steve