Running struts2 project in eclipse

I am running struts2 project. While I was able to use struts2-blank as a quick off-the-shelf project, I am unable to create my own struts2 project in Eclipse.

All the jars needed are located in the web-inf / lib directory, but as soon as I add the following lines to my web.xml

<filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

      

I am getting the error

HTTP Status 404 Description The requested resource () is not available

At the moment I only have an end-to-end activity with no implementation class that just redirects to the jsp results page.

If anyone has any claims I would really appreciate it.

Regards D

+1


a source to share


3 answers


Hard to say. The error is not Struts specific. I think you will need to provide more information about what you are doing. If you were using maven archetypes can you run your project with mvn jetty: run? Have you imported the project into Eclipse as a Maven project? Are you running this inside Eclipse?



It looks like if you run the site in the IDE, it has problems locating what was built and then deploying as a web application. Check Eclipse webdeploy / run / any options.

0


a source


<filter>
  <filter-name>filter</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
  <filter-name>filter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

      



pl check it out

0


a source


I think the error is related to the src folder. where you placed it. And if you are using eclipse, at the beginning you should mention that you will be using

webcontent/web=inf/src

      

as the source directory. Hope this helps.

0


a source







All Articles