All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docshare.util.RequestHelper Maven / Gradle / Ivy

Go to download

An efficient, fast, convenient, easy to learn, easy to use MVC framework and ORM framework. It is seamless compatible with JSTL and supports FreeMarker. It can run independently, and it can also be applied to traditional Java Web projects. It is an efficient, fast, convenient, easy to learn and easy to use MVC framework and ORM framework. It is seamless compatible with JSTL and supports FreeMarker. It can be run on its own, or it can be applied to traditional Java Web projects

There is a newer version: 2023.06.19
Show newest version
package org.docshare.util;

import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;

public class RequestHelper {
	public static String params(HttpServletRequest request){
		Enumeration enu=request.getParameterNames();
		StringBuilder sb =new StringBuilder();
		boolean isFirst = true;
		while(enu.hasMoreElements()){
			String key=(String)enu.nextElement();
			String val = request.getParameter(key);
			if(val.length()>20) val = val.substring(0,20)+"...";
			if(isFirst){
				isFirst =false;
			}else{
				sb.append(",");
			}
			sb.append(key+"="+val);
		} 
		return sb.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy