読者です 読者をやめる 読者になる 読者になる

ハツニッキ

blog-manage

やー、色々とめんどくさいねぇブログは・・・・
自分で鯖借りたりすればフォルダも簡単に作れるしアップロードも簡単に出来るのになぁ

The Ahikunep Kotanのバナーを保存する場所で小一時間悩んでしまった・・・
フォトライフにうpしてimgタグにぶち込んだけど、もっといい方法ないのかしら・・・
まぁ、今は探すのめんどいからいいや。

とりあえず試したかった奴を試す!
ソースは提携課題のソース。

package edu.interior.core;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import edu.sou.framework.ApplicationController;
import edu.sou.framework.ApplicationControllerFactory;
import edu.sou.framework.ApplicationException;
import edu.sou.framework.RequestContext;
import edu.sou.framework.ResponseContext;
import edu.sou.framework.j2ee.J2eeApplicationControllerFactory;

public class FrontServlet extends HttpServlet{
	private static final long serialVersionUID = 7956145125075758428L;
	private static final Log log = LogFactory.getLog(FrontServlet.class);
	protected void service(HttpServletRequest req, HttpServletResponse res)
		throws IOException, ServletException {
		try{
			req.setCharacterEncoding("Windows-31J");
			if (log.isDebugEnabled()) {
				log.debug("service(HttpServletRequest, HttpServletResponse)" 
					+ " - Accessed From '" + req.getRequestURL().toString() + " '");
			}
			ApplicationControllerFactory factory = new J2eeApplicationControllerFactory();
			//appControllerの取得
			ApplicationController appController
				 = factory.getApplicationController(req, getServletContext());
			//RequestContextの取得
			RequestContext reqc = appController.getRequestContext(req);
			//Requestの操作
			ResponseContext resc = appController.handleRequest(reqc);
			//Rescのinit
			resc.setResponse(res);
			//Responseの操作
			appController.handleResponseContext(reqc, resc);
		}catch(ApplicationException e){
			log.error("service(HttpServletRequest, HttpServletResponse)", e);
			e.printStackTrace();
			throw new ServletException(e.getMessage(), e);
		}catch (HibernateException e) {
			log.error("service(HttpServletRequest, HttpServletResponse)", e);
			e.printStackTrace();
			throw new ServletException(e.getMessage(), e);
		}finally{
			if (log.isDebugEnabled()) {
				log.debug(" service() - end"
					+ "\n---------------------------------------------\n");
			}
		}
	}
}