易截截图软件、单文件、免安装、纯绿色、仅160KB

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页面的解析。


相关文档:

JSP避免Form重复提交的三种方案

  1 Javascript ,设置一个变量,只允许提交一次。
  #lt;script language="javascript"#gt;
   var checkSubmitFlg = false;
   function checkSubmit() {
   if (checkSubmitFlg == true) {
   return false;
   }
   checkSubmitFlg = true;
   return true;
   }
   document.ondblcli ......

JSP文件

<%@ 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 ......

js、jsp传递参数乱码问题解决

以前有提到过乱码问题,最近在使用window.open时又出现此类问题,现解决如下:
1:使用encodeURIComponent函数对参数进行处理,例如:window.open("html.jsp?name=" + encodeUrlComponent(value)));
2:修改tomcat服务器的server.xml文件添加:useBodyEncodingForURI="true"或者
URIEncoding=" ......

JSP中动态INCLUDE与静态INCLUDE的区别

JSP中有两种包含语句:
1. <%@include file="head.jsp" %>
2. <jsp:include page="head.jsp" />
   或者:
  <jsp:include page="jieshou.jsp">
   <jsp:param name="canshu" value="magci" />
 &nbs ......

javabean向传jsp传值

struts-config:
<action path="/articleManage" name="articleManageForm"  scope="request" type="auction.action.ArticleManageAction" validate="false">
   <forward name="atriclesList" path="/WEB-INF/publish/articleManage/atriclesList.jsp"/>
   <forward ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号