Remove hardcoded text from strus1 web project JSP

Source: Internet
Author: User
Tags tld

1. Add the hardcoded JSP text to the applicationresources. properties file respectively, and add the key-value pairs as an example (Label. Success = SEARCH success !), Put the applicationresources. properties resource file in the SRC folder (Remove COM. BroadVision. struts1hardcodedelete in the following step), or a SRC package, such as com. BroadVision. struts1hardcodedelete.

2. modify the content of web. xml:

Set <init-param>
<Param-Name> application </param-Name>
<Param-value> com. BroadVision. struts1hardcodedelete. applicationresources </param-value>
</Init-param>

Before adding it to </servlet>, that is, placing it between <servlet> </servlet>.

3. Change the content of the struts-config.xml:

Set <message-Resources
Parameter = "com. BroadVision. struts1hardcodedelete. applicationresources"
Null = "false"/>

Before you add </Struts-config>, that is, the end of the struts-config.xm file.Null = "false"Not required. Otherwise, nullexception, message, andCannot find Message Resources under key org. Apache. Struts. Action. MessageError

4. introduced at the beginning of the corresponding JSP file <% @ taglib uri = "/WEB-INF/TLDs/struts-bean.tld" prefix = "Bean" %> (bean TLD file path ), <Bean: Message key = "label. success "/>. Label. Success is the key value of the first step.

If any omission exists, please correct it. Thank you!

Related Article

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.