1,5 → 1,6 |
package pt.estgp.estgweb.web; |
|
import org.apache.commons.httpclient.URIException; |
import org.apache.commons.httpclient.util.URIUtil; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.utils.ConfigProperties; |
189,6 → 190,11 |
return in; |
} |
|
public static void main(String[] args) throws URIException { |
String path = "pagina.php?id=asdasd&jj=kk"; |
String pathFinal = path.indexOf("?") >=0 ? URIUtil.encodePath(path.substring(0,path.indexOf("?")), "ISO-8859-1") + "?" +path.substring(path.indexOf("?")+1) : path; |
System.out.println(pathFinal); |
} |
public static void processHttpRequestService(JspWriter out, String server, String path) throws IOException, ServletException |
{ |
|
201,9 → 207,11 |
|
try |
{ |
System.out.println("Getting: " + serverUrl + URIUtil.encodePath(path, "ISO-8859-1") ); |
URL url = new URL(serverUrl + URIUtil.encodePath(path, "ISO-8859-1")); |
|
String pathFinal = path.indexOf("?") >=0 ? URIUtil.encodePath(path.substring(0,path.indexOf("?")), "ISO-8859-1") + "?" + path.substring(path.indexOf("?")) : path; |
System.out.println("Getting: " + serverUrl + pathFinal); |
URL url = new URL(serverUrl + pathFinal); |
|
URLConnection con = url.openConnection(); |
InputStream stream = con.getInputStream(); |
|