All pastes #130104 Raw Edit

yassine

public java v1 · immutable
#130104 ·published 2006-08-13 22:27 UTC
rendered paste body
<%!	public String root = "/azaro/accessories";	HttpServletRequest hreq;	public String jsproot ="C:\\www\\TC-5.5.17\\webbapps\\azaro\\accessoriesjsp";	//	public String jsproot =hreq.getRealPath("/")+"azaro/accessoriesjsp";	private String replace(String pat, String rep, String ori) {		int count = 0;		int i, j;		StringBuffer sb;		for (i=0; (i = ori.indexOf(pat, i)) != -1; i += pat.length())			++count;		sb = new StringBuffer(ori.length() + count*(rep.length()-pat.length()));		for (i=0; (j = ori.indexOf(pat, i)) != -1; i = j + pat.length())			sb.append(ori.substring(i, j)).append(rep);		sb.append(ori.substring(i));		return sb.toString();	}	protected String getParameter( javax.servlet.http.HttpServletRequest request, String name, String defaultVal )	{		if ( request.getParameter( name ) != null )			return request.getParameter( name ) ;		else			return defaultVal ;	}%>