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. Hi, Can anyone please tell me where we need to cha
View Tutorial          By: Gunjan at 2014-01-02 12:08:41

2. Good article
View Tutorial          By: Manu Francis Mathew at 2009-12-18 00:50:45

3. Handling several submissions can be a lot simple t
View Tutorial          By: Blaze Blankenship at 2012-12-05 13:04:12

4. Si AIZA DIN< DI MARUNONG MAGTURO
View Tutorial          By: Agnes at 2010-06-25 22:34:29

5. Very nice
View Tutorial          By: sharath at 2012-07-17 11:31:20

6. What about GraphicsDemo (class...?) mentioned in l
View Tutorial          By: Achi at 2008-01-08 04:21:57

7. hi,
Very nice tutorial. But please I have s

View Tutorial          By: hemn at 2010-04-17 06:02:00

8. thanks for our help. god bless u and again thanks.
View Tutorial          By: mehryab at 2011-05-08 14:44:21

9. very good exmpl and explantion
View Tutorial          By: harshita negi at 2013-10-16 02:19:35

10. very nice tutorial.. keep it up. cheers

View Tutorial          By: chanchal at 2013-01-24 06:54:23