错误提示:
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /chklogin.jsp(49,2) Expected "param" tag with "name" and "value" attributes
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
org.apache.jasper.compiler.Parser.parseParam(Parser.java:892)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1838)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
org.apache.jasper.compiler.Parser.parseForward(Parser.java:942)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1253)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1597)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.16
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: /chklogin.jsp(49,2) Expected "param" tag with "name" and "value" attributes
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
org.apache.jasper.compiler.Parser.parseParam(Parser.java:892)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1838)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
org.apache.jasper.compiler.Parser.parseForward(Parser.java:942)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1253)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1597)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------Apache Tomcat/5.0.16
解决方案 »
- 请各位大神帮我看看,struts2做的小项目,action中调用接口方法,显示nullpoint异常,可是单元测试方法没有问题啊
- 返回的值是接口的实现为什么会通不过?
- 底层的一段代码,好像是错了,请大家帮忙看一下
- struts2过滤器都做了什么
- 纠结的java.lang.IllegalStateException问题
- 【高分求救】http的返回状态或者内容能否自定义?
- myeclipse 6.0 的tomcat6.0 配置问题
- 如何在struts1.0中调用配置好的数据源
- 怎么将Jar打包成War,然后将War放到那个目录下呀?大虾们帮小弟一把!!
- j2ee
- 如何实现多用户共享资源?
- 连接SQLSERVER的问题!请指出下面代码的错误!!!
<%@ page language="java" import="java.sql.*" %>
<html>
<meta http-equiv="Refresh" content="3 url = login.htm">
<title>
chklogin
</title>
<jsp:useBean id="conn" scope="page" class="popdomConnDB.ConnDB" />
<jsp:setProperty name="conn" property="*" /><body bgcolor="#ffffff"><%!
ResultSet rs=null;
String sql="";
String sUserId="";
String sPassword="";
%>
<%
//******************************************************************
if((request.getParameter("userId")==null)||(request.getParameter("password")==null)||(request.getParameter("userId").equals(""))||(request.getParameter("password").equals("")))
{
%>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><b><font size="3" color="#FF0000">用户名和密码不能为空!</font></b></p>
<p align="center"><b><font size="3" color="#ff0000">3秒后返回!</font></b></p>
<p align="center"><a href="login.htm"><img border="0" src="image/back.gif" width="75" height="42"></a></p>
<%
return;
}
//*******************************************************************
sUserId = request.getParameter("userId").trim();
sPassword = request.getParameter("password").trim();
sql ="select * from com_operator where id='"+sUserId+"' and password='"+sPassword+"'";
rs = conn.executeQuery(sql);
if(rs.next())
{
if(session.getAttribute("login")==null)
{
session.setAttribute("login","ok");
session.setAttribute("userId",sUserId);
session.setAttribute("Password",sPassword);
}
%>
<jsp:forward page="index.htm">
</jsp:forward>
<%
}
else
{
%>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><b><font size="3" color="#FF0000">错误的用户名或密码!</font></b></p>
<p align="center"><b><font size="3" color="#ff0000">3秒后返回!</font></b></p>
<p align="center"><a href="login.htm"><img border="0" src="image/back.gif" width="75" height="42"></a></p>
<!-- <jsp:fordard page="login.jsp" />-->
<%
}
rs.close();
%>
<br><br>
</body>
</html>
<html>
<head>
<title>
Login
</title>
<style type="text/css">
.yk9{font:9pt "宋体"}
</style>
<base target="_parent">
</head>
<body bgcolor="#ffffff">
<h1>
<font size="+1" color="#FF0000">系统登陆</font>
</h1><p>
</p><div align="center"> <center>
<table border="0" cellspacing="0" width="698" height="279" bordercolor="#6699CC" cellpadding="0">
<tr><td height="256" width="682">
<form method="post" action="chklogin.jsp" name="myfrom"><table width="45%" cellspacing="0" cellpadding="1" border="1" align="center"
bordercolordark="#ecf5ff" bordercolorlight="#6699cc" bordercolor="#6699CC">
<tr>
<td><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="33%" align="right" height="30">用户名:</td>
<td width="67%"> <input name="userId" maxlength="20" class="yk9" size="31"></td>
</tr>
<tr>
<td width="33%" align="right" height="30">密码:</td>
<td width="67%"> <input type="password" name="password" maxlength="16" class="yk9" size="31"></td> </tr>
<tr>
<td colspan="2" height="15"></td>
</tr>
</table>
</td>
</tr>
</center>
<tr align="center">
<td height="40">
<input type="submit" name="Submit" value="确 定" class="yk9">
</td>
</tr>
</table>
<center>
</form>
</center>
</td>
</table></div>
<p> </p>
<p> </p>
</body>
</html>
全部贴完
<jsp:forward page="index.htm">
</jsp:forward>
<%改成
response.sendRedirect("index.htm");
--
其实代码没错啊
try{
InitialContext ctx=new InitialContext();
ds=(DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
String strSql = " select * from strutsUser";
ResultSet rs = stmt.executeQuery(strSql);
while(rs.next()){
System.out.println(rs.getString(1));
}
}
catch(Exception ex){
ex.printStackTrace();
}
我以前调成功的一个例子,主要是这
InitialContext ctx=new InitialContext();
ds=(DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
你的lookup()中的参数不对