This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 doubt regarding method" Watch "Struts2 doubt regarding method" New topic
Author

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

Thanks
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 action...it will take the default method post


Liju Samuel
SCJP1.5
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

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 7 API documentation
Scala Notes - My blog about Scala
David Newton
Author
Rancher

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: 684

Hi,

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
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Look on the S2 wiki for the changelists.

http://struts.apache.org/2.x/docs/migration-guide.html

The S2 form tag sets method="post".
[ December 10, 2008: Message edited by: David Newton ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 doubt regarding method
 
Similar Threads
Struts2
Multiple checkboxes and Struts2
migration to Struts2
Struts2 CannotRenderException
struts2