File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes The requested resource () is not available. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

The requested resource () is not available.

Soumya Babu
Greenhorn

Joined: Jun 29, 2012
Posts: 5
helloworld.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h2><s:property value="message" /></h2>
</body>
</html>

helloworld.java

package org.poc;
import com.opensymphony.xwork2.ActionSupport;

public class HelloWorld extends ActionSupport {

private static final long serialVersionUID = 6393504953362012108L;
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;
}
}

web.xml
<?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">
<display-name>Print Everywhere</display-name>

<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>

<filter>
<filter-name>struts2</filter-name>
<filter-class>
com.printeverywhere.util.StrutsFilterDispacher
</filter-class>
</filter>

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


struts.xml


<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="org.poc" extends="struts-default">
<action name="HelloWorld" class="org.poc.HelloWorld">
<result>/HelloWorld.jsp</result>
</action>
<!-- Add your actions here -->
</package>
</struts>





When i click submit i am getting The requested resource () is not available.whT MIGHT BE the possible reasons?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

This is covered by the very first entry in the ServletsFaq. Please checks the FAQs before posting to see of the question has already been answered. Thanks.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The requested resource () is not available.