Frank Bueckert

Greenhorn
+ Follow
since Mar 23, 2006
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 Frank Bueckert

If I'm understanding you correctly, you have multiple checkboxes named the same. Problem with that is that Struts will probably (correct me if I'm wrong; I'm no expert) take the last one, and set the ActionForm value to that. You need to give them different names in the JSP.

The actionForm also requires a variable for each checkbox; ie: you have three checkboxes, named checkbox1, checkbox2, and checkbox3. The actionForm then requires boolean checkbox1, boolean checkbox2, and boolean checkbox3.

Don't forget to set these to false in your reset method, since HTML has a quirky way of sending checkbox values. If it's not checked, nothing is sent for that checkbox. If it IS checked, you get data. So, the default way of handling them is to assume they're false.
17 years ago
Not exactly sure how to go about this. I'm using the JFreeChart jar file to generate a dynamic image based on the data I'm using. That's all fine and dandy.
My problem is accessing a variable I'm defining in the action, and using it in a scriptlet to write an imagemap straight into the JSP.

This defines the variable for the JSP. That part works fine. However, when I try to use it in a scriptlet, it turns up as null.


I've tried using "info", "(org.jfree.chart.ChartRenderingInfo) info", and any other variations I can come up with. I know I'm doing something wrong, but I have no idea what.
17 years ago
Perfect! Worked like a charm!

Thanks for your help.
17 years ago
I'm having a slight problem with one of my filters. Basically, it holds a servletcontext variable, where it stores some values on startup. This is done to speed up the program, so that it's not constantly reading the same values in per person, or per request.

So, that means the values are static until Tomcat's restarted. My question is, is there any way to access that servletcontext variable? I'm trying to add in a way to force a re-load of values, so that we don't need to restart Tomcat all the time.

Thanks for the help!
17 years ago
form beans can be either request or session scope.

In your controller class, do your calculations, and then put
for request objects
or
for session objects.

Then, in your JSP, you put


Just make sure you have scope set to the instance you want, and you'll have access to it. Just point all struts name parameters at the bean:define id parm, and you can yank whatever you want out of it.

There's probably an easier way to do this, but that's how I do it.
[ March 24, 2006: Message edited by: Frank Bueckert ]
17 years ago
Ok. So according to your code and your explanation, CalificacionForm is structured as follows:


Am I right with that? Seems kinda off from what you've been describing. Can you post the java file that is handling the submit, please? I suspect it's attempting to access an empty ArrayList.
17 years ago
Can you post your form-bean class and maybe your .jsp, please? It might be you're attempting to pass too much, or not enough. Or maybe nothing.
17 years ago
I've been bashing my head against this for most of the day. I think I've narrowed the problem down to a single line, but I have absolutely no idea on how to fix it. Documentation has a little bit of help, but not what I'm looking for.

Problem: Implementing security roles yanked out of a database. Specific to users. If I set permissions="rolesAdapter" in the useMenuDisplayer tag, nobody gets anything. I set permissions=<custom permission adapter> and everyone gets everything. Obviously, something wrong is happening.
Checking my roles, they get added to the user class properly.

Code:


This is basically yanked straight out of the permissions example. My problem is that menus turns up as null, no matter what I attempt to do. Why?

So, that is my problem. What am I doing wrong?
17 years ago