[jboss-user] [JBoss Seam] - Re: Need SeamServletFilter Example

jefffry do-not-reply at jboss.com
Mon Nov 27 15:57:53 EST 2006


  | @Override
  | 	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  | 		try {
  | 			
  | 			String configId = req.getParameter("id");
  | 			
  | 			EntityManagerFactory factory = (EntityManagerFactory)Naming.getInitialContext().lookup("java:/EntityManagerFactory");
  | 			EntityManager em = factory.createEntityManager();
  | 			Config config = (Config)em.find(Config.class, new Long(configId));
  | 			
  | 			resp.setContentType(config.getFileType());
  | 			
  | 			resp.getOutputStream().write(config.getFileData());
  | 		}
  | 		catch(Exception e){e.printStackTrace();}
  | 	}
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3989049#3989049

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3989049



More information about the jboss-user mailing list