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. dis prgrm is not giving me any ouput..i need to re
View Tutorial          By: singh at 2015-02-19 12:16:31

2. Wow, Problem resolved ....
View Tutorial          By: Muhammad Farrukh at 2011-08-29 21:02:09

3. Nevermind, I was able to modify both applications
View Tutorial          By: Matthew at 2009-06-16 14:10:20

4. the code works fine. you just need to create a mai
View Tutorial          By: Nabil at 2011-08-09 11:11:03

5. i got error for below line

xlApp

View Tutorial          By: Satheyaraaj at 2015-04-28 07:47:42

6. Shouldn't you call free() on the allocated memory
View Tutorial          By: Ritchie at 2012-05-09 14:14:49

7. This is just Great, didn't find anything like this
View Tutorial          By: Vikrant Verma at 2012-10-07 04:54:42

8. hello
i am developing a budget application

View Tutorial          By: anu at 2010-04-16 04:26:36

9. we need to know how to write this coding..

View Tutorial          By: lalala at 2009-07-15 20:35:16

10. Hi sir !

I have two Crystal Report

View Tutorial          By: Anderson Abad at 2011-07-20 03:34:51