wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts2 with Display tag issue 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 "Struts2 with Display tag issue" Watch "Struts2 with Display tag issue" New topic
Author

Struts2 with Display tag issue

Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
I am new to the Sturts2 and Displaytag.

I have configured it to use the displaytag.

What I did is :

I have added the follwoing displaytag jars in WEB-INF/lib and added them to buildpath
displaytag-1.2.jar
displaytag-export-poi-1.2.jar
displaytag-portlet-1.2.jar

In action class added a method ArrayList<ForbesData> getForbesList() which return the ArrayList<ForbesData> data.

ForbesData class is


I have onmore java class


In struts.xml I have configured action class LoginAction .

In jsp I added


When I try to see the my table after running the program I am getting exception.
I am not able to find any help from net as all examples are shown as per sturts1.x




Can some one please help what Am I missing here.

SCJP 5 |SCWCD 5| Started thinking about Web Services ?
Niiraj Patel
Ranch Hand

Joined: Sep 17, 2011
Posts: 47
Amruth,

The issue is with struts action class: LoginAction.

Fact about Struts 2.0 : Your class must inherite Struts library class: com.opensymphony.xwork2.ActionSupport to become a legal Struts Action class.

Your LoginAction's pseudo code should be like :



I have attached eclipse project which uses struts 2, display tag lib 1.2 and apache 6.0.
Import it in eclipse and run.

I have used below jar files.


To test it type like: http://localhost:8080/VPM_F/UserLogin.action
It will hit your action and popup the table.

--Niraj



[VPM_F.jpg]

Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
Thanks Niraj for the reply.

Now I have extended my class



my sturts.xml is


still I get the exception


Please help where Am I missing things
Niiraj Patel
Ranch Hand

Joined: Sep 17, 2011
Posts: 47
Amruth,

Its hard to say from log what you are missing. Can you tell me which jars are you using?
The quick fix is, Run my project in your eclipse and try to merge your part in that.

Thanks
Niraj patel
Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
Niraj,

Thanks so much.


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts2 with Display tag issue