1.<frameset>框架标签不能嵌套在<body>标签里面,否则的话,框架的效果出不来;
2.并且使用框架的时候如果在左边菜单点击的时候,可以通过在链接标签<a>中的"href"中设置为<frame name="">中的name属性名字即可,这样就会在指定的<frameset>框架中指定的区域出现自己的页面,如果是想要在整个铺开,即跳出框架显示,则可以设置为<target/>中的target中为top或者为parent,或者在<head>里面设置<base href="" target="">中的target属性;
3.页面输入值往后台转时,如果出现乱码时,则可以使用过滤器设置,并将页面提交的方式改为"post"方式,这样可以解决乱码问题;
Java代码是:
package com.jbit.hr.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class EncodingFilter implements Filter {
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);
}
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
}
Web.xml中配置如下:
<!-- =============================================过滤器配置======================================== -->
<filter>
<filter-name>EncodingFilter</filter-name>
<filter-class>com.jbit.hr.filter.EncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>EncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>