Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The requested resource () is not available.

 
Abhilash Ravishankar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post struts.xml file too. Use code format
 
Abhilash Ravishankar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to look into sample struts.xml file observe how that is configured. And implement yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic