David Ogasawara

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

Recent posts by David Ogasawara

Thank you for your help! I figured out the problem. I initially set the session variable as a String (session.setAttribute("admin", "Y")). Changing it to a char (session.setAttribute("admin", 'Y')) solved the problem.
16 years ago
Thank you for your assistance. However, I changed the code and it still gives me the incorrect response.

Could the problem be that I'm comparing a String to a char? If so, how is this solved?
16 years ago
I'm new to Struts 2 and I'm trying to figure out why my s:if is not working.

If I enter this:

it returns Y.

However, if I enter this:

It returns No.

What am I doing wrong?
[ May 23, 2008: Message edited by: David Martin ]
16 years ago
Thank you!

I'll give it a shot.

I have a question concerning connection pooling in Tomcat 6. When you close a connection and it is returned to the pool, is it supposed to stay there indefinitely? Is there a timeout that will kill the connection if it is not reused after a few hours?

After running a query, I make sure to close the statement, result set, and connection in a finally statement. However, if I access the database server (SQL Server) I can see the connection still sitting there after over 24 hours. It is "sleeping," but it is still there. My DBA is concerned because our old Java server, JRun, would kill these sleeping connections after a couple of hours of inactivity.

Restarting Tomcat removes all sleeping connections.

So that's how you do it!!!


I'm going to print the page and nail it to my wall.
18 years ago
Thank you for the response! Unfortunately, using HttpRequest does not work. I can initially get it to display the name in the jsp, but after a failed validation, the redisplayed jsp is blank.

EmailAction: get name from database
email.jsp: display name, email field (form action="email")
EmailAction: validate emailAddress (failed) ---> mapping.findForward("failure")
XML: <forward name="failure" path="/email.jsp"/>
email.jsp: name not displayed, email field, error message

I will continue to experiment.
18 years ago
I have a jsp that contains a name (populated from database) and a blank email field. When the user presses the submit button, I validate the email and send it back to the jsp page if it fails.

How am I supposed to redisplay the name? I have been placing it into a session variable, but is that the only/best way? What if I have a lot of variables (name, address, phone, arrays)?

The entire app:
1. jsp -- User enters ID
2. action -- grab name from database based on ID and place in session variable
3. jsp -- display name and ask for email
4. action -- validate email
5. jsp -- display name (problem here), ask for email, display validation error
[ August 09, 2005: Message edited by: David Martin ]
18 years ago
Thank you for pointing me in the right direction. That's something I really needed.
20 years ago
That is exactly what I am doing. I guess it's incorrect?
Here's my class:

20 years ago
Shouldn't I be able to reuse an object? My results are always the same.
(The QueryClass connects to a database and returns the result as a String.)

Here's an example:
QueryClass queryObj = new QueryClass();
String queryObjString_1 = queryObj.QueryClass("select id from user").toString();
String queryObjString_2 = queryObj.QueryClass("select name from user").toString();
Here are the incorrect results (they should not be the same):
queryObjString_1 = 52145
queryObjString_2 = 52145
However, it works when I do this:
QueryClass queryObj_1 = new QueryClass();
String queryObjString_1 = queryObj_1.QueryClass("select id from user").toString();
QueryClass queryObj_2 = new QueryClass();
String queryObjString_2 = queryObj_2.QueryClass("select name from user").toString();
Here are the correct results:
queryObjString_1 = 52145
queryObjString_2 = Dave
Any help would be greatly appreciated.
20 years ago
I'll give it a shot.
Thank you for pointing me in the right direction.
22 years ago
I am having trouble calling a cgi script within my JSP page.
How is this done?
I have a form where the user enters a username and password. When they press the submit button, the parameters are passed to a cgi script on a different server (http://e3.uci.edu/cgi-bin/voter.cgi) which returns a result of 1 or 0.
How do I integrate this into a JSP page so I can manipulate the results?
I think I am supposed to use "dopost," but I can't seem to find much information on it.
Any help would be GREATLY appreciated!
22 years ago