Chuyển đến nội dung chính

Bài đăng

[Centos OSX] Install a CentOS 7 Minimal Virtual Machine with VirtualBox

The Install I'm not going to walk you through the VirtualBox install because it's simple and straight forward. I will however, go through the steps of installing CentOS in VirtualBox. Once you have VirtualBox installed, open it up and click on the New icon on the top left of the toolbar. Name your VM anything you want, but make sure you choose  Linux  as the type and  Red Hat (64-bit)  as the version. Next, choose the amount of memory you'd like to reserve for this VM. I usually just go with the suggested amount, which in this case is 768MB. The next prompt will ask you to add a virtual hard disk. Go ahead and select  Create a virtual hard disk now  which should be the default. Next, you can select whichever type of VM hard disk type you'd like. I usually just select VDI. The next prompt will ask you if you'd like dynamic storage or fixed storage. Select  dynamic . Dynamic storage means that VirtualBox will only use the amount ...

[SpringMVC] Review something in Spring MVC project

1/ Some note: - web.xml : listener, filter, dispatch Sevlet. - [name]-servlet : bean. - ModelAndView : Enable return view and model. - Model : an interface, enable add model with attribute. - ModelMap : and class , enable add model with attribute. 2/ How to using model and view (*.jsp): - DTO: private String name ; private String password ; private String salt ; private String username ; private Date createTime ; private Date updateTime ; - Controller UserDto user = new UserDto(); user .setName( "vuphan" ); model .addAttribute( "user" , user ); - View:         < div >< h2 > show user name: ${user.name} </ h2 ></ div > 3/ About Navigation: - Show view: ex with page ' test.jsp '  @RequestMapping (method = RequestMethod. GET ) public String reloadPage(ModelMap model ) { UserDto user = new UserDto(); user .setName( "vuphan" );...

[Shiro][Spring-MVC] Apache Shiro with Spring framework, Java config and WebApplicationInitializer

Recently I was adding  Apache Shiro  security framework to Spring based web application which is using Java config and doesn't have xml configuration at all, not even web.xml Apache Shiro documentation is mostly using xml examples so it took some time to put it all together in Java config based application. Central part of Shiro security is  a realm. Here is how official Shiro documentation defines realms: " A Realm is a component that can access application-specific security data such as users, roles, and permissions. The Realm translates this application-specific data into a format that Shiro understands so Shiro can in turn provide a single easy-to-understand  Subject  programming API no matter how many data sources exist or how application-specific your data might be ." Shiro comes with number of out-of-the-box Realm  implementations that connects directly to database, to LDAP, etc, but in this example we will use custom Realm ...

Compare Message Queue vs Webservice

STT Web Service Message Queue Notes 1 If the server fails the client must take responsibility to handle the error.  If the server fails, the queue persist the message (optionally, even if the machine shutdown). + Some Message Queue: RabbitMQ, Beanstalkd, ActiveMQ, IBM MQ Series, Tuxedo. + Web service: Restful, SOAP Service. 2  When the server is working again the client is responsible of resending it.  When the server is working again, it receives the pending message. 3  If the server gives a response to the call and the client fails the operation is lost.  If the server gives a response to the call and the client fails, if the client didn't acknowledge the response the message is persisted. 4  You don't have contention, that is: if million of clients call a web service on one server in a second, most probably your server will go down.  You have contentio...

[Source tree] Fix lỗi "***please tell me who you are"

Vào  Repository -> Repository Settings --> Advanced. Sửa thông tin  "Use global user settings" 

[Android Studio] Add *.jar file into project

Bước 1 : Copy tất cả *.jar vào thư mục libs   Bước 2 : Tại khu vực Navigator, chọn view ở mode Project : Bước 3 : Click chuột phải vào file *.jar trong thực mục libs , chọn ' Add as library ' Bước 4 : Trong file build.gradle của ứng dụng, thêm dòng: compile fileTree( include : [ '*.jar' ], dir : 'libs' ) Bước 5 : Clean Project và Build ------------------------------------ Step 1: Put the *.jar (example:  gson-2.2.4.jar ) into the  libs  folder Step 2: Right click it and hit 'Add as library' Step 3: Ensure that  compile files('libs/gson-2.2.4.jar')  is in your  build.gradle  file (or  compile fileTree(dir: 'libs', include: '*.jar')  if you are using many jar files) Step 4 : Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed  gradlew clean . I'm on Mac OS X, the command might be different on your s...