Meaningless Drivel is fun!
The moose likes Struts and the fly likes Struts2 doubt regarding method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 doubt regarding method" Watch "Struts2 doubt regarding method" New topic

Struts2 doubt regarding method

Dilip Mallik
Ranch Hand

Joined: Sep 19, 2008
Posts: 40
Hi All

I am learning struts2.

I want to know that when I am submitting the form we are mentioning action

but not method (like we used to mention in servlet doGet or doPost)

so my doubt is what is the default method to take data from form ?

and one more doubt.

which version of struts2 needs to be followed while learning.

currently I am learning in 2.0.6 but in the struts site I found the latest version is 2.0.14....

I am confused...

Please help

Liju Samuel
Ranch Hand

Joined: Dec 09, 2008
Posts: 50
in struts the default method is post...for security reason...its not necessary to specify the will take the default method post

Liju Samuel
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15087

lijusamuel, please check your private messages again. You can see them by clicking My Private Messages.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
David Newton

Joined: Sep 29, 2008
Posts: 12617

In general you should use the latest released version, which as you said is 2.0.14. There are enough changes between 2.0.6 and 2.0.14 to cause problems.

I suspect we're quite close to a 2.1.3 release as well.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689


Default method called is "get" method.

And it is better to read latest Struts version.

So, you get update of Struts and again you not need to learn when user Struts 2.0.

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Dilip Mallik
Ranch Hand

Joined: Sep 19, 2008
Posts: 40
Thanks everybody

But I still didn't get my answer that what is the default method...

As Nishan said the default method is get

and lijusamuel said the default method is post..

If the default method is get then why don't we see the data in url while submitting the form?

and about following struts version....

what exactly is changed in the 2.0.6 to 2.0.14 so that I have to learn only those thing and not the whole of struts 2.0.14..

how to find that?

Kindly Reply
David Newton

Joined: Sep 29, 2008
Posts: 12617

Look on the S2 wiki for the changelists.

The S2 form tag sets method="post".
[ December 10, 2008: Message edited by: David Newton ]
I agree. Here's the link:
subject: Struts2 doubt regarding method
It's not a secret anymore!