david eberhardt

Ranch Hand
+ Follow
since Jul 02, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by david eberhardt

Originally posted by Bear Bibeault:
You didn't show how you are accessing the Card1 property from the JSP. From the error message, I'm assuming you are trying to set it from an int.


Bear;
You steered me into the right direction - the problem was the getCard() methods; orignally I had:

When I set the card1, I brought in the value as a String, when I attempted to get card1, I used an int return type.
So i changed the two methods to be consistent with each other:

For some reason, unknown to me at this time, the getter and setter methods for a particular property (int card1) need to match up in regards to the arg type supplied to the setter and the return type of the getter. This is somewhat of a guess on my part.
thanks for the help.
[ April 02, 2003: Message edited by: david eberhardt ]
21 years ago
JSP
maybe the problem is related to the following:
I send info to the bean from my jsp like this:

in my bean, I set up variables to hold the values sent via "card1" parameter, "card2" parameter, etc like this:

here is the method that is giving me an error msg:

I don't call upon this method from my JSP, but I think it is causing an error because it may be trying to return the parameter called called "card1" which came in as a String from the JSP ???
[ April 02, 2003: Message edited by: david eberhardt ]
21 years ago
JSP

Originally posted by Bear Bibeault:
[QB]You didn't show how you are accessing the Card1 property from the JSP. From the error message, I'm assuming you are trying to set it from an int.


Bear,
my JSp page takes parameters from checkboxes in a form from a previous html page as follows:

here is the line where I get the totalCard value back to the JSP page:

and here is more of the "bean" I'm using:

[b]I never really use the getCard1() method, but if you look at my getCard1() method, you can see that I have changed it from the original.
This works now every time I reboot the computer.
The odd thing to me was that I could get it to work if I changed the case of the getCard1() to getcard1() and recompiled without rebooting BUT if I rebooted, then it would give me the error msg.
NOTED: Your criticism of my setTotalCard() method is noted and I will change those methods !!!
[ April 02, 2003: Message edited by: david eberhardt ]
21 years ago
JSP
I have a web page that is asking the user to select from a choice of check boxes and sned it to a jsp (http://localhost:8080/card_trick_results.jsp) for processing.
the jsp page calls on a javabean (CardTotal.class) to process the logic:
here is some of the code from the top of the CardTotal.java file -

the problem:
When I execute the jps page, the server responds with an error:

org.apache.jasper.JasperException:
Can't find a method to write property 'card1' of
type 'int' in a bean of type 'CardTotal'


now, if I rewrite

public int getCard1 () {
return card1;
}


to note: changing the case of method name)

public int getcard1 () {
return card1;
}


and recompile this class, then the jsp page is able to process and return the correct page result.
If I shut down and reboot the computer and restart tomcat, I get the same sequence of problems again!
anybody know what is happening?
I have a web page that is asking the user to select from a choice of check boxes and sned it to a jsp (http://localhost:8080/card_trick_results.jsp) for processing.
the jsp page calls on a javabean (CardTotal.class) to process the logic:
here is some of the code from the top of the CardTotal.java file -

the problem:
When I execute the jps page, the server responds with an error:

org.apache.jasper.JasperException:
Can't find a method to write property 'card1' of
type 'int' in a bean of type 'CardTotal'


now, if I rewrite

public int getCard1 () {
return card1;
}


to

public int getcard1 () {
return card1;
}


and recompile this class, then the jsp page is able to process and return the correct page result.
If I shut down and reboot the computer and restart tomcat, I get the same sequence of problems again!
[b] anybody know what is happening?
21 years ago
JSP
Mike Curwen,
Thanks Mike.
OK - I read up some more on this whole thing at Configuring & Using Apache Tomcat 4
I specifically looked at Configure Tomcat - part "3. Enable the Invoker Servlet"
it starts by explaining:

The invoker servlet lets you run servlets without first making changes to the WEB-INF/web.xml file in your Web application.


then they mention that it has been turned off due to security flaw.
So now I understand you post a little more also - that without the default invoker servlet, you have to define things in each web.xml file per Web application (i.e. \examples)
THANKS.
[ March 23, 2003: Message edited by: david eberhardt ]
21 years ago
You may want to review this article:
Demystifying Tomcat 4's server.xml File
see page 2 - maybe the following settings make a difference?;

The <Context> Element
reloadable: If set to true, causes Tomcat to check for class changes in the WEB-INF/classes/ and WEB-INF/lib directories. If these classes have changed, the application owning these classes will automatically be reloaded. This feature should only be used during development. This setting will cause severe performance degradation, and therefore should be set to false when in a production environment.


The HTTP Connector
bufferSize: Specifies the size, in bytes, of the buffer to be provided for use by input streams created by this connector. Increasing the buffer size can improve performance, at the expense of higher memory usage. The default value is 2048 bytes.


The article seems to suggest some changes are in order going from (development - localhost) to (production - your web host server) ???
let me know.
21 years ago
Hi Jason
I'm looking at http://www.subsgalore.com:8080/subsgalore/OrderInit.do page in IE 6.0 ...
it appears the same everytime I refresh (and I've deleted temp internet files between refreshes).
so it appears I cannot duplicate your indications ...
question: can you tell us which code you are editing out? is it simple html you're deleting or jsp syntax?
[ March 23, 2003: Message edited by: david eberhardt ]
21 years ago
glad it worked John.
I spent a few days on that one myself.
now I'm trying to learn why it worked ....
21 years ago
John,
you might want to look at Dirk Schreckmann's comments in this thread --> https://coderanch.com/t/82236/Tomcat/requested-resource-not-availabe
21 years ago
Thanks Dick - I was having the simalar problems until I came accross "Take another look at ?the aforementioned thread
My particular problem was that I could call on the sample servlets and they ran fine but when I tried to put one of my own in the root/web-inf/classes directory, I'd get the server error also.
found the code you mentioned in the web.xml file starting at :

But I am wondering -
how come calling "http://localhost:8080/examples/servlet/HelloWorld" works before I made that change
while "http://localhost:8080/servlet/HelloWorld" did not
[ March 20, 2003: Message edited by: david eberhardt ]
21 years ago

Originally posted by Berciu Ioan:
Hi, I want to write a jdbc driver for an access database and I could use some help (source code or links maybe a tutorial on how to do it).Don't want to use odbc just jdbc to connect to the database.One more question : is it possible to connect to a database just specifing the path and the name of the database ?
Tanks.


see "Displaying Records from the Database with Java Servlets by Faisal Khan.
http://www.stardeveloper.com:8080/articles/display.html?article=2001062501&page=1

Originally posted by Valentin Crettaz:
Nice shot David


Thanks much!
Just got a call from a recruiter tonight looking for a junior java programmer ....
I'll keep folks posted on this development.
Certification - it helps!
21 years ago
hey, Thank you everybody!
Manish Hatwalne
Ruff Young
Dan Chisholm
Svend Rost
now it's on to landing that next good job!
david eberhardt
Danbury, CT
21 years ago