package action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import message.Sender;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class SendMessage extends HttpServlet {
/**
* Constructor of the object.
*/
public SendMessage() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out
.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the GET method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
Sender sender=(Sender)context.getBean("sender");
String text=request.getParameter("text");
sender.send(text);
response.encodeRedirectUrl("/index.jsp");
System.out.println("send....");
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
activemq与spring整合发送jms消息入门实例
共27个文件
jar:12个
class:4个
xml:3个
4星 · 超过85%的资源 需积分: 9 449 下载量 21 浏览量
2009-02-09
02:06:17
上传
评论 5
收藏 7.89MB RAR 举报
温馨提示
activemq与spring整合发送jms消息入门实例 jar 包和实例代码都在压缩包里了
资源推荐
资源详情
资源评论
收起资源包目录
activemq5.1_spring2.5_tomcat5.5_jms_web.rar (27个子文件)
sendJms
.project 1KB
.mymetadata 294B
WebRoot
WEB-INF
web.xml 804B
lib
spring-web-2.5.1.jar 177KB
spring-jms-2.5.5.jar 185KB
spring-2.5.5.jar 2.81MB
spring-core-2.5.5.jar 281KB
spring-context-2.5.5.jar 462KB
activemq-all-5.1.0.jar 3.6MB
log4j-1.2.14.jar 359KB
commons-pool-1.4.jar 85KB
spring-tx-2.5.5.jar 226KB
xbean-spring-3.4.3.jar 127KB
spring-webmvc-2.5.1.jar 377KB
spring-beans-2.5.5.jar 475KB
classes
action
SendMessage.class 2KB
applicationContext.xml 1KB
message
Receiver.class 1024B
Sender.class 833B
Sender$1.class 897B
index.jsp 979B
META-INF
MANIFEST.MF 39B
.myeclipse
src
action
SendMessage.java 3KB
applicationContext.xml 1KB
message
Sender.java 582B
Receiver.java 475B
.classpath 1KB
共 27 条
- 1
zbg1983
- 粉丝: 6
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页