This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 with Display tag issue

 
Amruth Puppala
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Niiraj Patel
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rename above file to VPM_F.zip and extract it.
[Thumbnail for VPM_F.jpg]
 
Amruth Puppala
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niraj,

Thanks so much.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic