国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

java - Strtus2 跳轉到WEB-INF/content下

瀏覽:109日期:2023-10-19 08:53:55

問題描述

使用strtus2,action進行跳轉的時候,自動跳轉到WEB-INF/content目錄下。不知道哪里出問題了。

我是把所有的文件都放在了webroot下,java - Strtus2 跳轉到WEB-INF/content下

下面是我的幾個文件

web.xml

<?xml version='1.0' encoding='UTF-8'?><web-app version='2.5' xmlns='http://java.sun.com/xml/ns/javaee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd'> <!-- 1. listener 2.Filter 3.servlet 4.welcome-file-list --> <!--========================== 1. 配置Spring========================== --> <context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext.xml</param-value> </context-param> <listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- ==========================配置struts2========================== --> <filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list><welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app>

applicationContext.xml

<?xml version='1.0' encoding='UTF-8'?><beans xmlns='http://www.springframework.org/schema/beans' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'xmlns:p='http://www.springframework.org/schema/p' xmlns:aop='http://www.springframework.org/schema/aop'xmlns:context='http://www.springframework.org/schema/context' xmlns:jee='http://www.springframework.org/schema/jee'xmlns:tx='http://www.springframework.org/schema/tx'xsi:schemaLocation=' http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd'> <!-- ==================1.基于注解,掃描包============================= --> <context:component-scan base-package='com.demo.*'></context:component-scan> <!-- ==================2.數據源配置============================= --> <context:property-placeholder location='classpath:config/DBconfig.properties'/> <beanp:driverClassName='${driverClassName}' p:url='${url}' p:username='${username}' p:password='${password}' > </bean> <!--==================3.JdbcTemplate============================= --> <bean class='org.springframework.jdbc.core.JdbcTemplate'> <property name='dataSource' ref='dataSource'></property> </bean> <!-- ==================4.事務管理(AOP : Aspect Oriented Programming)============================= --> <!--(a) 配置事務對象: --> <bean class='org.springframework.jdbc.datasource.DataSourceTransactionManager'> <property name='dataSource' ref='dataSource'></property> </bean> <tx:annotation-driven transaction-manager='txManager'/> <!-- (b) AOP橫切事務 --> <aop:config> <aop:pointcut expression='execution(* com.demo.dao..*.*(..))'/> <aop:advisor advice-ref='txAdvice' pointcut-ref='txPC'/> </aop:config> <!--(c) 事務屬性定義--> <tx:advice transaction-manager='txManager'> <tx:attributes> <tx:method name='query*' read-only='true' /> <tx:method name='save*' propagation='REQUIRED' /> <tx:method name='add*' propagation='REQUIRED' /> <tx:method name='update*' propagation='REQUIRED' /> <tx:method name='delete*' propagation='REQUIRED' /> </tx:attributes> </tx:advice> </beans>

頁面代碼

java - Strtus2 跳轉到WEB-INF/content下

問題解答

回答1:

配置路徑應該加上WEB-INF吧

回答2:已經解決了,原來是我action-->location中沒有加“/”。
標簽: java
相關文章:
主站蜘蛛池模板: 一个人看的www日本高清视频 | 中文字幕精品视频 | 国产欧美va欧美va香蕉在线观 | 亚洲 欧美 激情 另类 校园 | www.久草.com| 视频二区 中文字幕 欧美 | 国产91香蕉| 热99re久久精品精品免费 | 国产麻豆入在线观看 | 日本美女黄色一级片 | 国产成人小视频 | 天天躁日日躁狠狠躁一级毛片 | 天天视频一区二区三区 | 91成人爽a毛片一区二区 | 国产a级特黄的片子视频免费 | 狠狠一区 | 亚洲乱强 | 国产成人精品久久一区二区小说 | 久久久国产99久久国产首页 | 亚洲精品视频在线看 | 亚洲精品亚洲人成人网 | 久久国产精品一区二区三区 | 欧美激情性色生活片在线观看 | 欧美男人天堂 | 精品一区二区三区免费站 | 国产欧美日韩一区 | 日韩亚洲精品不卡在线 | 成人观看免费大片在线观看 | 韩国美女爽快一毛片免费 | 免费在线观看一区二区 | 在线日韩欧美 | 婷婷丁香久久 | 深夜福利爽爽爽动态图 | 国产精品成人观看视频免费 | 亚洲欧美日韩综合久久久久 | 在线成人天天鲁夜啪视频 | 美女在线看永久免费网址 | 欧美精品99久久久久久人 | 91九色首页 | 欧美aaaaaaaa| 国产成人精品午夜二三区 |