我是JSP新手并使用Expression语言.我正在使用Eclipse Galileo 2.5版和Tomcat 6服务器.我只是想问一下,我的简单表达式语言不会像我写的那样打印${1>2}
,假设它给出了假,但${1>2}
它只在呈现页面时显示 .但是当我使用<c:out value="${1>2}"/>
它时,正确打印错误.我认为标签库存在问题.请建议我这样做的原因我给出了一个示例代码,以便您可以了解我的错误: -
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Expression Language Example</title>
</head>
<body>
Is 1 greater than 2 using cout :<c:out value="${1>2}"/>
Is 1 greater than 2 without using cout: ${1>2}
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
根据答案更新,这里有更多信息:
我正在展示我的web.xml
样子:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" …
Run Code Online (Sandbox Code Playgroud) 我被困在某些地方,我需要在Java代码中获得数据库更改.请求是在db的任何表中更新,添加,删除任何记录; 应该被Java程序识别.怎么可以实现JMS?还是Java线程?
更新:感谢大家的支持我实际上使用Oracle作为DB和Weblogic 10.3研讨会.实际上我想从一张表格中获取更新,其中我只有读取权限,所以大家都有什么建议.我无法更新数据库.我唯一能做的就是读取数据库,如果表中有任何变化,我必须得到某些数据行已被添加/删除或更新的信息/通知.
嗨所有我在使用forEach进行迭代时遇到问题我给出完整的代码请告诉我这是错的.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form method="get" action="go">
<center><input type="SUBMIT"></center>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>FirstJsp</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
<!--
<description>
State saving method: "client" or "server" (= default)
See JSF Specification 2.5.2
</description>
-->
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping> …
Run Code Online (Sandbox Code Playgroud)