Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 升级到struts 2.3.15.1_Java_Struts2_Ognl - Fatal编程技术网

Java 升级到struts 2.3.15.1

Java 升级到struts 2.3.15.1,java,struts2,ognl,Java,Struts2,Ognl,从2.2.1.1升级到struts2.3.15.1[struts S2-016] <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.3.15.1</version> </dependency>

2.2.1.1升级到struts2.3.15.1[struts S2-016]

    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.3.15.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-junit-plugin</artifactId>
        <version>2.3.15.1</version>
        <exclusions>
            <exclusion>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
            </exclusion>
        </exclusions>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.struts.xwork</groupId>
        <artifactId>xwork-core</artifactId>
        <version>2.3.15.1</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-spring-plugin</artifactId>
        <version>2.3.15.1</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
在我调查之后,似乎我也应该将ognl版本从

<dependency>
            <groupId>ognl</groupId>
            <artifactId>ognl</artifactId>
            <version>3.0</version>
        </dependency>
struts似乎再也不能识别出完美的语言列表了

<action name="Login" class="LoginAction">
            <result name="input">/LoginForm.jsp</result>
            <result name="success" type="redirect">FillMe.do</result>
        </action>

/LoginForm.jsp
给我加油
Jsp页面

<form id="LoginForm" class="c2" method="post" action="Login.do">
        <div class="c1">
            <label for="login"><s:text name="Users.Login"/> :</label>
            <input type="text" id="login" name="login" maxlength="64"/>
        </div>
        <div class="c1">
            <label for="password"><s:text name="Users.Password"/> :</label>
            <input type="password" id="password" name="password" maxlength="64" maxlength="32"/>
        </div>
        <div class="c1">
            <label for="locale"><s:text name="Users.Language"/> :</label>
            <s:select id="locale" name="locale" list="languages" />
        </div>

    </form> 

:
:
:
我的名单

public Map<String, String> getLanguages() {
        LinkedHashMap<String, String> languages = new LinkedHashMap<String, String>();

            Iterator<String> it = Manager.getManager(current).getLanguagesList().iterator();
            while (it.hasNext()) {
                String lang = it.next();
                languages.put(lang, getText("Users.Language." + lang.substring(0, 2).toUpperCase()));
        }
        return languages;
    }
publicmap getLanguages(){
LinkedHashMap languages=新建LinkedHashMap();
Iterator it=Manager.getManager(当前).getLanguagesList().Iterator();
while(it.hasNext()){
String lang=it.next();
languages.put(lang,getText(“Users.Language.+lang.substring(0,2.toUpperCase()));
}
返回语言;
}

为什么
2.3.15.1
?使用最新的。在jsp、操作配置中发布更多信息。@AleksandrM update info正如我前面提到的,我的应用程序在升级之前运行良好。我只将pom struts版本更改为2.3.15.1,我得到了这个问题,显示了该操作的操作配置,其中显示了您的登录表单。如果要升级,为什么不使用最新版本?为什么
2.3.15.1
?使用最新的。在jsp、操作配置中发布更多信息。@AleksandrM update info正如我前面提到的,我的应用程序在升级之前运行良好。我只将pom struts版本更改为2.3.15.1,我得到了这个问题,显示了该操作的操作配置,其中显示了您的登录表单。如果您正在升级,为什么不使用最新版本?
<action name="Login" class="LoginAction">
            <result name="input">/LoginForm.jsp</result>
            <result name="success" type="redirect">FillMe.do</result>
        </action>
<form id="LoginForm" class="c2" method="post" action="Login.do">
        <div class="c1">
            <label for="login"><s:text name="Users.Login"/> :</label>
            <input type="text" id="login" name="login" maxlength="64"/>
        </div>
        <div class="c1">
            <label for="password"><s:text name="Users.Password"/> :</label>
            <input type="password" id="password" name="password" maxlength="64" maxlength="32"/>
        </div>
        <div class="c1">
            <label for="locale"><s:text name="Users.Language"/> :</label>
            <s:select id="locale" name="locale" list="languages" />
        </div>

    </form> 
public Map<String, String> getLanguages() {
        LinkedHashMap<String, String> languages = new LinkedHashMap<String, String>();

            Iterator<String> it = Manager.getManager(current).getLanguagesList().iterator();
            while (it.hasNext()) {
                String lang = it.next();
                languages.put(lang, getText("Users.Language." + lang.substring(0, 2).toUpperCase()));
        }
        return languages;
    }