struts配置默认首页

 今天码代码,需要配置首页,百度后,尝试了一下,配置方式如下:

struts.xml

<?xml version="1.0" encoding="UTF-8"?>

 

<!DOCTYPE struts PUBLIC

    "-//ApacheSoftware Foundation//DTD Struts Configuration 2.1//EN"

    "http://struts.apache.org/dtds/struts-2.1.dtd">

<struts>

    <constant name="struts.devMode" value="true"></constant>

    <constant name="struts.i18n.encoding" value="UTF-8"></constant>

    <package name="default" namespace="/"extends="struts-default">

     <default-action-ref name="index"></default-action-ref>

     <action name="index">

      <result>/index.html</result>

     </action>

    </package>

</struts>

 

index.html

<html xmlns="http://www.w3.org/1999/xhtml"><head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>jiaxiangjun前端作品</title>

<link rel="stylesheet" href="css/index.css">

<script src="jQuery/jquery-2.1.1.js"></script>

<script src="js/index.js"></script>

</head>

<body>

<div class="top"></div>

    <div class="menu">

       <ul>

           <li class="current"><a href="index.html">我的主页</a></li>

           <li><a href="magnifier/magnifier.html">放大镜效果</a></li>

           <li><a href="magnifier/magnifier.html">Jquery插件</a></li>

           <li><a href="magnifier/magnifier.html">学习资料库</a></li>

           <li><a href="magnifier/magnifier.html">热门标签</a></li>

           <li><a href="magnifier/magnifier.html">QQ群堂</a></li>

           <li><a href="magnifier/magnifier.html">交流社区</a></li>

           <li><a href="magnifier/magnifier.html">在线API</a></li>

           <li><a href="magnifier/magnifier.html">在线留言</a></li>

           <li><a href="map.html">地图导航</a></li>

       </ul>

    </div>

    <div id="container" class="workspace">

    <center>

  <span style="font-size:15px; font-weight:bold;text-align:center; line-height:25px; color:#000; width:100%">jiaxiangjun前端作品<br>

 </span>

    </center>

    </div>

<div class="bottom"> </div>

 

</body></html>

 

你可能感兴趣的:(struts,配置,默认首页)