The Struts dispatcher cannot be found. solution to this error when using The struts tag

Source: Internet
Author: User

Error scenarios:

Condition 1: The struts2 core filter filters url-pattern to *. action.

Condition 2: The struts tag is used in the JSP page.

Condition 3: Access the JSP page directly through a url

Error message:

The Struts dispatcher cannot be found. this is usually caused by using Struts tags without the associated filter. struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. -[unknown location]

Solution:

The error message is clear:This error is usually caused by the fact that the struts tag is not associated with the core filter. The Struts TAG takes effect only when the request passes the core filter, because the Struts tag requires the core filter to initialize it..

1. Change the ing of core filters in web. xml /*
Struts2 org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter struts2

 

2. or append the *. jsp filter to the core filter.
Struts2 *. action struts2

 




 

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.