department.jsp取出来的值怎么放到文本框里边 ?<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>添加部门</title><meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--></head><body> <s:property value="#request.updateDep.dep_name" /> <s:form action="manage_update" namespace="/department" method="post">
<s:hidden name="department.dep_id" value=" ${updateDep.dep_id }"></s:hidden>
     部门名称:<s:textfield name="department.dep_name"
value=" ${updateDep.dep_name  }"></s:textfield>
<br />
     部门简称:<s:textfield name="department.dep_shortname"
value=" ${updateDep.dep_shortname  }"></s:textfield>
<br /> <input type="submit" value="保存" />
</s:form></body>
</html>报错:
org.apache.jasper.JasperException: /WEB-INF/page/departmentUpdate.jsp (line: 31, column: 2) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
web.xml <web-app version="3.0" 
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">求大虾们帮忙了 怎么解决啊?是不是用其他标签?SSH2JSTL OGNL HTML

解决方案 »

  1.   

    struts2标签里不能嵌套别的标签,包括他自己
    你可以这样
    <input type="hidden" name="department.dep_id" value="${updateDep.dep_id}"><s:textfield name="department.dep_name"></s:textfield> 
      

  2.   

    错误报告是这样的:attribute value does not accept any expressions
    意思就是,在value属性中不能放任何的表达式。也就是说你用value="aaa"是可以的,但不能放任何描述性内容。
    如果你想在java赋值传给画面,那么就赋值给department.dep_name,然后在jsp里如下写:
    <s:textfield name="department.dep_name"></s:textfield>
      

  3.   

    你可以在value里面写<s:property>
    value="<s:property value="#request.updateDep.dep_name" />"