小编Lit*_*ski的帖子

如何使用Tuckey URL重写从一个URL重定向到另一个URL?

我有两个域名如www.1st-domain.comwww.2nd-domain.com 我想写一个Tuckey URL重写规则,重定向去任何要求www.1st-domain.com,以www.2nd-domain.com

例如,如果有人点击www.1st-domain.com/sample它应该被重定向到www.2nd-domain.com/sample

我正在尝试这样的事情:

<rule>
        <name>Domain Name Check</name>
        <condition name="host" operator="equal">www.1st-domain.com</condition>
        <from>^(.*)</from>
        <to type="redirect">http://www.2nd-domain.com$1</to>
    </rule>
Run Code Online (Sandbox Code Playgroud)

它不起作用.我究竟做错了什么?请指导.

url http url-rewriting tuckey-urlrewrite-filter

2
推荐指数
1
解决办法
1886
查看次数

如何使用JSTL forEach循环来实现自定义结构?

我的JSP中有一个模型属性(包含名称的List).例如myList

现在,我可以使用forEach轻松遍历JSP中的列表,例如

<c:forEach items="${myList}" var = "singleItem" varStatus="status">  
  ${singleItem.name}
</c:forEach>
Run Code Online (Sandbox Code Playgroud)

这很好用.现在我的要求是我有一个我需要展示的结构:

    <div id="top"></div>
      <p>name1</p>
      <p>name2</p>
    <div id="bottom"></div>

    <div id="top"></div>
      <p>name3</p>
      <p>name4</p>
    <div id="bottom"></div>

    <div id="top"></div>
      <p>name5</p>
      <p>name6</p>
    <div id="bottom"></div>
Run Code Online (Sandbox Code Playgroud)

这里名称1,名称2等在myList.那么如何以这样的方式运行forEach循环,以便我可以实现上面显示的输出.我被卡住了.请帮我.:(

html java foreach for-loop jstl

2
推荐指数
1
解决办法
1546
查看次数

在AngularJS控制器中获取$ resource调用的值

我正在使用AngularJS并且我已经进行了$ resource调用以获取单个值(例如,fetch使我得到14).

以下是我的控制器:

var MaxCount = $resource('/maxquestion/fetch', null, 
{
    getMaxQuestionCount: {method: 'GET', isArray: false}
});
$scope.maxQuestionCount = MaxCount.getMaxQuestionCount();
Run Code Online (Sandbox Code Playgroud)

现在我正试图$scope.maxQuestionCount在控制器中使用,做$scope.maxQuestionCount[0]了给我1$scope.maxQuestionCount[1]给了我4

console.log($scope.maxQuestionCount)我,[object Object] console.dir($scope.maxQuestionCount)There are no child objects

我糊涂了.如何获取值14?

javascript controller angularjs

2
推荐指数
1
解决办法
1401
查看次数

获取错误:架构不能包含两个具有相同名称的全局组件

配置Hibernate时,我的配置文件中出现以下错误.

Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.1.xsd)
Run Code Online (Sandbox Code Playgroud)

当我查看"更多详情"时,它给了我以下内容:

sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://www.springframework.org/schema/beans,identifiedType'.
Run Code Online (Sandbox Code Playgroud)

我有一个applicationContext.xml文件,其架构定义(我导入我的hibernate-context.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:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.1.xsd
            http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

..
..
<!-- Imports datasource configuration -->
<import resource="hibernate-context.xml" />
Run Code Online (Sandbox Code Playgroud)

我的hibernate-context.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:tx="http://www.springframework.org/schema/tx" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc" 
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
            http://www.springframework.org/schema/tx 
            http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-3.1.xsd
            http://www.springframework.org/schema/jdbc 
            http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
            http://www.springframework.org/schema/data/jpa
            http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
            http://www.springframework.org/schema/util 
            http://www.springframework.org/schema/util/spring-util-3.1.xsd
            http://www.springframework.org/schema/mvc …
Run Code Online (Sandbox Code Playgroud)

xml spring xsd hibernate

1
推荐指数
1
解决办法
1万
查看次数