struts_hdlogin.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="hdlogin" extends="cx-struts-default" namespace="/hdlogin">
<!-- 登录-->
<action name="login" class="org.hd.login.action.LoginAction" method="login">
<result name="success">/jsp/layout/main.jsp</result>
<result name="loginfail">/hdlogin.jsp</result>
</action>
</package>
</struts>
上面的请求返回的页面:
main.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!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=utf-8" />
<title>客户服务中心系统</title>
<link rel="shortcut icon" href="<%=path%>/resource/images/favicon.ico" type="image/x-icon"/>
</head>
<body>
<iframe src="layout/haha.jsp" width="100%" height="100%"
name="maininner" id="maininner" frameborder="0" scrolling="hidden"></iframe>
</body>
</html>
工程的页面路径关系: