首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • STRUTS2.09+HIBERNATE3.2+SPRING2.05 只能访问ACTION不能访问其它文件 [无满意答案结贴,结贴人:idiots]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 10:36:35 楼主
    STRUTS2.09+HIBERNATE3.2+SPRING2.05  只能访问ACTION不能访问其它文件

    在WEB.XML中的 <welcome-file>/struts/index.jsp </welcome-file> 可以正常显示出来,通过该页面也可以执行查询,功能正常。

    得是在地址栏内输入任何文件都不能访问,只能访问ACTION。

    WEB.XML配置如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>Search Order </display-name>

    <context-param>
        <param-name>contextConfigLocation </param-name>
        <param-value>/WEB-INF/classes/beans.xml </param-value>
        </context-param>
        <filter>
            <filter-name>struts </filter-name>
            <filter-class>org.apache.struts2.dispatcher.FilterDispatcher </filter-class>
        </filter>

        <filter-mapping>
            <filter-name>struts </filter-name>
            <url-pattern>/* </url-pattern>
        </filter-mapping>
       
        <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener </listener-class>
    </listener>
    <welcome-file-list>
          <welcome-file>/struts/index.jsp </welcome-file>
    </welcome-file-list>


    </web-app>

    STRUTS.XML配置如下:
    <?xml version="1.0" encoding="GBK"?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <constant name="struts.devMode" value="true"/>
    <constant name="struts.enable.DynamicMethodInvocation" value ="false"/>   
    <constant name="struts.objectFactory" value="spring"/>
    <include file="struts-default.xml"/>
    <package name="net.order.web.struts" extends="struts-default"
    namespace="/struts">
    <action name="Search" class="results">
    <result name="success">/struts/result.jsp </result>
    <result name="FAIL">/struts/error.jsp </result>
    </action>
    </package>
    </struts>
    BEANS配置如下:

    <bean id="results" scope="prototype" class="net.order.web.struts.search">

    <property name="service" ref="service" />
    </bean>
    20  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2007-12-06 10:38:361楼 得分:0
    补充

    在WEB.XML中的  <welcome-file> /struts/index.jsp </welcome-file>  可以正常显示出来,通过该页面也可以执行查询,功能正常。 但是该面面的图片也不能显示。

    在地址栏内输入任何文件都不能访问,只能访问ACTION。
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved