Problem of Struts2 on IDEA

When I create a project and add web module,and I deployed it on Tomcat6,everything is ok.Then I add struts2 libraries to the project and modify web.xml as follows:
=====================
struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* ]]>
=====================
Then tomcat could not start,the log as follows:
=====================
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
=====================
but in the "Modules and Libraries to package",I choose "copy files to".
I think that IDEA could not copy the nessary libraries to the proper place before tomcat startup and the filter begin to work.
Who can help me?

null

3 comments

Hello zhangjp,

Please, make sure that in "Modules and Libraries to package" table the "Path
relative to Deployment root" value against struts libraries is "/WEB-INF/lib".

When I create a project and add web module,and I deployed it on
Tomcat6,everything is ok.Then I add struts2 libraries to the project
and modify web.xml as follows:
=====================
<filter>
<filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-c
lass>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
=====================
Then tomcat could not start,the log as follows:
=====================
java.lang.ClassNotFoundException:
org.apache.struts2.dispatcher.FilterDispatcher
=====================
but in the "Modules and Libraries to package",I choose "copy files
to".
Who can help me?

Alexander.


0

Thank you Alexander!you helped me again!
While I create a web project,then I add the Struts2 libs,It's default value is /WEB-INF/lib.
But While I create a blank project and then add web support,and I add the Struts2 libs,It's default value is /WEB-INF/classes.

Thank you very much!
and may I have you email?

0

Hello zhangjp,

My email is Alexander.Chernikov@jetbrains.com (not surprisingly).

Thank you Alexander!you helped me again!

While I create a web project,then I add the Struts2 libs,It's default
value is /WEB-INF/lib.

But While I create a blank project and then add web support,and I add
the Struts2 libs,It's default value is /WEB-INF/classes.

Thank you very much!
and may I have you email?

Alexander.


0

Please sign in to leave a comment.