Public int CheckParam (HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response. getWriter ();
Enumeration e = request. getParameterNames ();
While (e. hasMoreElements ()){
String parameterName = (String) e. nextElement ();
String parameterValue = (String) request. getParameter (parameterName );
If (parameterValue = null) | (parameterValue. trim (). length () <1 )){
Out. println (parameterName + "cannot be blank <br> ");
Return-1;
}
}
Return 0;
}
Public void PrintAllParameters (HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response. getWriter ();
Enumeration e = request. getParameterNames ();
While (e. hasMoreElements ()){
String parameterName = (String) e. nextElement ();
String parameterValue = (String) request. getParameter (parameterName );
/* Byte B [] = parameterValue. getBytes ("ISO-8859-1 ");
ParameterValue = new String (B );
*/Out. print ("parameter name:" + parameterName + "<BR> ");
Out. print ("parameter content:" + parameterValue + "<BR> ");
Out. print ("---------------------------------------------------------------- <br> ");
}
}
<%
Public void PrintAllParameters (HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response. getWriter ();
Enumeration e = request. getParameterNames ();
While (e. hasMoreElements ()){
String parameterName = (String) e. nextElement ();
String parameterValue = (String) request. getParameter (parameterName );
Out. print ("parameter name:" + parameterName + "<BR> ");
Out. print ("parameter content:" + parameterValue + "<BR> ");
Out. print ("---------------------------------------------------------------- <br> ");
}
}
%>
<%
Enumeration e = request. getAttributeNames ();
While (e. hasMoreElements ()){
String attributeName = (String) e. nextElement ();
String attributeValue = (String) request. getAttribute (attributeName );
Out. print ("variable name:" + attributeName );
Out. print ("variable content:" + attributeValue + "<BR> ");
}
%>
String strs = request. getParameter ("yourstrs ");
Byte B [] = strs. getBytes ("ISO-8859-1 ");
Strs = new String (B );