라벨이 Spring Framework인 게시물 표시

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  <<== 이부분의 메시지가 없을때 나오는 에러메시지로                      ...

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

Elcipse 3.6 Spring IDE Plug in 설치시 에러 문제

Error Message : Missing requirement: Spring IDE AJDT Integration   Elcipse Help - Install New Software   Add Button - Click   Name : 아무거나 허지만 알아봐야 겠지 .. AJDT Update AspectJ Developemtn Tools Location : http://download.eclipse.org/tools/ajdt/36/update    36 - Eclipse versio Helios   Check install : AspectJ Development Tools (Required)           필수설치   이후에 Spring IDE Option 설치 하면 된다 -- 여기저기 뒤져서 찾아서 적어놓은것      

Struts 사용시 경고 메시지 Server/Service/Engine/Host/Context 처리

-Tomcat6.0버전을 처음 사용해 보면서, 문제가 발생했다. 출처의 아티클을 보면 알겠지만, Tomcat 6.0부터 지원하는 source라는 Attribute 때문에 일어나는 문제라고 한다.   Warning :  [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'     to  'org.eclipse.jst.j2ee.server:demo' did not find a matching property   Solution : Server's Properties -> General -> Location = /Servers/Tomcat v6.0 Server at localhost.server; Project Explorer -> Servers -> Tomcat v6.0 Server at localhost.server, double click to open it. Server Options -> Check " Publish module contexts to separate XML files ". Explaination : Tomcat of previous version doesn't support the "source" attribute in the "Context" node of "server.xml" file. Result : A separate XML file named "demo.xml" was created in the "$server path$\conf\Catalina\localhost\". Reference : http://www.ibm.com/developerworks/opensource/library/os-eclipse-...

Spring

Spring IoC (Inversion of Control)  콘트롤 전도(반전)  역전 EJB  (Enterprise javaBean)  Container 에 의존하는 객체 (복잡하고 개발자가 쓰기 어렵다는것?) POJO ( Plain Old java Object) 자바개발자가 마음대로 정의 할수 있는 객체,  Object 를 간단히 수퍼클래스로 둔 보통의         평법의 순수 자바 클래스라고 볼수 있다고 한다. POJO 의 필수 요소 - Light-weight (possibly) : 가볍게 - Flexible : 유연성 - Simple : 간단 명료 - Supported by Separate optional compnents such as hibernate or Spring - 즉 , Spring , Hibernate, Ibatis 등에서 객체를 가볍게, 간단히 유연하게 어떤 Object 에 대해 추상화 할수 있는 객체를 만들어야 한다. AOP (Aspect Oriented Programming  ) 관점지향 프로그래밍 Aspect : 양상,관점,모습,면,방향,방면,용모,외양,방위,상,별의 상             ex) a mountain with a beatiful aspect : 모습이 아름다운 산                  consider a question in all its aspects (from every aspedt)  문제를 모든 각도에서 고찰하다. Avalon : 은 영국(United Kingdom Of Great britain and Northern Ireland)의 어디엔가에 있었다고 여겨지는 전설상의 섬이다.         ...

Spring Dynamic Modules for OSGi(tm) Runtimes 배우기

OSGi =  Open Service Gateway initiative Alliance 는 1999년에 Sun Microsystems ,IBM, Ericsson 등이 구성한             개방형 표준 단체이다. 자세한것은 위키 백과 http://ko.wikipedia.org/wiki/OSGi  참고바람. 처음에는 Connected Alliance 라고 불렸다고 한다. 이 표준 사양의 핵심은 Application Program 의 Life cycle 은 Model and Service Registry 를 정의 하는 Framework 이다. OSGi Framework 은 독립적인 Jave / Virtual Machine 환경에서 제공하고 있지 못한 세련되고, 완전하며 동적인 Component Model 을 구현한다. 응용프로그램 또는 구성요소(번들,Bundle) 는 다시 시동과정 없이 원격지를 통해 Installed,Stated ,Stoped,Updated and Uninstalled 할수있다. OSGi 는 Embeddable( Appplication 내보로 포함될수있는) SOA 를 구현하고 있다. SOA = Service Oriented Architecture (서비스 지향 아키텍처) , Service , Message 로 구성. Web service based SOA 가 네트워크를 중심으로 하는 SOA 라면 OSGi 는 Java Object based SOA 이다.                     Initiative : (명) 발의,초보,의안제출권,기업심,선제,선창,주도(권) ,독창력,창업의 재간, 국민발안,의안 제출권 Component : (명) 구성요소 (형) 구성하고 있는