Spring PDF Example

  @RequestMapping (value="/pdf" )   public void pdfCreate(HttpServletResponse response, OutputStream outputStream){   Document document = new Document();        try {                   // 파일 출력 -      FileOutputStream file = new FileOutputStream(new File("C:/HelloWorld.pdf"));  // File Write                   PdfWriter.getInstance(document, file);                     // Stream Output           PdfWriter.getInstance(document, outputStream);                     document.open();           //           // Create our first paragraph for the pdf document to be           // created. We also set the alignment and the font ...

Spring Excel Example

@RequestMapping(value = "/excel", method = RequestMethod.GET) public void handleRequestInternal(HttpServletRequest request,                                  HttpServletResponse response,                                  OutputStream outputStream    ) throws Exception { response.setHeader("Content-Disposition", "attachment; filename=file.xls"); //ModelAndView model = new ModelAndView("excel"); // Creating an instance of HSSFWorkbook.         HSSFWorkbook workbook = new HSSFWorkbook();         // Create two sheets in the excel document and name it First Sheet and         // Second Sheet.         HSSFSheet firstSheet  = workbook.createSheet("FIRST SHEET");         HSSFSheet secondShe...

NoSuchMessageException Error Handle

처리방법 해당 리소스를 찾지 못해서 발생되는 메시지로 <beans:bean id="messageSource"                              class="org.springframework.context.support.ReloadableResourceBundleMessageSource">      <beans:property name="basename" value="/WEB-INF/messages/messages" />      <beans:property name="cacheSeconds" value="0" />       <beans:property name="useCodeAsDefaultMessage" value="true"></beans:property> </beans:bean> 붉은 부분을 추가 하여 해당 Message 가 없을때 Default Message 로 출력하도록 한다. message.properties         id.emptyMessage = id code required.    id.sizeError = id code less 4 then 20.          required  email.emptyMessage =  message  <<== 이부분의 메시지가 없을때 나오는 에러메시지로                      ...

Sencha EXTJS Panel Demo

<%@ page language="java" contentType="text/html; charset=UTF-8"                                                                             pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"                                                                   "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>     <title></title>         <!-- ExtJS -->     <link rel="stylesheet" type="text/css" href="ext-4.1/resources/css/clifton-blue.css" />   ...

SpringFramework Resource java Configuratiin

Webinitializer.java public class WebInitializer implements WebApplicationInitializer {     public void onStartup(ServletContext container) throws ServletException {                 // Create the 'root' Spring application Context         AnnotationConfigWebApplicationContext root                                        = new AnnotationConfigWebApplicationContext();          // Application.java         root.register(Application. class );                 // Manager the life cycle if the root application context         container.addListener( new ...

Spring Context Infomation Example

HomeController import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; @Controller public class HomeController { @RequestMapping (value="/test", method=RequestMethod.GET) public ModelAndView test (){ System.out.println("Welcome Home Controller!"); UserImpl user = new UserImpl(); System.out.println( user.getUser()); ModelAndView model = new ModelAndView("Test"); model.addObject("message", "한글메시지 model.addObject 로 전달"); model.addObject("userMessage",user); return model; } } <%@page import="org.springframework.web.servlet.ModelAndView"%> <%@page import="org.springframework.web.servlet.ViewRendererServlet"%> <%@page import="org.springframework.web.context.WebApplicationContext"%> <%@page i...

Spring Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor

Spring Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor Spring Project Build Path Configuration Appand libraries org.springframework.expression-3.1.0.RC1.jar or org.springframework.expression-xxx-version.jar