struts2框架在jsp页面无法解析EL表达式的问题解决
是在struts2下要解决该问题,需要两个条件:
1、确保该应用为J2EE的应用,即在web.xml下保证有以下配置信息:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
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_2_5.xsd">
以上配置信息如果是通过MyEclipse建立的应用都会有的。因此关键是下面一步:
2、在jsp页面上设置EL表达式属性,使jsp页面能够解析EL表达式:
<%@page isELIgnored="false" %>
该属性jsp页面可能无法辨别出来,但无碍于jsp页面的解析。
相关文档:
对于HTM网页,加入:
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
然后,jsp页面中加入:
<%
response.setHeader("Cache-Control","no-store") ......
<%@ page language="java" import="kg.TestBean2;" %>
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>HelloBean</title>
</head>
<body>
<%--
<%
kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean");
if ......
一、
问:org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
答:PostgreSQ数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,就会报一些以上的异常。要解决这个问题 ......
JSP中有两种包含语句:
1. <%@include file="head.jsp" %>
2. <jsp:include page="head.jsp" />
或者:
<jsp:include page="jieshou.jsp">
<jsp:param name="canshu" value="magci" />
&nbs ......