Ubuntu开发Struts2应用(6、整合hibernate和spring)

Ubuntu开发Struts2应用(6、整合hibernate和spring)
1 准备数据库。由于用到了hibernate,自然少不了数据库,我们这里建立一个简单的表以做演示,ubuntu下的mysql我们已经安装好了,用户名root,密码123456。 把s2sh.sql放到/home/linuxsight目录中 linuxsight@linuxsight-ODM:~$ pwd /home/linuxsight linuxsight@linuxsight-ODM:~$ mysql -uroot -p123456 < s2sh.sql s2sh.sql create database s2sh character set 'utf8' collate 'utf8_general_ci'; ...

Linux Mint 12 "KDE" 发布下载

Linux Mint 12 "KDE" 发布下载
不得不说,现在的Mint很火。我本人用Mint都喜欢用GNOME2,而有人也独爱KDE,那Mint 12 "KDE"就适合你了。 The team is proud to announce the release of Linux Mint 12 KDE. Linux Mint 12 KDE comes with updated software and brings refinements and new features to make your desktop even more comfortable to use. This edition comes with the latest and recently released KDE 4.7.4. This is t...

Ubuntu开发Struts2应用(5、自定义拦截器)

Ubuntu开发Struts2应用(5、自定义拦截器)
Struts2为我们提供了丰富的拦截器,而实现自定义拦截器也是容易的一件事。 拦截器必须是无状态的,原因是Struts2不能保证为每一个请求或者action创建一个实例,所以如果拦截器带有状态,会引发并发问题。 实际应用中处理权限问题是常见的,下面就以一个拦截器来判断处理用户是否登录而有权限去执行action的内容。 LoginInterceptor.java package com.linuxsight.interceptor; import com.opensymphony.xwo...

Ubuntu开发Struts2应用(4、文件上传)

Ubuntu开发Struts2应用(4、文件上传)
文件上传这个功能在项目应用是非常常见的,这节说说Struts2如何实现文件上传。 Struts2使用开源项目Apache Jakarta Commons FileUpload和内建的FileUploadInterceptor拦截器实现文件上传 下面介绍代码: FileUploadAction    package com.linuxsight.action; import java.io.File; import org.apache.commons.io.FileUtils; import org.apache.struts2.ServletActionContext; import com.opensymphony.x...

Ubuntu开发Struts2应用(3、知识点记录)

Ubuntu开发Struts2应用(3、知识点记录)
    本节记录了一些struts2的知识点。 1、设置开发调试 struts.properties struts.devMode = true 添加struts2-config-browser-plugin-2.3.1.jar 地址访问:http://localhost:8080/struts2T1/config-browser/index.action 使用标签<s:debug/>显示 地址访问: http://localhost:8080/struts2/linuxsight.action?debug=xml http://localhost:8080/struts2/linuxsight.action?debug=console 2、在stru...

Ubuntu开发Struts2应用(2、第一个程序)

Ubuntu开发Struts2应用(2、第一个程序)
本节介绍在ubuntu上开发的一个struts2应用。 新建一个web项目,利用myeclipse9.1给我们提供的struts2支持,搭建环境。 这里注意不要勾选多余的jar包,我们只需要core myeclipse9.1集成的Sturts版本是struts2.2.1 代码如下: web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-...

Ubuntu开发Struts2应用(1、环境搭建MyEclipse+MySQL)

Ubuntu开发Struts2应用(1、环境搭建MyEclipse+MySQL)
本系列文章带来的是在Ubuntu11.10下开发Struts2程序学习过程所记录的滴滴点点,当中所写的也许不能算是学习的好教程,但所涉及的知识点相信会对学习Struts2有一定的帮助。 首先是在Ubuntu11.10搭建开发环境,相信大部分开发者都是在XP下完成的,比较少涉及Linux平台,如果你是用Ubuntu系统的,那可以看看本节内容。 1、安装myeclipse(由于myeclipse已经自带了Tomcat,所以我们不需要再去下载Tomcat了。)...

Ubuntu11.10解压RAR文件

Ubuntu11.10解压RAR文件
Ubuntu默认不能解压RAR文件,Ubuntu11.10也一样,所以我们需要安装软件来支持。 压缩功能 安装 sudo apt-get install rar 卸载 sudo apt-get remove rar 解压功能 安装 sudo apt-get install unrar 卸载 sudo apt-get remove unrar linuxsight@linuxsight-ODM:~$ sudo apt-get install unrar [sudo] password for linuxsight: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... ...

Ubuntu搭载PHP环境(安装MySQL/Apache/phpMyAdmin/WordPress)

Ubuntu搭载PHP环境(安装MySQL/Apache/phpMyAdmin/WordPress)
我们知道部署LMAP在任何Linux版本下都可以用源码安装来完成,而当我们用上ubuntu/fedora/opensuse这类发行版可以借助它们的包管理机制来完成,以减轻我们的工作量。 下面介绍在ubuntu11.10下安装配置MySQL、Apache、PHP5、phpMyAdmin的方法 安装MySQL sudo apt-get install mysql-server 安装Apache sudo apt-get install apache2 安装PHP5 sudo apt-get install php5 //安装PHP5 其它模块 sudo apt-get in...

Ubuntu11.10解决打开Windows的TXT乱码问题

Ubuntu11.10解决打开Windows的TXT乱码问题
在Ubuntu11.10下,打开Windows的TXT乱码,按照以往的方法,在gconf-editor设置下并没有找到相应的选项 解决乱码方案: 打开终端输入: linuxsight@linuxsight-ODM:~$ gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8', 'GB18030', 'GB2312', 'GBK', 'BIG5', 'CURRENT', 'UTF-16']"