Problems and Solutions during struts running

Source: Internet
Author: User
Tags tld

Add this link if repostedHttp://blog.csdn.net/imainTable Source

The following are my first problems with Struts:

1. Tomcat is started successfully, but an error is reported when running the program:HTTP status 404-(/Wisdom/inputcontent. jsp ). Error cause:

C:/Tomcat 4.1/webapps/wisdom/WEB-INF/the lack of struts Tag file (. TLD), the lack of. TLD file copy to the directory can be.

2. The running program appearsCannot find Message Resources under key org. Apache. Struts. Action. MessageError. It indicates that it cannot be found.Applicationresources. Properties, Pay attention to the following four aspects.

First, add the following content to the Web. xml file <web-app> <servlet> "</servlet> </Web-app>.

<Init-param>
<Param-Name> application </param-Name>
<Param-value> applicationresources </param-value>
</Init-param>

Second: add the following settings in the struts-config.xml:

<Message-resources parameter = "applicationresources"/>

This setting is best placed in: </Action-mappings>"Put it here"</Struts-config>

Third: EnsureApplicationresources. PropertiesFiles are in the WEB-INF/classes folder you created.

You can put applicationresources. properties in other directories in the classes folder, for example:
Put applicationresources. properties in the WEB-INF/classes/mydir folder.Struts-config.xmlMust be modified

<Message-resources parameter = "mydir/applicationresources"/>
  
Fourth: it may be a key value issue. Struts resource files can also be configured in Multi-resource source files, such as the configuration.

<Message-resources parameter = "applicationresources" Key = "myappres"/>

If there is only one resource file with a key, it will throwOrg. Apache. Struts. Action. MessageAn error occurred. Delete the key.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.