S Houde

Greenhorn
+ Follow
since Jul 01, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by S Houde

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
20 years ago
JSP
Hello all.
I am learning to use Beans with JSP, utilizing Tomcat 3.2.1. To make a long story short, I've modified server.xml to define a new webapp context, and believe I have my files and classes (WEB-INF\classes) in the correct directory sub-structure(s). The problem seems to be that when attempting to use a bean in a JSP, (regardless of scope) the browser returns a source listing of the JSP. I expect I have an ill-typed character in there somewhere, but if so, I haven't been able to locate it. Is there some general mistake I'm making that this problem is symptimatic of that more experienced deveopers might be able to spot (from experience, or course!). When I comment out the bean references int he JSP, the page seems to be otherwise parsed correctly. In attempting to debug this, I haven't seen any material that references this particular problem.
Well, thanks for any insights that can be cast my way.
- Steve
20 years ago
JSP