hi,

I hope you are using a servlet container that support 2.4 spec., change your web.xml .xsd to 2.4 one like below.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

hope this would help you.

Thanks,

Nuwan.


----- Original Message ----- From: "struts2" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Sunday, March 25, 2007 4:01 AM
Subject: Problem with struts 2



Hi everyone,

            I have just started working with struts 2. Quit improved and
much like Spring(except DI and AOP), this is first time i am working with
struts and in HelloWorld programmer i am facing error when my action class
is called and the error is : The requested resource
(/hello_world/example/HelloWorld.action) is not available.

I am putting up my files below, any idea would be appreciated.

web.xml


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>

   <display-name>Struts example by Sachin</display-name>

   <filter>
       <filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
   </filter>

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

   <welcome-file-list>
       <welcome-file>index.html</welcome-file>
   </welcome-file-list>

</web-app>




struts.xml


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
   "http://struts.apache.org/dtds/struts-2.0.dtd";>
<struts>
   <package name="example" namespace="/example" extends="struts-default">
       <action name="HelloWorld" class="example.HelloWorld">
           <result>/jsp/HelloWorld.jsp</result>
       </action>
   </package>
</struts>



HelloWorld.java


package example;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {

   public static final String MESSAGE = "Struts is up and running ...";

   public String execute() throws Exception {
       setMessage(MESSAGE);
       return SUCCESS;
   }

   private String message;

   public void setMessage(String message){
       this.message = message;
   }

   public String getMessage() {
       return message;
   }
}


--
View this message in context: http://www.nabble.com/Problem-with-struts-2-tf3461208.html#a9657134
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to