Win a copy of Rust Web Development this week in the Other Languages forum!

Brian Podolny

Ranch Hand
+ Follow
since Aug 29, 2000
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 Brian Podolny

I think that will work. I might include the file extension as an attribute of the attachment element rather than as a separate element. I could probably include the encoding type as an attribute as well - to increase flexibility. What do youy think?
The main point of the mailer as a webservice is for applications to have a simple and common way to send notification messages. File attachments will rarely be used but I think I need to plan for them. Unfortunately, forcing the developer to encode attachments and then embed them into an xml doc in order to use the webservice, doesn't really simplify things for the developer at all.
Thanks again!
I've been tasked with writing a java mailer / webservice to simplify sending emails from within our applications.
The mailer will have a function, sendMail() which will take an xml document as a String parameter. The xml document will contain all of the message info (i.e. sender, recips, message body, etc).
I'm stumped on what would be the best way to include any attachments within the mail doc. Any idea's?
Here are my thoughts:
I'm thinking I will include an <attachmentlist> element which will contain 1 <attachment> element for each attachment for the email. However, I don't know how to write a file as the data for an element and I don't know how I will extract that data and put it into a multipart message.
Sorry if this sounds a bit lame-brained but if the CGI has been placed in a directory that is not directly accessible via the webserver then how is a URL, even a local one, going to resolve to CGI program which, if I understand your suggestion correctly, is not accessible via direct URL.
19 years ago
Unfortunately, I can't just pass the environment variables to the commercial CGI program directly because the company that wrote it won't reveal what information it requires.
Could you elaborate a little more on what you mean by a protected area and what you would be using the URL class for?
Thanks to both of you for your help.
[ December 06, 2002: Message edited by: Brian Podolny ]
19 years ago
I have a commercial cgi program (read as blackbox) which, for security reasons, I cannot expose directly to web users.
What I want to do is receive the request for the program and reroute it to a servlet which would perform authorization checking on the user. If the user is authorized then the java servlet would execute the cgi program directly and return the output to the user.
A call to the cgi program using Runtime.exec(program) doesn't work because the cgi program needs to be running in the web server environment.
I can accomplish what I want by running a batch file (this on Windows2K) as a cgi and then running the cgi program from the batch file but this an inelegant solution.
Any ideas? Thanks a bunch!
[ December 06, 2002: Message edited by: Brian Podolny ]
19 years ago
I have very little experience with XML, but I think it may help to solve a problem for my company. They are a direct sale company and every time they change fulfillment houses( the company that executes the orders and the billing ), they have to modify their internal data structures to meet those of the new fulfillment house; that also means major changes to all the applications that run off of that database. It seems to me that developing XML schemas for the various sets of information that we need to send to the fulfillment house will enable us to leverage XSL when we need to deliver that info in a specific format, as well as to transform our internal data into a form that can be more readily processed by a new fulfillment house if we ever need to switch again.
Here's a sample XML document that might be used to describe the choices of products that a customer has for a given promtion:

The XML above indicates that the customer can/must choose 2 products. One must be a mug, hat, or thermos and the other must be either a robe or a jacket.
Other than the oversimplification, I see two problems with this system as opposed to the current system. How will we be able to report on common product groupings. I included the id attribute for Offers with the idea that each "offers" id would indicate a unique set of "offer" tags. How could I enforce this. It's simple with a database, you just use a "lookup" table.
Also, if we were using a "lookup" table, then we would just send the id from the lookup table rather than all the offer and product details. We would only have to send those once and then send the id's that reference a specific grouping of offers and products. It seems like we need to send all the information every time.
Would you just design more xml documents that function as lookups?
Lastly, it seems like it would be much slower and somewhat unwieldy to do analysis reporting off of scores of xml files. For instance, if I needed to extract the id of a campaign for each campaign that had an <offers> with a specific id, wouldn't that be painfully slow?
Sorry to be so long winded. I'm really excited about all of this but have no one at work to consult with.
Brian Podolny
[ January 12, 2002: Message edited by: Brian Podolny ]
That's a good solution Xavier. Thanks. I'm not crazy about the active wait, so I 'll keep thinking on it but if I can't come up with anything than your solution is my way to go.
Thanks for the reply but I don't think that solves the problem. The thread is still blocked on the accept(). The stop() method is the right way to shut down but it will not be invoked.
Maybe I'm missing something...
How can you interrupt a thread that is blocking on IO.
I have a thread which is in an infinite loop, which keeps calling ServerSocket.accept();
Interrupting this thread does nothing until it receives a client connection because it is blocked on the accept() method.
Any suggestions?
Brian Podolny
I have what I think is an interesting problem.
I'm submitting a form via email. After the form is submitted I need to open a new widow with a small thank you message in it and I need to redirect the page with the form to the home page of the website.
It would seem that all I need to do is open the new Window using the onSubmit listener of the form and include a redirection of the parent in the new Window. The problem is, is that internet explorer pops up a warning message about sending info over the web. This gives the focus to the form window and the Thank You window is no longer visible. How can I prevent this?
Also, a better way to do this would to only have the thank you message window open if the form is actually mailed. Is there a way to do that?
Thanks again,
Brian Podolny
Well the name property was exactly what I needed to use but thanks for the extra suggestion Bill. That nameing "trick" works nicely.
Is there a way in Java to look up a variables "name" dynamically?
( I'm asking this as an unrelated question, I'm not asking this with regards to an html page )
Thanks again.

Originally posted by bill bozeman:
I have used this technique before when validating long forms. I make the name of all the form items that are required something like "reqEmail" then I do a loop through all the form items, if it starts with "req" then I check the value of the form. If it is blank then I give them a message like:
"Please enter your " + substring(3,document.form[item].name.length)"
where I just chop off the "req" portion of the name. I can't remember the exact syntax off hand, but it is something like the above.

Is there a way to dynamically assign a variables name during script execution? For that matter can you do this in Java?
To be more specific, I'm reading in a lot of data from a form.
I would like to ouput a message which will be a String concatenated from the form data entered by the user. To more clearly identify that data to the end user I'd like to be able to "stick" the variable names into the String as well. I'd prefer not to hard code it but maybe I have to.
Should I just use
Brian Podolny
Thanks Bill,
I think your first suggestion will do it for me. I'm not quite sure what you mean by building and passing the queryString dynamically but I think I'll be able to figure it out.
I'm having some trouble getting a child window to open up with some data submitted in a form. What I don't understand is:
What should I set for the action parameter in order to pass the form information to a javascript method that opens a new html( asp? ) page which is based on the form info.
That is, do I specify a new html page, or a javascript method in the action parameter? Or should I go a completely different route and use the onSubmit event. If I do this then should the action parameter be left empty?
Brian Podolny
I've written an application and included a print method which prints the document using awt. Funny thing is, the program prints correctly when run from the jre in jdk 1.3 but doesn't print correctly with earlier versions. Is there a way to bundle a jre in a jar file with a java application so that I can ensure that the program will run in the 1.3 jre?
21 years ago