aspose file tools
The moose likes Other Application Frameworks and the fly likes Spring mvc question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "Spring mvc question" Watch "Spring mvc question" New topic
Author

Spring mvc question

jeff mutonho
Ranch Hand

Joined: Apr 30, 2003
Posts: 271
How do I avoid doing this and use some validation mechanism for the
request parameters:

String n1 = request.getParameter( "n1" );
String n2 = request.getParameter( "n2" );
.....
....
String n100 = request.getParameter( "n100" );

if ( n1 == null ) {
n1 = "";
}

if ( n2 == null ) {
n2 = "";
}
......
......

if ( n100 == null ) {
n100 = "";
}
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1209

If these are JavaBean properties and you are using a Command/Form Controller you could use a custom property editor that sets a property to empty String if the corresponding request parameter value is null.
 
 
subject: Spring mvc question
 
Threads others viewed
java regex group capture
problem in session
TIJ 3 problem at simpeltest
Shift operators
Fibonacci
MyEclipse, The Clear Choice