Ueditor1.4.3jsp has not found the uploaded file in the upload image Report & quot; solution, ueditor1.4.3

Source: Internet
Author: User

Ueditor1.4.3jsp, ueditor1.4.3

This is because of the struts2 filter. The solution is to customize a filter.

Create a filter class with the following code:

1 package com. filter; 2 3 import java. io. IOException; 4 5 import javax. servlet. filterChain; 6 import javax. servlet. servletException; 7 import javax. servlet. servletRequest; 8 import javax. servlet. servletResponse; 9 import javax. servlet. http. httpServletRequest; 10 11 import org. apache. struts2.dispatcher. ng. filter. optional; 12 13 public class extends limit {14 public void doFilter (ServletRequest req, ServletResponse res, 15 FilterChain chain) throws IOException, ServletException {16 HttpServletRequest request = (HttpServletRequest) req; 17 String url = request. getRequestURI (); 18 System. out. println (url); 19 if (url. contains ("/jsp/") {20 System. out. println ("use custom filter"); 21 chain. doFilter (req, res); 22} else {23 System. out. println ("use default filter"); 24 super. doFilter (req, res, chain); 25} 26}

Then configure the struts2 filter in web. xml.

1     <filter>2         <filter-name>struts2</filter-name>3         <filter-class>com.filter.EditorStrutsFilter</filter-class>4     </filter>5     <filter-mapping>6         <filter-name>struts2</filter-name>7         <url-pattern>/*</url-pattern>8     </filter-mapping>

Note:

1   <filter>2         <filter-name>struts2</filter-name>3         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>4     </filter>

Delete it

 

Finally, I hope you reprint please indicate the source, respect for others' labor results http://my.oschina.net/jiangli0502/blog/210263

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.