ITeye博客

J2EE

共 8 篇文章

Web Services:REST还是SOAP?

[转自] http://heshun.org/?p=200 在实现web service的时候,接口风格是采用Rest还是SOAP呢?首先简单介绍一下REST: 什么是REST? Rest的全称是Representational State Transfer(可表述的状态转移),这并不是一个新概念。它的基本含义是每个URL都唯一代表某个资源,针对这个资源的操作可以抽象为4种:创建,读 取,更改,删除,分别用HTTP的4个标准方法POST、GET、PUT、DELETE来对应(详见 http://en.wikipedia.org/wiki/Representational_State_Trans…

2011-05-11 14:26 · J2EE · REST · XML · 企业应用 · SOAP · Web

解决MySQL 5数据库连接超时问题

最近碰到一个mysql5数据库的问题。就是一个标准的 servlet /tomcat网络应用,后台使用mysql数据库。问题是待机一晚上后,第二天早上第一次登录总是失败。察看日志发现如下错误: “ com .mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago.” 经过一番调研,发现很多人都碰到过类似问题,但网上令人满意的回答并不多。mysql网站上的提问也很多,但并没有正确答案;百度知道上倒是有一…

2011-02-14 13:40 · J2EE · 网络应用 · 百度 · MySQL · Tomcat · Linux

Spring+hibernate+Oracle环境下的Clob字段处理方式

Spring或Hibernate其实都提供了透明处理Clob的方法。 具体做法为: 1.在sessionFactory中加入lobHandler的注射: <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="lobHandler " ref="lobHandler"/> <property name="mappingResources">…

2010-12-21 15:35 · J2EE · Spring · JDBC · Hibernate · Oracle · Bean

Performance test tools

Apache JMeter http://jakarta.apache.org/jmeter/ Description: Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions. Apache JMeter…

2010-01-07 13:39 · J2EE · ASP.net · HP · performance · Linux · Web

搜索引擎lucence

贴的出处: http://www.blogjava.net/dreamstone/category/24601.html

2009-09-22 16:49 · J2EE · HTML · .net · 搜索引擎

jboss部署数据源却提示javax.naming.NameNotFoundException

javax.naming.NameNotFoundException: DefaultDS not bound 如同这样问题的解决: 我在中文各大知名论坛求助都没有一个好的解决方式,终于在国外的论坛上获取相识问题解决方法: 通常你通过Console都能看到部署成功,在JMX的service=JNDIView中也能看到,就是不能Lookup :) 解决方法:加上下面红色部分! <datasources> <local-tx-datasource> <jndi-name>jdbc/OracleDS</jndi-name> <use-java-context>false</use-java-con…

2009-05-08 14:03 · J2EE · SQL · JDBC · XML · JBoss · Oracle

jsp验证码

<%@ page contentType="image/jpeg" import="java.awt.*, java.awt.image.*,java.util.*,javax.imageio.*" %> <% // 在内存中创建图象 int width=60, height=20; BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // 获取图形上下文 Graphics g = image.getGraphics(); // 设定背景色 g.setColor(new Col…

2009-02-25 16:55 · J2EE · Cache · UP · JSP · Security · Servlet

jsp上传图片并生成缩位图或者加水印

//添加水印,filePath 源图片路径, watermark 水印图片路径 public static boolean createMark(String filePath,String watermark) { ImageIcon imgIcon=new ImageIcon(filePath); Image theImg =imgIcon.getImage(); ImageIcon waterIcon=new ImageIcon(watermark); Image waterImg =waterIcon.getImage(); int width=theImg.getWidth(nul…

2009-02-25 16:53 · J2EE · JSP · Servlet