Thomas Harrington

Greenhorn
+ Follow
since Mar 29, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Thomas Harrington

I use a bean, so this may be different from what you are looking for but maybe it will help. I have an inner class in my bean which takes a string, and then has a Delete FROM XyourtableX WHERE XnameofvalueqeuriedX = "?". the XyourtableX should be the name of your table, and the XnameofvaluequeriedX should be the value you are using to find the enrty to delete. I use the primary key, as there can only be one and you will not delete multiple entries that way.
The JSP which processes the removal of the checked items should retrieve the values of the checked boxes, probably by using request.getParameter(), where you have some variable equal it and name that whatever you want to pass to the bean.
BTW, there was a great example of what you are trying to do with Begenning JSP Web Services Programming by Wrox. They have an example like what you are trying to do. I think you can download the sample code from their website.
21 years ago
JSP

Originally posted by Randall Twede:
its a matter of not re-inventing the wheel..the existing cgi(s) that comes with UBB works just fine, so why change it?


The reason why is to show the world that you can do it with java, and do it better. All you would need is Tomcat, MySql, and some code. I am sure we could build this site in all Java.
21 years ago
Why do you use CGI and not JSP. This *is* a java site, right? What is next, ASP?
21 years ago
i figured it out. i was missing the session tag. i added a session and it works now.
21 years ago
JSP
i have two tables in a database: one has user names and passwords and a second table has bbs data. i use the first table to log people in. i would like to pass on the user data from the login page to every other bbs page that person my visit. the request.getParameter() does not work because i guess the variable is not defined in a tag. and i can not just call the variable from the bean either. should i make a seperate class with a getter and setter, or is their a predefined method for passing a value between many pages?
ultimatley what i would like to have happen is to have the users name automatically included in the post, without giving the option of the person changing the name of the poster.
21 years ago
JSP
Thanks!!! It works great.
21 years ago
JSP
I can not get this to work. I have a table in a databse where I have users and passwords. I want to check if the values in the table are the same. If they are the same, I want it to print "a"; if the values are not the same i want it to print "B". It always prints "B" regardless if the entries are the same or not.

String aUser;
String aPass;
users.connect();
ResultSet rs = users.viewUser();
while (rs.next () ){

aUser = rs.getString( "wname" );
aPass = rs.getString( "wpass" );
if( aUser == aPass ) out.println( "a" ); else{ out.println("B"); }

}
[ April 18, 2003: Message edited by: Thomas Harrington ]
21 years ago
JSP
Thanks for the input. Unfortunatly, I do not know Perl, and I would not know how to incorporate it with Java. The way I have my bbs structured is with a database housing all the posts, a JavaBean controlling access to the database, and servlets formatting the data for display in the JSP page. I am not that worried about security, and I have specific methods in the JavaBean for accessing the database. As long as those methods are unknown to the public, I think security will be high. Perhaps I should adjust Tomcat so it only allows IP's from outside localhost on just the introduction page. That way, every other page I am hosting would have to be reffered from another page on my server or they would get an error page.
One other question. If I do not want to allow users to add code to a post, what is the easiest way of doing that. Should I just go through all the text and remove any brackets?
Sorry if I am rambeling, but it helps me to think out loud before I start coding, because once I start to code my field of thought becomes narrow. So I ramble alot before I code.
That is a great idea about letting users decide their own color schemes. I am going to add that now. I think I will start with adding three color schemes, and run it through an if statement in the jsp. I wonder how I should save the setting for the user, so it is remembered every time the person visits. Maybe I will add a table to the DB with user and colorChoice fields, and save there. Thanks for the idea!
BTW, do you like threaded forums better than those like YaBB or vBulleten? Yabb seems to have one page with topics, then you click on the link and it takes you to the all the posts of that topic. A threaded bbs would have all the posts and repsonces on one page bulleted by subject. You would click on the subject for that one post. That way you could easily see all the posts, instead of just the subjects, although it would require a little more clicking.
i wrote everything but the gui for a bbs board. right now i have some jsp showing the data, but it is a bit ugly. what i need is someone to show me some bbs/messege boards which look nice. i need to be inspired. any links to good looking (regardless of content) bbs's would be appreciated.
thanks.
if you are using mysql as the database, a good example is included in "begenning jsp web development" by wrox press. get the jconnector, it will have everything you need to connect to the database. the paramenters can be passed from webpage to webpage, and when the user clicks to confirm the data, then you can use the bean to send the data to the database.
21 years ago
JSP
i do not remember the specifics, but i will try and help.
use the IO class. there should be methods there which will create a file, and methods which will write to it or append to it.
i wish i had some code to give you, but it is on my laptop which i do not have access to right now.
oh, one place i think is great is java.sun.com, click on jsdk1.4 and then the api for it. you will have a listing of all the classes. go to the io class and you should have everything you need.
you may have to save the file on the server pc? i am not sure if you could directly send it to the client. but you could have a link in a .jsp indicating the file has been made and have a link to the txt file, then the person should be able to download it if they need it.
21 years ago
JSP
here are my 2 cents...
i would hope this stays a java site, and not a place where people come to vent fustration. if i found myself having to defend/argue opinions instead of learning about java, i would stop comming as often. i like this site because it is like a professional job with casual attire. it is focused, but not stuffy.
i also think the owner can do whatever he wants. he owns the place. he was nice enough to invite everyone to come here to discuss java. why not say thank you instead of complaining?
in other words, he is giving us something valuable for free. i learned things here i now use at work. anyways, i like the place and hope it remains focused on java.
[ April 04, 2003: Message edited by: Thomas Harrington ]
21 years ago