html 분석 문제 처리
                                            
 1849 단어  자바
                    
package org.OutHtml.Dao;
import java.io.FileNotFoundException;
import java.io.IOException;
public interface HtmlDao {
	public String getHtmlFile(String Path) throws IOException;
	
	public String getHtmlSql(String SqlHtml);
	
	public String getHtmlURL(String URL) throws IOException;
}
package org.OutHtml.Dao.imp;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import org.OutHtml.Dao.HtmlDao;
/*
 * @       HTML     
 * 
 *    2015-04-08 22:11:00;
 * 
 *       :  
 */
public class HtmlDaoImp implements HtmlDao{
	public String getHtmlFile(String Path) throws IOException {
		// TODO Auto-generated method stub
		StringBuffer sb = new StringBuffer();
		
		BufferedReader bufr = new BufferedReader(new FileReader(Path));
		
		String line = null;
		
		while((line = bufr.readLine()) != null){
			sb.append(line);
		}
		return sb.toString();
	}
	public String getHtmlSql(String SqlHtml) {
		// TODO Auto-generated method stub
		StringBuffer sb = new StringBuffer();
		
		
		
		return null;
	}
	public String getHtmlURL(String urls) throws IOException {
		// TODO Auto-generated method stub
		StringBuffer sb = new StringBuffer();
		URL url = new URL(urls);
		URLConnection conn = url.openConnection();
		
		BufferedReader bufin = new BufferedReader(new InputStreamReader(conn.getInputStream()));
		
		String line = null;
		
		while((line = bufin.readLine()) != null){
			sb.append(line);
		}
		return sb.toString();
	}
}
4. 567913. 제 이 슨 의 형식 으로 페이지 의 내용 을 교체 하면 하나씩 값 을 쓰 지 않 아 도 된다.
Json Object, 이 데 이 터 는 업무 층 에서 가 져 와 스스로 조립 합 니 다.HTML 은 모드 에서 정 의 된 내용 으로 key 는 해당 하 는 내용 에 대응 하여 교체 합 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Is Eclipse IDE dying?In 2014 the Eclipse IDE is the leading development environment for Java with a market share of approximately 65%. but ac...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.