File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes regarding display tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "regarding display tag" Watch "regarding display tag" New topic
Author

regarding display tag

Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
1.i want to show two propeties into one column using display tag.
for. ex. I am having firstname and lastname .these two independent properties that i want to show under column name "NAME".

2.I want to show the size of Set in one column ..how can i do this using display tag?
please provide me reply.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

This isn't something that DisplayTag needs to solve. You should provide that information in your java code. For example, if you have an object that looks something like this:



All you have to do is provide a method to get the full name:



Same goes for the size of a set. Just provide a getter that returns mySet.size().


GenRocket - A Test Data Generation Platform
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Thanks Gregg for your reply.
I have done all these things already(getters and setters for fields) whatever you are saying.
I have a list object from which i want information in different columns.
In one column i want Name containing firstname and lastname attributes.
Tell me syntax for that how can i do that using display tag?
Same i have getters and setters for set also.But how can i calulate its size in column.I want syntax of display tag for that.
thanks.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

I don't understand why you think you need the display tag syntax. It is the same syntax you use for any other properties.



Where you have getName() that returns the full name and getSomeSize() that returns the size.
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Actually I want to show pagination,sorting in my application so i am going for display tag.

Secondly ,i dont have name property.I have two firstname and lastname properties and i want to show both under title Name.So i want a syntax for that.

Secondly i have set property "Replies" and i want to show size of "Replies" set.
So how can i show that?
Thanks Gregg .

Again i have added display tag jar in lib.
Do i need to add something in my web.xml file ?Because when i try to add <cut>
its showing me error as unknown tag.
Please guide me.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

You need to read my first reply to you. That is your answer. I don't know what else to tell you to help you understand. I wasn't asking why you are using Display Tag. I was asking why you still aren't understanding what you need to do, since I already told you with code examples. Just read what I wrote again, add the code for getName() which returns your first and last name concatenated. Add a getter method that returns your replies.size().

Add those properties as columns to your display tag. Again, I showed you all the code you need.
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
I am really sorry.I thought you are telling me to write getters and setters to firstname and lastname ..so i didnt read your first reply completely.Now my problems got solved.Thanks again for your help.
Can you reply for my second problem .

Again i have added display tag jar in lib.
Do i need to add something in my web.xml file ?Because when i try to add <cut>
its showing me error as unknown tag.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

c:out is part of the JSTL. You need to download that and include its jars in your classpath.

http://faq.javaranch.com/java/JstlTagLibDefinitions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: regarding display tag
 
Similar Threads
Label of the submit button does not working when i use DispatchAction
Multi dimentional checkboxes
Javascript in Struts
why Display tag sorts the row number?
Struts 2 - Display tag Serial Number Problem