If you use the previous configuration under struts2, it is not enough.
Because struts2 filters out the ueditor upload path, the upload fails.
There is not much to do, just write a filter.
Create a class in your src package as follows:
01 import java. io. IOException;
02 import javax. servlet. FilterChain;
03 import javax. servlet. ServletException;
04 import javax. servlet. ServletRequest;
05 import javax. servlet. ServletResponse;
06 import javax. servlet. http. HttpServletRequest;
07
08 import org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter;
09
10 public class MyStrutsFilter extends StrutsPrepareAndExecuteFilter {
11 public void doFilter (ServletRequest req, ServletResponse res, FilterChain chain)
12 throws IOException, ServletException {
13 HttpServletRequest request = (HttpServletRequest) req;
14 // unfiltered url
15 String url = request. getRequestURI ();
16 if ("/NewsSystem/ueditor/jsp/imageUp. jsp". equals (url )){
17 // other/jsp/paths are not frequently used, and I have not written them.
18 // System. out. println ("use custom filter" + url );
19 chain. doFilter (req, res );
20} else {
21 // System. out. println ("use default filter ");
22 super. doFilter (req, res, chain );
23}
24}
25}
After writing the filter, rewrite web. xml to let struts2 pass through our own filter.
Restart tomcat and check whether it is okay.
Then, the ueditor data is obtained on other pages.
Then, the database information is extracted and put into ueditor as the default content: