首页是最初登录,它没有从哪里来request的
只有你登录后,点击登录事件,才会有action把user传送过来

解决方案 »

  1.   

    在写一个页面跳转到首页,在跳转前取数据存入request中。
      

  2.   

    要初始化页面
    1、使用plug-in
    2、使用中转页面,
    3、就是在页面上写JAVA代码(不推荐的)
      

  3.   

    做个SERVLET过滤,tomcat的root文件夹中的index.jsp在被访问前都要经过一个servlet的
    <!-- JSPC servlet mappings start -->    <servlet>
            <servlet-name>org.apache.jsp.index_jsp</servlet-name>
            <servlet-class>org.apache.jsp.index_jsp</servlet-class>
        </servlet>    <servlet-mapping>
            <servlet-name>org.apache.jsp.index_jsp</servlet-name>
            <url-pattern>/index.jsp</url-pattern>
        </servlet-mapping><!-- JSPC servlet mappings end -->
    也不知道这个算不算mvc
      

  4.   

    我记得JSTL好像有个读数据库的标签算了还是不搞这么复杂了
      

  5.   

    <jsp:useBean 范围="application"/>