Nigel King

Greenhorn
+ Follow
since Mar 03, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Nigel King

You probably need to add theme="simple" to your form tags. Something like ...

N
13 years ago
Hi,

I have several text fields stored in my session : text_1, text_2, text_3, etc.
I can access them using

It would be useful for me to be able to do something like

but I can't figure out the relevant combination of %, #, and {} to achieve that.
Any ideas?
13 years ago
What's the Struts2 s:set equivalent of

I've tried every permutation of %, {}, and # in the following but still can't get it to work


Nick.
14 years ago
I'm trying to implement a TypeConverter in Struts2.
I have class - Conference - which contains a list of Events and each of these events has a startdate.
The Conference is set in the action.
What I want to do is set up a converter just for this startdate.
If I add

it works okay but that's obviously for all dates.
I think I should be able to add this into a MyAction-conversion.properties file.
How do I specify that I'd like this *only* to be used for my Conference->Event->startDate field.
14 years ago
Thanks, Debraj.
I have several drop-downs like this on my page because they're all indexed fields.
What's happening is that the entire form is being submitted and so, in the execute() method of my action, I can't tell which of the drop downs has been changed.
Do you know if there's a way of passing an additional parameters - in my case the index - to the POST request too?
14 years ago
Using the JQuery plugin I've created two <sj:select> which both use the same action to retrieve their list items. I've also specified onChangeTopics in the parent list and reloadTopics on the child list and I can see the requests being generated.
Obviously I'd like the child items to change depending on what has been selected by the parent. In order to do that I need to pass this parent to the underlying action. How do I go about achieving that?
14 years ago
Thanks, David. You make a good point.
I'll do it that way instead.
16 years ago
Hi,

I'm relatively new to Struts 2 and am trying to create a session bean that will hold a list of manufacturers.
In a JSP using Struts 1 tags I might do something like

to set the bean from an already defined service bean.
Is there an equivalent in Struts 2? Or am I looking at another method of achieving the same?

Thanks in advance.
16 years ago
Hi,

I have a service which returns a list of manufacturers.
In the JSP file I have the following

<s:bean id="manufacturerService" name="service.ManufacturerService"/>
<s:set name="manufacturers" value="manufacturerService.allManufacturers"/>
${manufacturerService}
${manufacturers}

The ${manufacturerService} produces an output but the getAllManufacturers() method is never called and ${manufacturers} is empty.

Ideally I'd like ${manufacturers} to be a session bean so that the service is only called at the start of the session.

Where am I going wrong? And how do I set the collection in the session? I'm relatively new to Struts 2.

Thanks.
16 years ago
At the risk of asking an obvious question, you are removing the comments from these tags too?

17 years ago
I have a javabean defined as a session bean.
Is it good practice to release the resources in that bean once the session is ended? And, if so, how do I go about doing that? Or does the garbage collector take care of it?
The reason I ask is that my bean holds a CachedRowSetImpl and I'd like to close this and be sure the database connection is closing when the session ends.

Thanks in advance.
19 years ago
JSP
Thanks for these replies. Exactly what I was looking for.
As for not noticing the original post was so so old ...
... sorry!
19 years ago
JSP
Martin,
Did you ever get a solution for this? I would like to do the same thing and mod_gzip is not available on my server.

Thanks.
19 years ago
JSP
I have been using a session bean to access my database. I pass the servlet context to the bean and this allows the bean to get the database connection pool attribute from the context.
On my local machine, this servlet context never changes and my site works okay. However, on my uploaded site, the servlet context seems to change. I think this is causing the bean to create a new session.
The results is this. If I run with session scope, my session id changes almost with every request. If I run the bean with request scope, it works fine and my session times out as expected from the web.xml file.
Obviously I would rather not run database queries for every page when once-a-session is enough.
Is there a way that the bean can access the servlet context directly without it being passed?
19 years ago
JSP
I have a problem with my site when running on my web host that doesn't happen when I run with my local Tomcat. I have a HttpSessionListener that just isn't picking up new sessions at all.
Is there a sense in which my SessionListener class might have expired on my web host's shared Tomcat session? No error is being flagged but the SessionListener always registers 0 sessions on the internet, but the correct number when run on local Tomcat.

Thanks in advance.
19 years ago