This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I have a code to test that submits file to upload to a CGI url. I have a struts application to replace CGI server that takes uploaded file. All I need is, I would like to repalce the CGI url in place of .do Current struts URL is https://hostname/jack/FileUploadAndSave.do struts-config.xml contains
If i have understood correctly - you want to use a CGI to handle your uploads, and struts action should not handle your upload.
If this is the case, you are already set, and do not need to do anything in struts-config.xml OR web.xml. Remember as per your entry in web.xml, struts will come into play ONLY if the URL has a .do in it.
So, if your upload is pointing to a URL that does not have .do, it should just work fine - as long as you have the CGI script to receive that upload.
Joined: Dec 23, 2007
Thanks for reply James..
you want to use a CGI to handle your uploads, and struts action should not handle your upload
Not exactly... I would like to replace my struts application instead of cgi server. But my client application should not know they submit to a different server. Let them think they submit to cgi server and i would like to handle in my struts application.
I have seen in many places submitting to htm is redirected to action classes and in the same way submitted to a" fake .cgi" will go to take my struts application...
Joined: Apr 27, 2003
In web.xml, your servlet mapping should look like this (note the addition of .cgi there in url pattern):
For the above to work you should be using servlet 2.5 and above.
For an earlier servlet specificiation (define it twice):
Now, any request with .cgi url pattern will be handled by struts.
Joined: Dec 23, 2007
yeah... I did not use two <servlet-mapping>, only one is enough in my case, as this server will have only this action. So it works for me. Thanks for reply James...
subject: How to customize mapping in struts-config.xml ?