Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts2 with Display tag issue

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

Thanks so much.


 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic