(注:这个问题已解决:见:http://www.learndiary.com/disDiaryContentAction.do?goalID=292)
1、直接写在jsp页面的中文显示不正常,用“native2ascii -encoding gb2312 old.jsp new.jsp"也不行,gb2312换成utf-8也不行,
但是,在<% out.println(用“native2ascii -encoding gb2312 old.jsp new.jsp”) %>却正常,在javascript里显示的此类处理过的中文也正常,
我是按照网上别人的方法试的,但是就是不行,明天再试试。
2、jstl中的<c:set>标签的值是否可为自定义的对象还不清楚?
见下:
来自:jbas, 时间:2004-10-19 13:42:00, ID:2854482 [显示:小字体 | 大字体]
这是我程序的一部分:
<jsp:useBean id="idCommunity" class="com.beltino.communitymedical.community.Community" scope="page" />
<c:set var="id" value="${param.id}"/>
<c:set var="action" value="${param.action}"/>
<c:set var="retList"/>
<c:if test="${empty id}">
<c:set var="action" value="new"/>
</c:if>
<c:if test="${!empty id}">
<c:set var="action" value="edit"/>
/*用inCommunity中含有“return this;”的方法getCommunityInformation(id)返回类Community的一个
*对象,这个对象的唯一标识ID是"id".
*/
<c:set var="idCommunity" value="${idCommunity.getCommunityInformation(id)}"/> //有问题
/*返回这个对象的子对象的一个列表retList*/
<c:set var="retList" value="${idCommunity.getCommunityChildByPId(id)}"/>
</c:if>
........
现在 <c:set var="idCommunity" value="${idCommunity.getCommunityInformation(id)}"/>这样写有问题,页面提示出错:
org.apache.jasper.JasperException: /webapp/community/editCommunity.jsp(24,3) The function getCommunityInformation must be used with a prefix when a default namespace is not specified
可是如果我在resin下可以的。如果我调用不带参数的也是可以的
3、在jsp+struts页面中怎么样加meta标记呢?如果转换成了utf-8, 这个meta还起作用吗?我不知道。