• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

The requested resource () is not available.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...................
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post struts.xml file too. Use code format
 
Abhilash Ravishankar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to look into sample struts.xml file observe how that is configured. And implement yourself.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic