当前位置: 代码迷 >> Java Web开发 >> jsp获取url参数有关问题
  详细解决方案

jsp获取url参数有关问题

热度:7332   发布时间:2013-02-25 21:14:25
jsp获取url参数问题
common.js

function callDailogPage(url,flag){
var DailogUrl = "showDailog.jsp" + "?flag=" +flag + "&url=" + url;
returnValue = window.showModalDailog(DailogUrl,this);
if(typeof(returnValue) === "undefined"){
returnValue = "";
}
insertWord(returnValue);
}

showDailog.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="ISO-8859-1"%>
<% 
String flag = request.getParameter("flag");
String url = request.getParamenter("url");
%>

报如下的错误,请问如何解决

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 5 in the jsp file: /src/jsp/showDailog.jsp
The method getParamenter(String) is undefined for the type HttpServletRequest
2: pageEncoding="UTF-8"%>
3: <% 
4: String flag = request.getParameter("flag");
5: String url = request.getParamenter("url");
6: %>
7: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
8: <html>


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

------解决方案--------------------------------------------------------
你重启一个tomcat,然后把这个项目重新发布,就可以了。
------解决方案--------------------------------------------------------
pageEncoding="ISO-8859-1"里面的改成gb2312
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!