troy parrish

Greenhorn
+ Follow
since Jul 26, 2010
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 troy parrish

We discovered the issue: Struts 2.3.15.1 and later has limited the parameter name length in the Parameter Interceptor, which we use. The default limit is 100 characters, some of our parameter names exceeded that value and consequently were being ignored by the interceptor and not being mapped to the value stack. Solution: In Struts.xml



This resolved our problem. The value can be set to your needs, but exceedingly high values defeats the security aspect of this setting.
10 years ago
We updated to Struts 2.3.15.1 for security purposes. When we did we noticed that we lost some ability to set values using the dot notation method in the jsp. If we have a map that takes the Foo class and Foo has a Bar class, we had been previously successful in setting the Bar class for Foo using a hidden field. When we updated, the Bar class is now coming across as null whereas before the Bar class - in the sample below - would have been created for Foo and given an id value of 12.

Is there a syntax that we need to be using in our jsp to get the previous results with the new version of struts?





10 years ago
I have been banging my head on the table for a while over this problem (I am very new to linux). I am trying to invoke a simple python script from a servlet running in Tomcat6 on Ubuntu 10.04. I have been able to get it to run in a simple java program as follows:

try{
String[] cmd ={"python", "/home/troy/NetBeansProjects/GSMFilter/web/WEB-INF/storage/helloWorld.py", "-c"};
ProcessBuilder pb = new ProcessBuilder(cmd);
Process p = pb.start();
}
catch(Throwable t){
t.printStackTrace();;
}

My servlet takes information entered in a jsp form and writes it to two text files and then is suppose to call a python script. As as I said above, the call to the python script works fine in a simple java file on Ubuntu, however, when I try the same thing in a servlet, everything in the servlet executes (writes to files and forwards it to the proper confirmation jsp) with the exception of the python script. The frustrating thing is that when I run the same program on windows (with the proper arguments for windows) the script executes from the servlet. I have given all the permissions I can find in Tomcat policies files and have made sure the permissions on the python are executable by all users. I have used proc.waitFor() and get an exit value of 0. I have read the article at javaworld When Runtime.exec() won't about a dozen time and compiled the classes suggested without much luck (read "no change"). There is no error to report, I catch that in my servlet and ship the user over to an error page, but I get the confirmation page saying all has worked as it should. Obviously, I would appreciate any help anyone could offer.

By the way, I have used your site many times and really appreciate what you offer.
13 years ago