使用标签

    技术2022-05-11  59

     使用<html:frame>标签

      今天总算做完了一个登录界面,使用了struts框架,总的来说,比原来用javabean+servlet+jsp的开发模式要慢很多啊!我花了两天的时间才搞定一个登录界面,在这其间碰到很多问题。比如:  问题一:在使用资源文件时总报这下面这样的错误。错 误信息 Cannot find message resources under key org.apache.struts.action.MESSAGE我的配置文件如下:</action-mappings>  <message-resources key="rescoure1" parameter="com.bluedot.struts.ApplicationResource_gb2312" />这个问题花了我一上午的时间。到网上搜一下,总算解决了。<message-resources parameter="ApplicationResources" key="myApp"/>struts好像是从默认的资源文件中去读取,所以必须有一个不带key的资源文件如果只有一个带key的资源文件,那就会抛出上面的错误了。删除key即可。其它解决方法就是在web.xml中配置默认的资源绑定文件问题二:使用框架出现了路径不对的问题。<%@ page language="java" pageEncoding="gb2312"%><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title></title><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><base href="<%=basePath%>"></head><frameset rows="*" cols="113,*" framespacing="1" frameborder="yes" border="1">  <frame src="student/studentControl.html" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />  <frame src="student/studentView.html" name="mainFrame" id="mainFrame" title="view" /></frameset><noframes><body></body></noframes></html>

    最新回复(0)