All pastes #130247 Raw Edit

yassine

public java v1 · immutable
#130247 ·published 2006-08-13 23:27 UTC
rendered paste body
<%!	public String root = "/azaro/accessories";//	HttpServletRequest hreq;		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 ;	}%><%!	String jsroot =getServletContext().getRealPath();// i removed the parameter application name here since its azaro//      String jsroot =getServletContext().getRealPath("azaro");%><H2>	<%!System.out.println(jsroot);%> </H2><%!	public String jsproot =jsroot +"accessoriesjsp";%>