Joel Sand

Greenhorn
+ Follow
since Feb 25, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joel Sand

David, you just made my day!

worked like a charm!
I can't thank you enough, good day to you!

/Joel
14 years ago
Hi,

I'm trying to make a table containing courses (w. displaytag). Each course should have its own color (red, green etc.) displayed before course name e.g.

[red] math
[blue] english
...

my action is retrieving a rowSetDynaClass (from a DB) with the fields [color, course_name] and distributes it through getMySubjects()

my JSP code looks like this:



My problem is that I want to have a small image icon for the corresponding color in the first column.
I can print the color text perfectly by the line <display:column title="Color" property="color"> but then I couldnt make it an image.

My idea was to access it as an implicit object according to: displaytag example
Since the dynabean is put in the page scope I access it with:
<s:url value="%{#attr.item}"/>
this would output the beans name e.g. org.apache.commons.beanutils.BasicDynaBean@133650d in the column.
sadly adding the prefix:
<s:url value="%{#attr.item.color}"/>
outputs nothing.

So my question is; what am I doing wrong here? is it a simple syntax error or am I using the wrong approach?
All suggestions are appreciated!

/Joel
14 years ago
Hi,

Im using struts2.1.6 with displaytag1.2
Ive been trying for quite a while now to create a table with pagination and persistant checkboxes wrapped in a form.

Code snippet from jsp:


Ok. The idea is simple: the user should be able to check some fields, paginate back and forth with the allready checked boxex staying checked. When he feels satisfied with his selections he clicks submit to save the choices.
The problem which arises is that the form tag action seems to override displaytags requestURI so when I try to paginate the PrintUsers.action is not reached, instead I end up in PostUsers.action which was not the intention.

I've tried using both <s:form> and plain <form>, with the same result. I've tried setting requestURI="", with the result that the pagination links gets unclickable. Ive tried, Ive tried so many things I cant even remember.

I cant think of a good way to do this with less than two controllers, but maybe there is a way. Does anyone have an idea of how this can be solved?
15 years ago
Allright!

I added a more up-to-date slf4j dependency to the project and it did the trick!

15 years ago
Hi,

Im running struts2.1.6 with tomcat6.0, Spring2.5.3, Acegi1.0.7 and displaytag1.2.

After trying to install Spring-security for days I decided to use Acegi-security instead.
I was quite happy with my life when I eventually got Acegi to during startup. Unfortunately,
a few moments later, when I added the displaytag-dependency to my project the startup failed
with the following error:



Has anyone got a clue of how to solve this?
I'm getting a bit desperate, should I stick with Acegi or are there better options?
15 years ago
Ok, I solved it!
The displaytag decorator is looking for a DynaBean named "id" in the RowSetDynaBean table. (I'd guess to have something to sort the rows by)
So after I had added an id to the account table it stopped complaining, case closed!

Piz!
15 years ago
Hi David,

thanks for the quick reply!
(the jsp code should be fixed now)
I've also tried with Struts 2.1.6 but this gives me exactly the same error.

/Joel
15 years ago
Hello,

I have installed struts2.0.11 clean with maven2 and added the displaytag 1.2 dependency in pom.xml (and also the filters in web.xml).
Printing tables work perfectly well until I try to use the decorators which are used for posting form values with checkboxes as in this example at displaytag.sourceforge.net.
The error I receive when I'm running the homepage is the following:


The controller is returning a RowSetDynaClass, accounts to the jsp (PrintUsers.jsp) which looks like this:

I'd be happy to provide you with whatever information you need in order to help me out here.

Thanks in advance!
Joel S
15 years ago