<%@ page language="java" pageEncoding="GBK"%>
<html>
<head>
<title>My JSP 'output.jsp' starting page</title>
<jsp:useBean id="bean" class="com.SimpleBean" scope="request"/>
<jsp:setProperty name="bean" property="name" value="<%=request.getParameter("username") %>"/>
<jsp:setProperty name="bean" property="age" value="25"/>
</head>
<body>
姓名:<jsp:getProperty name="bean" property="name"/>
年龄:<jsp:getProperty name="bean" property="age"/>
</body>
</html>package com;public class SimpleBean {
private String name=null;
private int age =20;
方法省略
}URL:http://localhost:8500/ebooks/ch07/output.jsp?username=zhangsan 访问报以下 500 错误
URL 地址改成IP地址则正常显示 何解?
下面的代码错误是什么内容 求教!org.apache.jasper.JasperException: /ch07/output.jsp(6,57) Attribute value request.getParameter("username") is quoted with " which must be escaped when used within the value
<html>
<head>
<title>My JSP 'output.jsp' starting page</title>
<jsp:useBean id="bean" class="com.SimpleBean" scope="request"/>
<jsp:setProperty name="bean" property="name" value="<%=request.getParameter("username") %>"/>
<jsp:setProperty name="bean" property="age" value="25"/>
</head>
<body>
姓名:<jsp:getProperty name="bean" property="name"/>
年龄:<jsp:getProperty name="bean" property="age"/>
</body>
</html>package com;public class SimpleBean {
private String name=null;
private int age =20;
方法省略
}URL:http://localhost:8500/ebooks/ch07/output.jsp?username=zhangsan 访问报以下 500 错误
URL 地址改成IP地址则正常显示 何解?
下面的代码错误是什么内容 求教!org.apache.jasper.JasperException: /ch07/output.jsp(6,57) Attribute value request.getParameter("username") is quoted with " which must be escaped when used within the value
解决方案 »
- javax.servlet.ServletException: Servlet execution threw an exception
- jsp 导出excel
- 时间格式转换问题
- JAVA_WEB项目开发会用到些什么东西啊?
- 求助jsp数据库连接问题
- 推荐一个table表的displaytag:::eXtremeTable(opensource)
- 请研究petstore的兄弟姐妹进来点个名,互相学习
- 150 分(不够另开) 吐血求救 java excel api 的.jar
- WebSphere十万火急!
- ServletActionContext.getRequest().getSession().setAttribute
- 问个jsp页面的表格数据提交的问题(struts2)
- 大家看看问题出在哪
改为这样就没问题了
<%String username = request.getParameter("username"); %>
<jsp:setProperty name="bean" property="name" value="<%=username %>"/>
遇到问题 先上网查查 问问谷歌 百度
如果用IP地址访问的话 就不会报错 可以正常显示
说你说的那个不存在错误