未在JSP中計算的EL表達式我的servlet/jsp Web應用程序有一個小問題。我試圖在jsp頁面中使用jstl。例如,當我使用任何標記時:<c:out value="${command}"/>它向我展示了${command}在我的瀏覽器中而不是參數‘命令’值。我正在使用maven(我想問題就在這里)。下面是pomXML依賴項:<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope></dependency><dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version></dependency>我的web.xml聲明標記:<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">和JSP部分:<%@ page contentType="text/html;charset=UTF-8" language="java" %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html><head><title>Parsing results</title><link type="text/css" rel="stylesheet" href="css/page.css"/>
<link type="text/css" rel="stylesheet" href="css/table.css"/></head><body><h2 align="center">Results of
parsing. Parsing method = <c:out value="${command}"/></h2>.......編輯:代碼,它設置命令值,很簡單:request.setAttribute("command", parser.getName());然后去request.getRequestDispatcher(redir).forward(request, response);請告訴我,我做錯了什么!THX!
添加回答
舉報
0/150
提交
取消