receivetool.jsp
来自「jakarta-taglibs」· JSP 代码 · 共 107 行
JSP
107 行
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/jms-1.0" prefix="jms" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Receive Message Tool</title>
<link rel="stylesheet" href="examples.css" type="text/css">
</head>
<body>
<%
String connection = request.getParameter( "connection" );
if ( connection == null ) {
connection = "topic";
}
String destination = request.getParameter( "destination" );
if ( destination == null ) {
destination = "";
}
long timeout = -1L;
String timeoutText = request.getParameter( "timeout" );
if ( timeoutText != null && timeoutText.length() > 0 ) {
try {
timeout = Long.parseLong( timeoutText );
}
catch (Exception e) {
}
}
else {
timeoutText = "";
}
%>
<h2>Receive JMS Message</h2>
<p>Enter the details to receive</p>
<form METHOD="GET" ACTION="<%= request.getRequestURI() %>">
<table width="100%">
<tr>
<td>
Connection name:
</td>
<td>
<input type="text" name="connection" value="<%= connection %>" size="50"/>
</td>
</tr>
<tr>
<td>
Destination:
</td>
<td>
<input type="text" name="destination" value="<%= destination %>" size="50"/>
</td>
</tr>
<tr>
<td>
Timeout (millis):
</td>
<td>
<input type="text" name="timeout" value="<%= timeoutText %>" size="50"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Get Message"/>
</td>
</tr>
</table>
</form>
<hr />
<%
if (connection.length() > 0 && destination.length() > 0 ) {
%>
<p>Waiting for message....</p>
<%
out.flush();
%>
<jms:connection name="<%= connection %>">
<jms:receive var="msg" timeout="<%= timeout %>">
<jms:destination name="<%= destination %>"/>
</jms:receive>
</jms:connection>
<p>Received the following message.</p>
<p><%= pageContext.getAttribute( "msg" ) %></p>
<hr />
<%
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?