473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Server Side Validation

I want to create a JSP Form page on Tomcat with a form that has about 10 input entries where the form will validate all 10 fields and show validation errors on the same page as the original form JSP page.

For example, if someone has a blank entry on the Firstname field then it will show this message in red next to the field: First Name is required.

If the data passes the validations it will populate an Oracle database. Please advise any suggestions on how I should do this. I was thinking of submitting the fields to a Controller servlet then use the Enumeration class to get all field values where I would check for blanks. I assume if I use a bean and have a getter and setter method for each field I would then have 20 methods (10 setter and 10 getter methods) in the bean class.

I dont have Struts due to certain restrictions and need to know the best way to do this. Can anyone give me ideas or examples of how do to this?
Aug 6 '07 #1
1 3840
sumittyagi
202 Expert 100+
I want to create a JSP Form page on Tomcat with a form that has about 10 input entries where the form will validate all 10 fields and show validation errors on the same page as the original form JSP page.

For example, if someone has a blank entry on the Firstname field then it will show this message in red next to the field: First Name is required.

If the data passes the validations it will populate an Oracle database. Please advise any suggestions on how I should do this. I was thinking of submitting the fields to a Controller servlet then use the Enumeration class to get all field values where I would check for blanks. I assume if I use a bean and have a getter and setter method for each field I would then have 20 methods (10 setter and 10 getter methods) in the bean class.

I dont have Struts due to certain restrictions and need to know the best way to do this. Can anyone give me ideas or examples of how do to this?
Hi oaklander,
Welcome to TSDN.
**Server side validations are much safer, but consume more resources and take time.
Client side validations are less resource intensive, and gives a good user experience.
So you need to do some trade offs while picking up the approach.

Disadvantages of server side validation:-
1. resource intensive. You need to reach the server again and again(if validation fails).
2. Time consuming. If network is slow then user could get frustrated.

Disadvantages of client side validation:-
1. if javascript is disabled on the client machine, then no validation will occur.
2. if someone wishing to corrupt your data, he/she can by-pass your javascript validations (search google to know how it can be done).

So keeping in mind these points when you design your application.
One solution is do general validations which are not critical (eg:- if a field is empty) on client side and do critical validations on server side.

other way is you could use AJAX techniques, so that user can do his work and validation requests go to the server asynchronously.
Aug 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Hernán Castelo | last post by:
should i to validate all the "Request"s calls like Request.FORM("...") and Request.Cookies("...") ???? if it is so, i have to see inside every "Input" elements like "Text" and even "Hidden"...
4
by: earwicker | last post by:
I recently deployed a web application which contains a user registration form with the usual fields: name, address, email, password, etc. Each of the TextBoxes uses a validation control to verify...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: John Chan | last post by:
Hi, Im doing a maintenance application in ajax and coldfusion at work on IE6 exclusively. I have a save button on each form and i have to do various validations server side and on client side...
5
by: =?Utf-8?B?dXNmaW5lY2F0cw==?= | last post by:
I'm new to asp.net. I'm trying to follow the tutorial walkthroughs and have got a few done. Now I'm doing the one about validating input, and I've run into some problems. In particular, I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.