View Feed
group-icon
Java Developers
Community of Java Developers: Get Java Programming Help from fellow Java Developers across the world.
650 Members
Join this group to post and comment.
Nikumbh
Nikumbh • Jun 24, 2013

Struts in eclipse

Hi Folks,
Whenever i start creating a dynamic web application, I ended up with the following error
type Status report
message /StrutsHelloWorld
description The requested resource (/StrutsHelloWorld) is not available.

Could you please help me where i'm making mistake. Well Thanks in advance

NOTE: I'm using Eclipse INDIGO f
Anoop Kumar
Anoop Kumar • Jun 24, 2013
Paste your directory structure and struts.xml here.
Looks like action path given in struts.xml not correct. if possible upload you project.
Nikumbh
Nikumbh • Jun 24, 2013
@ianoopI don't know how to upload the directory
Nikumbh
Nikumbh • Jun 24, 2013

 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   
   
    <%@ taglib prefix="s" uri="/struts-tags"%>




Insert title here


Hello World From Struts2




<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>




Insert title here


Hello World, 

Nikumbh
Nikumbh • Jun 24, 2013
//HelloWorldAction.java
 
package com.tutorialspoint.struts2;
 
public class HelloWorldAction {
    private String name;
 
      public String execute() throws Exception {
          return "success";
      }
     
      public String getName() {
          return name;
      }
 
      public void setName(String name) {
          this.name = name;
      }
 
}
// web.xml
 


  display-name>Struts 2
  
      index.jsp
  
  
      struts2
      
        org.apache.struts2.dispatcher.FilterDispatcher
      
  
 
  
      struts2
      /*
  
//struts.xml
 
 




  
   
      
            /HelloWorld.jsp
      
  
Nikumbh
Nikumbh • Jun 24, 2013
ianoop Am I able to clear you?
Anoop Kumar
Anoop Kumar • Jun 24, 2013
structure seems fine but problem with struts that what is working in Struts 2.X.2 may not work in struts 2.x.11. I have faced similar issue.
Can you try this tutorial they have mentioned particular struts library also?
https://www.mkyong.com/struts2/struts-2-hello-world-example/
If not I have working project, I will upload from home.
Nikumbh
Nikumbh • Jun 24, 2013
Could you please upload the code you're having at home, if it doesn't follow the maven plugin. Well ianoop Thanks mate...😀
Anoop Kumar
Anoop Kumar • Jun 24, 2013
Find attachment and add following to your lib path from struts 2.3 libraries
  struts2-core.jar
      freemarker.jar
      xwork-core.jar
      ognl.jar
      commons-fileupload.jar
      commons-lang.jar
      commons-io.jar
This should work. I have tested it.
Anand Tamariya
Anand Tamariya • Jun 24, 2013
Where have you done the mapping for StrutsHelloWorld ?
Nikumbh
Nikumbh • Jun 25, 2013
ianoop
Find attachment and add following to your lib path from struts 2.3 libraries
  struts2-core.jar
      freemarker.jar
      xwork-core.jar
      ognl.jar
      commons-fileupload.jar
      commons-lang.jar
      commons-io.jar
This should work. I have tested it.
Thank You very much mate. 😀
Nikumbh
Nikumbh • Jun 25, 2013
Anand Tamariya
Where have you done the mapping for StrutsHelloWorld ?
Anand Tamariya : Thank you very much for your reponse.... But i've found the solution by the ianoop 's reponse. Anyways thank you very much buddy.
Nikumbh
Nikumbh • Jun 25, 2013
ianoop
Find attachment and add following to your lib path from struts 2.3 libraries
  struts2-core.jar
      freemarker.jar
      xwork-core.jar
      ognl.jar
      commons-fileupload.jar
      commons-lang.jar
      commons-io.jar
This should work. I have tested it.
ianoop FYI:
Previously i didn't have the
freemarker.jar, xwork-core.jar in my libraries list. But it works
perfect now... Thanks again dude...
👍

Share this content on your social channels -