rostom aghanian

Greenhorn
+ Follow
since Aug 10, 2001
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 rostom aghanian

The ideal way of doing this when working with JSPs is by using JSP Beans. There are some tutorials and examples available on www.javaworld.com. Basically it involves posting the form data to the same page you are currently on, sending the user entered data to the server, validating it, and then returning an object (usually a hashmap) of error codes which are displayed if any errors were found. If no errors are found the JSP does a redirect to the next proper page.

Originally posted by Moined Mogul:
I seem to have quite a bit of javascript within my JSP just doing simple authentication of user inputted data which will throw an alert to the user if something they entered does not meet the criteria I have defined.
I want to try and limit the business logic as much as possible within my JSP by getting rid of this javascript.
Could someone please suggest some alternative methods and give some examples of throwing something similar to a javascript alert if the user enters something that does not meet the criteria of the text box???
Thank you!



------------------
rostom
22 years ago
Storing the whole html file in the database is a BAD BAD idea. All you need to do is to store the text that the user entered. Then build html/jsp/asp pages seperately which will display this data.
This is so that your presentation is seperated from your data. If you store the whole html file, not only are you taking up an unnecessary amount of space in the database, but you will run into difficulties down the road if you decide to change the look of your web site (i.e. all entries in the database will have to be touched).

Originally posted by Sean Casey:
Hi,
This may be a basic question. Is there any way to store files as a whole in databases? Or can I just store the information stored in the files? I've got MySQL running and I want to implement a simple message board using servlets. I figured I could save each message as an html file and then store it in the database. Alternatively, I could store the files data and then convert it back to html at the other end? Any suggestions or resources would be greatly appreciated.
Thanks,
Sean



------------------
rostom