views:

972

answers:

3

Hello everyone,

I am in the process of starting a struts2 project. While I was able to use struts2-blank as a quick out-of-the-box project, I have trouble creating my own struts2 project in Eclipse.

All necessary jars 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 an error

HTTP status 404 description The requested resource () is not available

At the moment I only have a passthrough action with no implementation class which simply redirects to a jsp result page.

If anybody has any ides, I would really appreciate it.

Kind regards D

A: 

Hard to say. The error is not really Struts specific. I think you will have to provide more information about what you are doing. If you used the maven archetypes are you able to get your project to run using mvn jetty:run? Did you import your project into Eclipse as a Maven project? Are you running this inside Eclipse?

It seems like if you are running the site in the IDE, it is having trouble with the location of what is built and then deploying that as a web application. Check the Eclipse web deployment/run tomcat/whatever options.

Dusty Pearce
A: 
<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

A: 

i think the error is pertaining to the src folder.. where hv u placed it. and if u using eclipse u hv to mention at the start tht u will be using webcontent/web=inf/src as source directory. hope this helps

ravi