singer_jsp.java
来自「手机在线系统 采用Java 中的J2ME, JSP 跟MySql 运行环」· Java 代码 · 共 115 行
JAVA
115 行
package org.apache.jsp.recreation.singer;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.j2me.common.*;
import com.j2me.data.*;
public final class singer_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
String key, sql;
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<HTML>\r\n");
out.write("<HEAD>\r\n");
out.write("\r\n");
out.write("<TITLE> 查找艺术家 </TITLE>\r\n");
out.write("\r\n");
out.write("</HEAD>\r\n");
out.write("\r\n");
out.write("<BODY>\r\n");
out.write(" ");
out.write("\r\n");
out.write(" ");
key = request.getParameter("key"); //获得参数
sql = "select *from music_singer where singer_name = '" + key + "' ;";
out.write("\r\n");
out.write(" \r\n");
out.write(" ");
com.j2me.data.Recreation re = null;
synchronized (_jspx_page_context) {
re = (com.j2me.data.Recreation) _jspx_page_context.getAttribute("re", PageContext.PAGE_SCOPE);
if (re == null){
re = new com.j2me.data.Recreation();
_jspx_page_context.setAttribute("re", re, PageContext.PAGE_SCOPE);
}
}
out.write("\r\n");
out.write("\t\t ");
org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(_jspx_page_context.findAttribute("re"), "query",
sql);
out.write("\r\n");
out.write("\t\t ");
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("re"), "how", "5", null, null, false);
out.write("\r\n");
out.write("\t \t ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.j2me.data.Recreation)_jspx_page_context.findAttribute("re")).getResult())));
out.write("\t\r\n");
out.write("\t");
//判断是否找到用户要找的艺术家,如果没有则输出false以便客户端判断
if (re.getResult().compareTo("") == 0)
{
out.println("false");
}
out.write("\r\n");
out.write(" \r\n");
out.write("\r\n");
out.write("\r\n");
out.write("</BODY>\r\n");
out.write("</HTML>\r\n");
out.write("\r\n");
out.write("\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?