日期:2014-05-18  浏览次数:20723 次

关于标签的使用,急~~~~~~~~~~~~~~~~~~~
请问下在标签里如何使用el隐式对象?下面这样写为啥不对?谢谢!
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<html>
  <head>  
  <title>My JSP 'showportal.jsp' starting page</title> 
  </head>
  
  <body>
  <c:out value="${param.portchoice}"></c:out>
  </body>
</html>

portchoice 是上一个页面的表单,单独写param.portchoice能得到表单里的数据,但放到 <c:out value="${param.portchoice}"></c:out>里就会出错,初学,请教了1

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: /showportal.jsp(15,2) According to TLD or attribute directive in tag file, attribute value does not accept any expressions



------解决方案--------------------
我弄过了,能运行啊!你portchoice应该是表单的名字而不是你文本框的名字!
------解决方案--------------------
yes,同上!!
------解决方案--------------------
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
改为
<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix="c"%>



------解决方案--------------------
2.4及以后写成(JSTL1.1)
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" % >
------解决方案--------------------
JSTL1.1的库 在JSP2.0(Servlet 2.4)及以后(推荐用JSTL1.1及以上)用:


代码 
<%@taglib prefix="c" uri="http://java.sun.com/ <span style="color:red;" >jsp </span >/jstl/core" % >


web.xml

代码 
<?xml version="1.0" encoding="UTF-8"? >
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html