aspose 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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The requested resource () is not available." Watch "The requested resource () is not available." New topic
Author

The requested resource () is not available.

Abhilash Ravishankar
Greenhorn

Joined: Nov 16, 2011
Posts: 9
index.jsp page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello World</title>
</head>
<body>
<s:form action="welcome-user" >
<s:textfield name="userName" label="User Name" />
<s:submit />
</s:form>
</body>
</html>

Welcom-user.jsp page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome User</title>
</head>
<body>

<h1>${message}</h1>

</body>
</html>

Web XML page
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

<display-name>Struts2Example1</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter. StrutsPrepareAndExecuteFilter
</filter-class>
</filter>

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

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

</web-app>

WelcomUser.java file


package com.vaannila.action;

import com.opensymphony.xwork2.ActionSupport;

public class WelcomeUser extends ActionSupport{
private String userName;
private String message;

public String execute() {
message = "Welcome " + userName;
return SUCCESS;
}

public void setUserName(String userName) {
this.userName = userName;
}

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

public String getUserName() {
return userName;
}

public String getMessage() {
return message;
}
}


Its simple struts 2 application I don't know why I cannot able to execute this project.I'm using tom-cat 6 and Eclipse Galelio.I'm getting the error The requested resource () is not available.

PLEASE Help me with this...................
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Post struts.xml file too. Use code format


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Abhilash Ravishankar
Greenhorn

Joined: Nov 16, 2011
Posts: 9

Hi Mohan,

Thanks for replying.I'm going through the example in VaanNila web site.I just started learning the struts 2. They have even provided the code too in the website "http://www.vaannila.com/struts-2/struts-2-example/struts-2-annotation-example-1.html". In that example they have not provided any struts file to execute this project.I'm feeling in such a way that I have not configured Tom cat properly.I am not getting it.Please help me where I'm going wrong. If you don't mind can I send the project to your Email ID which I found in this forum...Please
Abhilash Ravishankar
Greenhorn

Joined: Nov 16, 2011
Posts: 9
Mohana Rao wrote:Post struts.xml file too. Use code format


Hi Mohan,

Thanks for replying.I'm going through the example in VaanNila web site.I just started learning the struts 2. They have even provided the code too in the website "http://www.vaannila.com/struts-2/struts-2-example/struts-2-annotation-example-1.html". In that example they have not provided any struts file to execute this project.I'm feeling in such a way that I have not configured Tom cat properly.I am not getting it.Please help me where I'm going wrong. If you don't mind can I send the project to your Email ID which I found in this forum...Please
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Try to look into sample struts.xml file observe how that is configured. And implement yourself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The requested resource () is not available.