Help coderanch get a
new server
by contributing to the fundraiser

Dom Lassy

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

Recent posts by Dom Lassy

I have a web application that occassionally hangs. It is not a server side error. Is there an application that I can run to see what the browser is asking for from the server and what the responses are? Including the requests for images. Any help would be appreciated.

More Information:
The layout for the site contains an iframe where all of the content loads (everything outside of the iframe is static). When the user submits a form in the iframe we display a waiting image and show an opaque div over the entire document. On the 'onlo ad' function for the page returned after the form submittal we call a function to hide the waiting image and opaque div. The problem is that occassionally that function is not called. When it happens, in the status bar the browser says 'Waiting for http://....'.

I think it might be a problem with tomcat but I need to get all requests and responses to nail down the exact problem.

Originally posted by saranga rao:
WHile using the IFrame and call the struts action make sure "/" should not be use..
<iframe style="width:380px; height:150px; border: groove;" frameborder="1" id="eventinfo" src="" >


You should use url rewriting for the src attribute:
16 years ago
Use the javascript date object. Here is an example if myForm contains a getTimestamp that returns a timestamp in milliseconds.

It will display the time based on the user's time zone.

16 years ago
I was wondering if anyone knew of a GUI that you can use to create/edit a torque-schema.xml file. It would definitely be helpful to speed up the generation/modification of the schema. Thanks in advance.
I don't really understand your question, but on the action that you don't want validation firing on, put this in your action mapping:
16 years ago
I'm getting the following warnings:

I started noticing this after we migrated from Struts 1.2.? to 1.3.8.

I'd like to get rid of these WARNS and any help would be appreciated.
16 years ago
It is all transparent. All you have to do is create different message bundles for each locale. It will pull the text from the correct bundle based on the client's browser's locale.
16 years ago

Originally posted by Rao Sunkara:
duplicate of giving the form name in the struts-config filr i.e. that particular actionForm was already used in other action

This is not true.

Anyway, you're declaring the form incorrectly.

[ October 26, 2007: Message edited by: Dom Lassy ]
16 years ago
Action chaining will work, but you may have to be careful regarding how to access any shared form variables between the actions in your jsp.

Another method is the post/redirect/get method. Using that, after your C action completes, it should forward to a jsp that does a meta-refresh (or logic:redirect) to your B action, or on load call your B action using javascript.

The post redirect method will also help prevent multiple form submissions if the user hits reload on the department list after editing a department.
Especially if you aren't using tokens.

There are pros and cons to each of the methods above, but they will both work and are both common design patterns.
16 years ago
You should do all of that logic in your action class. It is a lot easier to do there and it is a lot easier to maintain.
16 years ago
So you have an action where there is an error. In that action you are getting the ActionForward to your logoff action. When you get that ActionForward, append "?errorCode=" + errNum to the forward that you return. In your logoff action, read the errorCode request parameter (or use a form to get the errorCode), and pull the message associated with that errorCode, add it to the actionerror object and it will be displayed on your logoff page.

It seems a bit "hackey" but it is the best solution I can come up with to fit your needs.
16 years ago
I can't think of a way to exit a logic:iterate. I assume that you want to exit the loop for performance issues. In theory, you should be doing this logic in your action class. You should just set a form variable that tells you which background to use in your action class and leave that logic out of your jsp.
16 years ago
I would like to come up with some regular expressions to validate numeric form data. I'd like to validate numbers, percentages, and currency values along with validating the range of those numbers.

For example, assume I have the following percentage input:

and the following function:

Can someone help me with coming up with a regular expression to normalize the value? An explanation of the regex would also be helpful because the currency validation is going to be a pain because of the vast array of currencies supported. Thanks in advance.

Here are the requirements that I came up with:
// expression starts with zero or one - character
// the next 1 to n characters must be numbers
// next, the text can contain zero or one instances of (a decimal separator followed by 1 to n numbers)
// expression ends with zero or one % character
// for an input of 12.5% or 12.5 I would like to get match to return 12.5
// if the input is 12.45 I can do the rounding after the normalizing

I figured out the regEx, but I'm having trouble getting match to be 12.5 if 12.5% is entered. Here is the regex and code:
var value = "12.5%";
var regEx = /^(-)?(\d)+(\.(\d)+)*(%)?$/;
var match = regEx.exec(value);
for (var i = 0; i < match.length; i++) {
[ October 18, 2007: Message edited by: Dom Lassy ]
[ October 18, 2007: Message edited by: Dom Lassy ]