On Tue, 1 Mar 2005 09:11:28 -0800, Craig McClanahan <[EMAIL PROTECTED]> wrote: > Doing the simple version of a change like this will cause the wrapper > class to not be compilable against a 2.2 or 2.3 version of the servlet > API any longer, which is a particular problem for the standard Struts > release.
I don't believe that's the case. The current implementation of MultipartRequestWrapper uses exactly the same technique that Ramiro mentions to allow compilation against the Servlets 2.3 API. Adding extra methods to the implementation class allows it to compile against the newer API, while the methods become just ordinary class methods when compiled against the older API. It's true that the dummy methods added to satisfy the newer API are not useful (without the use of reflection, as you suggest below), but that doesn't seem to have caused problems for people using the Servlets 2.3 API while we've been dummying up the methods new to that version over Servlets 2.2. -- Martin Cooper > It will require a bit more work to use reflection to call > through these methods if they exist, or return nothing if they do not > exist. > > Craig > > > On Tue, 01 Mar 2005 14:11:41 +0100, Ramiro Alba Queipo <[EMAIL PROTECTED]> > wrote: > > Hello everybody: > > > > I was using tomcat 4.0.24 to develop an application with struts, I and > > decided to migrate to tomcat 5.0.28 so as I could user EL natively from > > JSP 2.0. I thought it would be a good idea to compile STRUTS 1.2.4 under > > servlet 2.4 and JSP 2.0 from tomcat 5.0.28. Everything went wright > > except for one class: > > > > org/apache/struts/upload/MultipartRequestWrapper.java > > > > It is not implementing the following methods from interface > > javax.servlet.ServletRequest corresponding to servlet-api.jar of tomcat > > 5.0.28: > > > > public String getLocalName() {} > > public String getLocalAddr() {} > > public int getLocalPort() {} > > public int getRemotePort() {} > > > > To bypass the problem I created trivial methods, and then I could > > complete the compilation process. Everything seams to work, but in order > > to work with tomcat 5.0.x: > > > > 1) Is it a good idea to make this compilation o better to stuck with > > the official binary supplied struts.jar? > > > > 2) Is this situation going to be solved in a near feature? (I have seen > > no changes in struts 1.2.6) > > > > I have found the same problem compiling struts-faces, which seams to be > > compiled with servlet and jsp apis from tomcat 5.0.25 > > > > Thanks in advance > > > > Regards > > > > P.D: I have posted this e-mail at user@struts.apache.org more than a > > week ago and I have no answer, probably due to be a question out of > > scope for that list, so I decided to post here the same question. Sorry > > for the cross posting. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]