File Upload with multiple buttons on a form

Hello, I am trying to implement a file upload piece using my own custom component, an Upload filter, and the Jakarta Commons Upload functionality. The upload works fine when I click the button that actually saves the file. However, if I click any other button on the form and it is submitted, the Upload filter is called again, which is bad. Is there anyway I can determine within my filter what button was clicked? If not, is there a better way to solve this problem without creating a duplicate page that the Upload button navigates too to satisfy the filter?

[568 byte] By [Bart69a] at [2007-11-26 19:05:30]
# 1
When you submit the form with button its id is stored as request parameter. In the filter you could check that parameter and perform some logic.
amitteva at 2007-7-9 20:55:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I ran the following method inside my filter and there are no parameters found. Is this something done automatically or am I looking in the wrong place?

public void printRequestParameters(HttpServletRequest req) {

logger.info("printing parameters");

// Get an enumeration on the header names

Enumeration hm = (Enumeration)req.getParameterNames();

// Loop through enumeration

while (hm.hasMoreElements()) {

String name = (String)hm.nextElement();

// Get value paired to name

String val = req.getParameter(name);

// Write result

System.err.println(name + ": " + val);

}

}

Bart69a at 2007-7-9 20:55:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...