Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
forum!
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
paul wheaton
Paul Clapham
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Saloon Keepers:
Tim Holloway
Carey Brown
Roland Mueller
Piet Souris
Bartenders:
Forum:
Struts
The Struts dispatcher cannot be found Error
vineet walia
Ranch Hand
Posts: 140
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
this is index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title> Name Collection </title> </head> <body> <h4> Enter Name </h4> <s:form action="helloword"> <s:textfield name="name" label="your name "/> </s:form> </body> </html>
this is helloword.java file
package manning.chaptertwo; public class helloword { private static final String greeting="hello"; public String execute() { setCustomgreeting(greeting + getName()); return "Success"; } private String name; private String customgreeting; public String getName() { return name; } public void setName(String name) { this.name=name; } public String getCustomgreeting() { return customgreeting; } public void setCustomgreeting( String customgreeting) { this.customgreeting=customgreeting; } }
helloword.jsp file
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title> Name Collection </title> </head> <body> <h4> Enter Name </h4> <s:form action="helloword"> <s:textfield name="name" label="your name "/> </s:form> </body> </html>
web config file
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <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>*.action</url-pattern> </filter-mapping></web-app>
struts
confid file
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="chaptertwo" namespace="/chaptertwo" extends="struts-default"> <action name="helloword" class="manning.chaptertwo.helloword"> <result name="SUCCESS">helloword.jsp </result> </action> </package> </struts>
thanks
vineet walia
Ranch Hand
Posts: 140
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
please someone help me today is my first day on struts and i am not able to wrote single application. it will take your 5 min only
please sort out my problem
vineet walia
Ranch Hand
Posts: 140
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
?
Prakash Mani - Attur
Ranch Hand
Posts: 100
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
check the below forum.. it may help you..
forum
vineet walia
Ranch Hand
Posts: 140
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
no this is not working for me
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please include the actual error text, otherwise we're just guessing.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
WARNING: Could not find action or result
Request not able to reach Action class in Struts2
STRUTS 2 ERROR
Struts 2.0.9 - Problem in following a hyper link
The requested resource () is not available.
More...