Error 404 issues using Struts application

前端 未结 1 766
-上瘾入骨i
-上瘾入骨i 2020-12-19 17:14

I am having some issues running a Struts web app since few days. I tried several solutions from StackOverflow relating to my problem but none of them works.

1条回答
  •  暖寄归人
    2020-12-19 17:35

    The error 404 means that resource you have requested is not available, the same referred to the action that is didn't map to the request URL.

    FilterDispatcher is deprecated and may not work with the current Struts version, use StrutsPrepareAndExcecuteFilter instead.

    
      struts2
      
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
      
    
    
      struts2
      /*
    
    

    in the struts.xml add the following

    
       /Login.jsp 
    

    this will forward you to the login page. Also consider to use absolute paths to the JSP resources.

    In the JSP use the form that needs to rewrite to

    
    
        
        
    
        
    
    

    In the action attribute use the action name and provide namespace as you did in the package configuration.

    Using method="execute" is useless in the s:submit tag, the method execute used by default, and it will not work because you have turned off DMI in the Struts configuration.

    Adding libraries over the old libraries in the WEB-INF/lib doesn't help so much and your application probably would not work, until you remove and replace all lower version libraries with higher version and add new libraries needed by the current version of Struts framework.

    0 讨论(0)
提交回复
热议问题