又有新问题了

daiing 2007-04-02
问题是这样的,我从一个列表进入一个输入界面然后提交,提交好了以后回到这个列表界面,下一页等等功能都无法使用了,javascript报错,655行"对象不支持此属性或方法",右上方出现一个红底色的字条,内容是乱码“姝e湪鎻愪氦...”,估计是载入什么的
fins 2007-04-02
ecside ---> 输入表单

输入表单 ----> ecside
所走的 action 方法是怎样写的呢??

我们项目中大部分的应用都像你说的那种方式 没有发现这个问题
可能你哪里有些地方比较特殊
希望能提供action和jsp代码
以方便我帮你解决问题
daiing 2007-04-03
ecside的jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>

<%@ include file="/common/jsp/head.jsp"%>
<script type="text/javascript">
<!--
function create(){
location.href = "menu.do?action=create"
}
function update(xtcddm){
location.href = "menu.do?xtcddm="+xtcddm+"&action=update";
}
function del(xtcddm){
if(window.confirm("<spring:message code="system.delete.confirm"/>")){
location.href = "menu.do?xtcddm="+xtcddm+"&action=remove";
}
}
//-->
</script>

<body onload="init()">

<topcase:title title="system.menu.menulist.title" pageno="900-040" helptip="system.menu.menulist.helptip"/>
<topcase:info type="tip" content="system.menu.menulist.tipinfo"/>
<topcase:info type="warning" content="{warning}"/>

<topcase:buttontable>
<topcase:button value="system.button.create" onclick="create()"/>
</topcase:buttontable>

<ec:table items="menulist" var="obj">
<ec:exportXls fileName="menulist.xls" />
<ec:column property="iid" cell="rowCount" title="序号" width="30" filterable="false"/>
<ec:row>
<ec:column property="b" title=" " width="40" filterable="false">
<topcase:button value="system.button.update" onclick="update('${obj.xtcddm}')" cssclass="smallbtn"/>
</ec:column>
<ec:column property="b" title=" " width="40" filterable="false">
<topcase:button value="system.button.delete" onclick="del('${obj.xtcddm}')" cssclass="smallbtn"/>
</ec:column>
<ec:column property="xtcddm" title="system.menu.xtcddm"/>
<ec:column property="xtcdnr" title="system.menu.xtcdnr" />
<ec:column property="xtcdlj" title="system.menu.xtcdlj" filterable="false"/>
<ec:column property="xtmkdm" title="system.menu.xtmkdm" filterable="false"/>
<ec:column property="xtmkmc" title="system.menu.xtmkmc" filterCell="droplist" />
<ec:column property="xtqybz" title="system.xtqybz" filterCell="droplist" />
<ec:column property="xtczrq" title="system.xtczrq" cell="date" filterable="false"/>
<ec:column property="xtczsj" title="system.xtczsj" filterable="false"/>
<ec:column property="xtczry" title="system.xtczry" filterable="false"/>
</ec:row>
</ec:table>

我点update按钮进入menuaction
package webapp.action.dms.system;

import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import service.dms.system.MenuService;
import auto.util.DateUtil;
import auto.util.StringUtil;
import dao.dms.system.model.Menu;

public class MenuAction extends SimpleFormController {
private MenuService service;

/*
* post鏂瑰紡澶勭悊form鎻愪氦

*/
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws Exception{
Menu cmd = (Menu)command;
HashMap map = new HashMap();
if(cmd.getAction().equalsIgnoreCase("create")){
//if(true) {
// map.put("command",level);
// map.put("{warning}", "鎶ラ敊浜�");
// return new ModelAndView(this.getFormView(),map);
//}
cmd.setXtczrq(new Long(DateUtil.getCurrentDate()));
cmd.setXtczsj(new Long(DateUtil.getCurrentTime()));
getService().persistMenu(cmd);
List list = getService().findAllMenus();
HttpSession session = request.getSession(true);
session.setAttribute("menulist", list);
return new ModelAndView(this.getSuccessView(),map);
}
return new ModelAndView(this.getFormView(),map);
}

/*
* get鏂瑰紡澶勭悊
*/
public ModelAndView showForm(
HttpServletRequest request, HttpServletResponse response, BindException errors)
throws Exception{
String action = request.getParameter("action");
HashMap map = new HashMap();
if(action == null || action.equalsIgnoreCase("list")) {
List list = getService().findAllMenus();
HttpSession session = request.getSession(true);
session.setAttribute("menulist", list);
return new ModelAndView(this.getSuccessView(),map);
}else if(action.equalsIgnoreCase("create")){
map.put("command",new Menu());
return new ModelAndView(this.getFormView(),map);
}else if(action.equalsIgnoreCase("update")){
String xtcddm = StringUtil.obj2String(request.getParameter("xtcddm"));
Menu menu = getService().findMenuById(xtcddm);
map.put("command",menu);
return new ModelAndView(this.getFormView(),map);
}else if(action.equalsIgnoreCase("remove")){

String xtcddm = StringUtil.obj2String(request.getParameter("xtcddm"));
Menu menu = getService().findMenuById(xtcddm);
getService().removeMenu(menu);
List list = getService().findAllMenus();
HttpSession session = request.getSession(true);
session.setAttribute("menulist", list);
return new ModelAndView(this.getSuccessView(),map);
}
return null;
}

public MenuService getService() {
return service;
}

public void setService(MenuService service) {
this.service = service;
}
}

调用menuaction的showform方法,进入formview,也就是menuform.jsp

<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB2312"%>
<%@ include file="/common/jsp/head.jsp"%>
<script language="JavaScript">
<!--

var sign = false;
function validform(){
if(sign){
alert("正在提交中,请稍候");
return false;
}else if(!validempty("xtcddm")){
return false;
}else{
sign = true;
thisform.action.value="create";
return true;
}
}
//-->
</script>

<topcase:title title="system.menu.menuform.title" pageno="900-010-1" helptip="system.menu.menuform.helptip"/>
<topcase:info type="tip" content="system.tip"/>
<topcase:info type="warning" content="{warning}"/>

<topcase:buttontable>
<topcase:button value="system.button.save" onclick="if(validform()){thisform.submit()}"/>
<topcase:button value="system.button.back" onclick="history.go(-1)"/>
</topcase:buttontable>

<TABLE class="tbBlock" cellSpacing=1 border=0 width="98%"><TBODY>

<form:form method="post" name="thisform" action="menu.do" commandName="command">
<TR><TD class="tdRightW30H20"><spring:message code="system.menu.xtcddm"/></TD>
<TD class="tdLeftH20">
<form:input path="xtcddm" maxlength="20" cssClass="input2" size="20"/><FONT color="#FF0000">*</FONT>
<form:hidden path="action"/>
</TD></TR>

<TR><TD class="tdRightW30H20"><spring:message code="system.menu.xtcdnr"/></TD>
<TD class="tdLeftH20">
<form:input path="xtcdnr" maxlength="50" cssClass="input2" size="20"/><FONT color="#FF0000">*</FONT>
</TD></TR>

<TR><TD class="tdRightW30H20"><spring:message code="system.menu.xtcdlj"/></TD>
<TD class="tdLeftH20">
<form:input path="xtcdlj" maxlength="100" cssClass="input2" size="20"/><FONT color="#FF0000">*</FONT>
</TD></TR>

<TR><TD class="tdRightW30H20"><spring:message code="system.menu.xtmkdm"/></TD>
<TD class="tdLeftH20">
<form:input path="xtmkdm" maxlength="10" cssClass="input2" size="20"/><FONT color="#FF0000">*</FONT>
</TD></TR>

<TR><TD class="tdRightW30H20"><spring:message code="system.menu.xtmkmc"/></TD>
<TD class="tdLeftH20">
<form:input path="xtmkmc" maxlength="50" cssClass="input2" size="20"/><FONT color="#FF0000">*</FONT>
</TD></TR>

<TR><TD class="tdRightW30H20"><spring:message code="system.xtqybz"/></TD>
<TD class="tdLeftH20">
<form:select path="xtqybz">
<form:option value="Y"/>
        <form:option value="N"/>
    </form:select>
</TD></TR>

</TBODY></form:form></TABLE>

提交后,进入menuaction的onsubmit方法
保存完毕进入successview,就是回到ecside列表
这个时候就无法换页什么的,报错655行"对象不支持此属性或方法",右上方出现一个红底色的字条,内容是乱码“姝e湪鎻愪氦...”,至于这个乱码,我把ecside。js里面哪个载入的话换成英文就可以显示了,ecside。js需要什么编码格式的?我用的UTF-8的格式,我发现如果ecside。js格式不对,就会显示一大堆空表格,现在编码格式这个问题很头痛啊
fins 2007-04-03
你的项目的应用的编码是什么啊??
"/common/jsp/head.jsp"里指定的
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
是什么编码?
GBK还是  GB18030 GB2312
你过滤器里配置的编码是什么?
"FAQ 之 :乱码问题 " 里提到的那些注意事项你都注意了?


daiing 2007-04-03
这是我的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="dms">
<display-name>dms</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>

<filter>
<filter-name>eXtremeExport</filter-name>
<filter-class>org.ecside.filter.ECSideFilter</filter-class>
<init-param> 
   <param-name>responseHeadersSetBeforeDoFilter</param-name> 
   <param-value>false</param-value> 
</init-param>
<init-param>
<param-name>useEasyDataAccess</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>useEncoding</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>eXtremeExport</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<context-param>
<param-name>ecsidePreferencesLocation</param-name>
<param-value>/extremetable.properties</param-value>
</context-param>
<context-param>
<param-name>ecsideMessagesLocation</param-name>
<param-value>/messages</param-value>
</context-param>

<filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>GBK</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <servlet-name>dms</servlet-name>
    </filter-mapping>

<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>dms</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dms-servlet.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dms</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<resource-ref>
<res-ref-name>jdbc/dms</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

jsp也改成了
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>

head里没有编码
乱码是ecside.js里面的几个中文,改成英文了可以显示了,但是问题还是存在,ecside to form to action to ecside,无法换页了一点就报错655行"对象不支持此属性或方法",出现一个红色底色的loading...(中文改成了英文)
fins 2007-04-03
应该是你的文件编码有问题

为什么ecside.js文件到你那里会乱码??

文件编码有时候不是简单的改一下contentType之类的就能解决的
你要确定你文件本身的编码没有问题
daiing 2007-04-03
应该是什么编码的?我的是UTF-8的
fins 2007-04-03
那问题就难怪了

把ecside部署到utf-8应用下的方法 你可以咨询一下另外一个管理员bjwulin  他在这方面的经验比我多

我还没有时间将ecside转换为utf-8

对给您造成的不便深表歉意

daiing 2007-04-06
但是在提交以后回到ecisde无法换页好像和编码没什么关系
Global site tag (gtag.js) - Google Analytics