
July 2nd, 2002, 05:06 PM
|
|
Contributing User
|
|
Join Date: Jun 2002
Location: Boston, MA
|
|
Tough question. There's really not enough info there to address it well, so forgive me if I missed your point.
It looks like you have declared (somewhere, at some point) a Vector v1.
It also appears that this Vector contains form data and checkbox info that needs processing. Right so far?
If I am correct, I'd suggest that you write a separate void class that accepts a Vector and pass v1 to this class:
Code:
public void processV1(Vector v1){
synchronized(v1){
. . .
}
. . .
}
Another possibility:
Code:
Vector v1 = parametersToVector(request.getParameterNames(), request);
public Vector parametersToVector(Enumeration enumeration, HttpServletRequest request){
Vector v = new Vector();
String param;
if(enumeration == null) return v;
// process Hashtable of parameters
while( enumeration.hasMoreElements() ) {
try{
param = enumeration.nextElement();
}
catch(NoSuchElementException nsee){}
. . .
}
}
Kind of awkward using the second way. It's a good idea to whisk the logic out of the page though.
If I didn't answer you question, provide more detail.
|