1. Home >
  2. Apps >
  3. Groups >

Struts in eclipse

Question asked by Nikumbh in #Java on Jun 24, 2013
Nikumbh
Nikumbh · Jun 24, 2013
Rank D1 - MASTER
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 Posted in: #Java
Anoop Kumar
Anoop Kumar · Jun 24, 2013
Rank A2 - PRO
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
Rank D1 - MASTER
@ianoopI don't know how to upload the directory
Nikumbh
Nikumbh · Jun 24, 2013
Rank D1 - MASTER

 
<%@ 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
Rank D1 - MASTER
//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
Rank D1 - MASTER
ianoop Am I able to clear you?
Anoop Kumar
Anoop Kumar · Jun 24, 2013
Rank A2 - PRO
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
Rank D1 - MASTER
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
Rank A2 - PRO
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
Rank B2 - LEADER
Where have you done the mapping for StrutsHelloWorld ?
Nikumbh
Nikumbh · Jun 25, 2013
Rank D1 - MASTER
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
Rank D1 - MASTER
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
Rank D1 - MASTER
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...
👍

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up