MAPPING configuration error for request URI
Hi, Can someone help me with resolving this error ? In my jsp, I have the following code: img src='/displayPhotoServlet?imgId=%= izjnUser.getID() %' In my web.xml, i have the following code: servlet servlet-nameDisplayPhotoServlet/servlet-name servlet-classcom.donreal.ikzagjenet.web.DisplayPhotoServlet/servlet-class /servlet servlet-mapping servlet-namedisplayPhotoServlet/servlet-name url-pattern/displayPhotoServlet/url-pattern /servlet-mapping Someone some suggestions ?
problem with image src tag
I'm running an entreprise application deployed on jboss with tomcat / catalina. How come img src=/displayPhoto does not work but img src=http://localhost:8080/IZJNApp/displayPhoto; does work ? Does anyone know how to solve this !?!? Thanks, Leonard Wolters
Re: Re[2]: Composite jsp files
Thanks man, this was exactly the info i needed. Going to check it right away... As you probably could guessed, struts is still a little bit new to me ! Anyway, thanks man Cheers, Leonard - Original Message - From: Dariusz Wojtas [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 6:20 PM Subject: Re[2]: Composite jsp files Maybe I misunderstood you, but ... Why can't you use the img tag? Image file isnot send in the same response that the jsp/html file is sent. Browser makes another call for the image after parsing the html code. Why don't you just print: img src='/myImgServlet?imgId=%= imgId %' ? And it works perfectly with the logic tags mentioned below. There is also no need to change the response type in the middle of writing to your output stream, because it is completely different call. You just set it once. And it will be served by separate servlet (here '/myImgServlet'). Dariusz Wojtas Wednesday, August 28, 2002, 5:44:40 PM, you wrote: LW Thanks John Cliff (prior answer). LW But john, unfortunately I can't use the img LW src tag since the images are directly retrieved LW from a database. It doesn't make sense to LW first (temporarily) store the images and then LW use the img source tag. Instead, I directly LW print the images by using the LW response.getOutputStream (or something similar) LW and setting the contentType + writing the bytes. LW Cliff helped me out by showing me the include LW tags, which i think can be very usefull. LW If this does not work, you will hear me scream ;) LW Regards, LW Leonard LW - Original Message - LW From: John Raley [EMAIL PROTECTED] LW To: Struts Users Mailing List [EMAIL PROTECTED] LW Sent: Wednesday, August 28, 2002 4:23 PM LW Subject: Re: Composite jsp files With Struts logic:equal tag: logic:equal ...img src=.../logic:equal Check the doc for the various logic:equal options. Leonard Wolters wrote: Is it possible to concatenate jsp files to one ? The problem i have now is that tomcat / catalina is complaining when I write multiple times to the outputstream. A nice: java.lang.IllegalStateException: getOutputStream() has already been called for this response is shown to me. My question is if anyone know how to concat jsp files, or to dymanically create jsp. The problem is as follows: I have a certain jsp file which may / may not show an image. Based on a particular (custom made) tag an image should be shown or not. In both cases, the rest of the page should remain the same. Does anyone has tips / suggestions how to do this T.i.a. Leonard -- Check it out: Map - JavaBean http://dynclass.sourceforge.net/ -- To unsubscribe, e-mail: LW mailto:[EMAIL PROTECTED] For additional commands, e-mail: LW mailto:[EMAIL PROTECTED] LW -- LW To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] LW For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Best regards, Dariusz Wojtas mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re[2]: Composite jsp files
Dariusz, Someway, somehow, I get an error message from struts or tomcat saying: MAPPING configuration error for request URI In my jsp i have: img src='/myImgServlet?imgId=%= imgId %' And my web.xml has the following mappings / declarations: !-- Display Photo Servlet -- servlet servlet-namemyImgServlet/servlet-name servlet-classcom.foobar.MyImgServlet/servlet-class /servlet !-- Display Photo Servlet Mapping -- servlet-mapping servlet-namemyImgServlet/servlet-name url-pattern/myImgServlet/url-pattern /servlet-mapping Can someone help me out ? - Original Message - From: Dariusz Wojtas [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 6:20 PM Subject: Re[2]: Composite jsp files Maybe I misunderstood you, but ... Why can't you use the img tag? Image file isnot send in the same response that the jsp/html file is sent. Browser makes another call for the image after parsing the html code. Why don't you just print: img src='/myImgServlet?imgId=%= imgId %' ? And it works perfectly with the logic tags mentioned below. There is also no need to change the response type in the middle of writing to your output stream, because it is completely different call. You just set it once. And it will be served by separate servlet (here '/myImgServlet'). Dariusz Wojtas Wednesday, August 28, 2002, 5:44:40 PM, you wrote: LW Thanks John Cliff (prior answer). LW But john, unfortunately I can't use the img LW src tag since the images are directly retrieved LW from a database. It doesn't make sense to LW first (temporarily) store the images and then LW use the img source tag. Instead, I directly LW print the images by using the LW response.getOutputStream (or something similar) LW and setting the contentType + writing the bytes. LW Cliff helped me out by showing me the include LW tags, which i think can be very usefull. LW If this does not work, you will hear me scream ;) LW Regards, LW Leonard LW - Original Message - LW From: John Raley [EMAIL PROTECTED] LW To: Struts Users Mailing List [EMAIL PROTECTED] LW Sent: Wednesday, August 28, 2002 4:23 PM LW Subject: Re: Composite jsp files With Struts logic:equal tag: logic:equal ...img src=.../logic:equal Check the doc for the various logic:equal options. Leonard Wolters wrote: Is it possible to concatenate jsp files to one ? The problem i have now is that tomcat / catalina is complaining when I write multiple times to the outputstream. A nice: java.lang.IllegalStateException: getOutputStream() has already been called for this response is shown to me. My question is if anyone know how to concat jsp files, or to dymanically create jsp. The problem is as follows: I have a certain jsp file which may / may not show an image. Based on a particular (custom made) tag an image should be shown or not. In both cases, the rest of the page should remain the same. Does anyone has tips / suggestions how to do this T.i.a. Leonard -- Check it out: Map - JavaBean http://dynclass.sourceforge.net/ -- To unsubscribe, e-mail: LW mailto:[EMAIL PROTECTED] For additional commands, e-mail: LW mailto:[EMAIL PROTECTED] LW -- LW To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] LW For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Best regards, Dariusz Wojtas mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Composite jsp files
Thanks John Cliff (prior answer). But john, unfortunately I can't use the img src tag since the images are directly retrieved from a database. It doesn't make sense to first (temporarily) store the images and then use the img source tag. Instead, I directly print the images by using the response.getOutputStream (or something similar) and setting the contentType + writing the bytes. Cliff helped me out by showing me the include tags, which i think can be very usefull. If this does not work, you will hear me scream ;) Regards, Leonard - Original Message - From: John Raley [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 28, 2002 4:23 PM Subject: Re: Composite jsp files With Struts logic:equal tag: logic:equal ...img src=.../logic:equal Check the doc for the various logic:equal options. Leonard Wolters wrote: Is it possible to concatenate jsp files to one ? The problem i have now is that tomcat / catalina is complaining when I write multiple times to the outputstream. A nice: java.lang.IllegalStateException: getOutputStream() has already been called for this response is shown to me. My question is if anyone know how to concat jsp files, or to dymanically create jsp. The problem is as follows: I have a certain jsp file which may / may not show an image. Based on a particular (custom made) tag an image should be shown or not. In both cases, the rest of the page should remain the same. Does anyone has tips / suggestions how to do this T.i.a. Leonard -- Check it out: Map - JavaBean http://dynclass.sourceforge.net/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
using tags/servlets within jsp's
Is it possible to include a tag (or servlet) in a jsp which directly writes to the outputstream (the same on as the jsp) ? Right now, tomcat is throwing a org.apache.jasper. runtime.ServletResponseWrapperInclude.getOutputStream... or a java.lang.IllegalStateException: getOutputStream() has already been called for this response In other words, is it possible that a tag (or servlet) together with a normal jsp build up a screen ? T.i.a. Leonard
NEWBIE: questions concerning uploading of files
Hi there, I have some questions concerning uploading of files. From my previous HTML experience I know that for uploading of files, one can (and should!) use the Oreilly Servlet package. I get a nasty 'javax.servlet.ServletException: BeanUtils.populate with root cause: java.lang.IllegalArgumentException: argument type mismatch when submitting a file. Short explanation: I use a dedicated Action for uploading the file. The idea is that when a user presses the submit button, this action is triggered and uses the Oreilly Package for successfully receiving the file. Code Snipplet A: photo.jsp html:form action=/uploadPhoto method=POST enctype=multipart/form-data table border=0 width=100% tr td html:file property=file/ /td /tr tr td align=right html:submit bean:message key=button.upload/ /html:submit /td /tr /table /html:form Code Snipplet B: struts-config.xml action path=/uploadPhoto type=UploadPhotoAction name=photoForm scope=request input=/photo.jsp /action First question: How is the property 'file' being transferred to the photoForm ? As a string or file ? Is it being transferred to the form at all ? I assume it is, since the BeanProperties.populate. Second question: I can use a Servlet for uploading the file instead of an action. The problem then is how to formulize the 'action' target of the form element. Should I use the html:form action=http://localhost:8080/IZJNApp/servlet/uploadServlet; or can I use html:form action=servlet/uploadServlet (which is much better since not depending on hardcoded localhost and port) Is this possible and if yes, how ? Does anyone has a good document about when to use servlets and when to use actions ? Third question: (Not very related). I have problems downloading / viewing the struts config dtd found at http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd Where can I find this dtd ? Last question: (rather simple) How can one i18n the text on the 'browse' button (the submit type) ? With other words, I want to replace the 'Browse' text on the submit button. Perhaps that anyone has general solutions for this problem, i.e. argument type mismatch ? Thanks in advance, Leonard
Problems with html:file
Hi there, I have some questions concerning uploading of files. From my previous HTML experience I know that for uploading of files, one can (and should!) use the Oreilly Servlet package. I get a nasty 'javax.servlet.ServletException: BeanUtils.populate with root cause: java.lang.IllegalArgumentException: argument type mismatch when submitting a file. Short explanation: I use a dedicated Action for uploading the file. The idea is that when a user presses the submit button, this action is triggered and uses the Oreilly Package for successfully receiving the file. Code Snipplet A: photo.jsp html:form action=/uploadPhoto method=POST enctype=multipart/form-data table border=0 width=100% tr td html:file property=file/ /td /tr tr td align=right html:submit bean:message key=button.upload/ /html:submit /td /tr /table /html:form Code Snipplet B: struts-config.xml action path=/uploadPhoto type=UploadPhotoAction name=photoForm scope=request input=/photo.jsp /action First question: How is the property 'file' being transferred to the photoForm ? As a string or file ? Is it being transferred to the form at all ? I assume it is, since the BeanProperties.populate. Second question: I can use a Servlet for uploading the file instead of an action. The problem then is how to formulize the 'action' target of the form element. Should I use the html:form action=http://localhost:8080/IZJNApp/servlet/uploadServlet; or can I use html:form action=servlet/uploadServlet (which is much better since not depending on hardcoded localhost and port) Is this possible and if yes, how ? Does anyone has a good document about when to use servlets and when to use actions ? Third question: (Not very related). I have problems downloading / viewing the struts config dtd found at http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd Where can I find this dtd ? Last question: (rather simple) How can one i18n the text on the 'browse' button (the submit type) ? With other words, I want to replace the 'Browse' text on the submit button. Perhaps that anyone has general solutions for this problem, i.e. argument type mismatch ? Thanks in advance, Leonard