A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
The requested resource () is not available.
Soumya Babu
Greenhorn
Joined: Jun 29, 2012
Posts: 5
posted
Jun 29, 2012 11:21:01
0
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: 56192
13
I like...
posted
Jun 29, 2012 12:02:18
0
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.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: The requested resource () is not available.
Similar Threads
File not found error
problem in Struts2 while running an application
Request not able to reach Action class in Struts2
requested resource (/tutorial/HellwWorld.action) is not available error
Struts + Tomcat 6 + HelloWorld = Pain
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter