Resource not available in Struts 2

杀马特。学长 韩版系。学妹 提交于 2019-11-29 12:42:18

You should turn on devMode on via setting a constant in the struts.xml. This mode is used if you want to troubleshot some issues like yours. It's more informative because it outputs to the console errors that are hidden in the normal mode.

<constant name="struts.devMode" value="true" />  

After turning it on you may discover that you have wrong or inconsistent library set deployed with your application. You might find a java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils printed to the console, then adjust your library set with missing jars.

The commons-lang3-3.1.jar is required to resolve error.

Sireesh Yarlagadda

Change this content in struts.xml with the following

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
   "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
   "http://struts.apache.org/dtds/struts-2.3.dtd">

Reference Link : click here

If you are using 2.0 or bigger version in struts. Use the below filter.

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

Do the following change in Web.xml

<welcome-file>/WEB-INF/index.jsp</welcome-file>

And in struts.xml

<result name="success">/WEB-INF/HelloWorld.jsp</result>

It May Help You.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!