Comment on Tutorial - Creating the first application using Struts 2 By Gokul Verma



Comment Added by : Trishul

Comment Added at : 2009-10-26 07:32:57

Comment on Tutorial : Creating the first application using Struts 2 By Gokul Verma
I got the sample and the test working. Thanks a lot. Here's web.xml for the sample:

<?xml version="1.0" encoding="UTF-8"?>

&lt;web-app id=&quot;WebApp_9&quot; version=&quot;2.4&quot; xmlns=&quot;<a href="http://java.sun.com/xml/ns/j2ee&quot;">http://java.sun.com/xml/ns/j2ee&quot;</a> xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance&quot;">http://www.w3.org/2001/XMLSchema-instance&quot;</a> xsi:schemaLocation=&quot;<a href="http://java.sun.com/xml/ns/j2ee">http://java.sun.com/xml/ns/j2ee</a> <a href="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;">http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot;</a>&gt;

&#160;&#160;&#160; &lt;display-name&gt;Struts Blank&lt;/display-name&gt;

&#160;&#160;&#160; &lt;filter&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-name&gt;struts2&lt;/filter-name&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;

&#160;&#160;&#160; &lt;/filter&gt;

&#160;&#160;&#160; &lt;filter-mapping&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-name&gt;struts2&lt;/filter-name&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;url-pattern&gt;/*&lt;/url-pattern&gt;

&#160;&#160;&#160; &lt;/filter-mapping&gt;

&lt;/web-app&gt;

Also,
struts.xml --&gt;

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;!DOCTYPE struts PUBLIC

&#160;&#160;&#160; &quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//EN&quot;

&#160;&#160;&#160; &quot;<a href="http://struts.apache.org/dtds/struts-2.0.dtd&quot;">http://struts.apache.org/dtds/struts-2.0.dtd&quot;</a>&gt;

&lt;struts&gt;

&#160;&#160;&#160; &lt;constant name=&quot;struts.enable.DynamicMethodInvocation&quot; value=&quot;false&quot; /&gt;
&#160;&#160;&#160; &lt;constant name=&quot;struts.devMode&quot; value=&quot;false&quot; /&gt;

&#160;&#160;&#160; &lt;!--
&#160;&#160;&#160; &lt;include file=&quot;example.xml&quot;/&gt;

&#160;&#160;&#160; &lt;package name=&quot;default&quot; namespace=&quot;/&quot; extends=&quot;struts-default&quot;&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;default-action-ref name=&quot;index&quot; /&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;action name=&quot;index&quot;&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;result type=&quot;redirectAction&quot;&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name=&quot;actionName&quot;&gt;HelloWorld&lt;/param&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name=&quot;namespace&quot;&gt;/example&lt;/param&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/result&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/action&gt;

&#160;&#160;&#160; &lt;/package&gt;

--&gt;

&#160;&#160;&#160; &lt;!-- Add packages here --&gt;

&#160;&#160;&#160; &lt;package name=&quot;default&quot; namespace=&quot;/&quot; extends=&quot;struts-default&quot;&gt;

&#160;&#160;&#160;&#160;&#160; &lt;action name=&quot;HelloWorld&quot; class=&quot;com.thinkbeyond.action.HelloWorld&quot;&gt;

&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;result&gt;/HelloWorld.jsp&lt;/result&gt;

&#160;&#160;&#160;&#160;&#160; &lt;/action&gt;

&#160;&#160;&#160; &lt;/package&gt;

&lt;/struts&gt;


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. I think 19 floor's code doesn't fix the problem.Al
View Tutorial          By: Benson at 2012-11-28 08:04:26

2. I need more example........
View Tutorial          By: niyaz d at 2011-02-20 23:44:56

3. I have writtent this code in my jdbc program,

View Tutorial          By: yeshdeep kumar at 2014-11-12 07:46:46

4. Hy plz help me for also draw to flowchart.........
View Tutorial          By: khadija at 2010-11-13 11:38:31

5. it's very good example to understands overloading
View Tutorial          By: Rakesh Sharma at 2011-11-18 06:37:49

6. Would be great if you also showed how to manipulat
View Tutorial          By: Sparx at 2010-01-05 13:51:56

7. thanks bro it worked for me ....keep it up.
View Tutorial          By: azhar at 2010-12-27 00:44:36

8. Answer for Comment 4 :

" n=n++

View Tutorial          By: NewB_of_java at 2012-02-16 16:52:05

9. nice to learn abt it
View Tutorial          By: aice at 2012-08-25 12:49:35

10. what is the output
View Tutorial          By: Raja at 2012-12-28 11:47:48