File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Name for Action servlet at web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Name for Action servlet at web.xml" Watch "Name for Action servlet at web.xml" New topic
Author

Name for Action servlet at web.xml

siva prakash
Ranch Hand

Joined: Aug 24, 2004
Posts: 80
Hi,

I am new to struts, I have following doubt.

Can we change name mentioned to Action servlet at web.xml, because, in most books I found it as "Action".




Thanks,
Prakash.
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Siva,
Im not quite sure of what your question is. In the web.xml, you cant change the name of the Action class(org.apache.action...Action). This is the class the framework will be using to render certain functionalities which you dont have to write yourself. All the changes to the class name/mappings will be done in the struts-config.xml.
Hope it helps.
Regards,
Roshani


Regards,<br />Roshani
siva prakash
Ranch Hand

Joined: Aug 24, 2004
Posts: 80
Hi Gopal,


i mean, can i change the name of specified at <servlet-name> tag for Action servlet other than "Action" in web.xml




Thanks,
Prakash
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The name used in the servlet definition in the web.xml file is completely up to you and doesn't matter. The only thing that matters is that the name you refer to in the <servlet-mapping> stanza is the same as the one you used to define the struts Action Servlet in the <servlet> stanza.


Merrill
Consultant, Sima Solutions
siva prakash
Ranch Hand

Joined: Aug 24, 2004
Posts: 80
thanks Higginson
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Siva,
Just an addtion to what Merrill said, this link would give you info on how to do it.
http://www.allapplabs.com/struts/configuring_struts.htm
Regards,
Roshani
siva prakash
Ranch Hand

Joined: Aug 24, 2004
Posts: 80
thanks Roshani
 
jQuery in Action, 2nd edition
 
subject: Name for Action servlet at web.xml