Cannot find message resources with key org.apache.struts.action.MESSAGE in struts

The following error appears in the browser window:

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: cannot find message resources in the key org.apache.struts.action.MESSAGE

I have included the resource file in struts-config.xml using

And my resource file is stored as a WEB-INF / classes / Application.properties file.

+3
source share
6 answers

Well, this is an old post, but my answer may help, I think ... I personally spent some time doing the poetry that was developed for Tomcat 5.5 for Tomcat 7.

Note. You must specify your ressource file: "ApplicationResources" ...

, , , , :

<message-resources parameter="ApplicationResources" null="false" />

"struts-config.xml".

, : "web.xml":

    <context-param>
        <param-name>application</param-name>
        <param-value>ApplicationResources</param-value>
    </context-param>

"servlet".

, , . - ()?

+2

, XML . ? ? JBoss?

xalan xerces.

0

, maven, resources .

struts-config.xml :

<message-resources parameter="messages.appResources" null="false"/>

pom.xml :

        <resource>
            <directory>src/main/resources</directory>
        </resource>

messages . :

${project.basedir}/src/main/resources/messages
0

:

Struts :

()

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC 
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" 
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">

<message-resources
    parameter="common.properties.Common" /> (or the path to your resources file)

, -, struts-config.xml DOCTYPE .

0

, DTD struts-config.xml:

:

//EN ""Http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd" >

Pb :

0

struts-config.xml

<message-resources parameter = "ApplicationResources" null = "false" key = "ApplicationResources" / ">

0
source

Source: https://habr.com/ru/post/1791971/


All Articles