RE: Using a servlet code within Struts
Although this is possible, as other posters have said, I'd ask what you are going to achieve by doing this? The servlet you already have will quite happily work alongside the Struts servlet without any problems. If you've got existing servlets you want to migrate to Struts & model 2 then I'd do roughly the following: 1) In your servlet identify the objects/properties that are used inside your out.write() statements. 2) Create a struts action based on your servlet code, replacing the out.writes()s with setting request scope attributes with the relevant objects and properties 3) Create a jsp (based on the html output from the original servlet) which used the request scope attributes for the dynamic content. Paul > -Original Message- > From: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED] > Sent: 16 June 2004 17:28 > To: [EMAIL PROTECTED] > Subject: Using a servlet code within Struts > > > Hello everyone > I want to make some servlet code to work in Struts. > i dont want to make the servlet to work. i want to > rewrite the code into Struts. > > The servlet uses out = response.getOutputStream() > and then out.write(); > > I know Struts uses the model 2, so that the view is > a jsp. > > Im thinking of using and action, where i use the response object, > and i would do it like i do in the servlet. However, i > dont know how to use the ActionForward, because i would > render the output, based in the servlet. i mean no JSP. > > How would u solve this problem? > > > > > -- > Ricardo Andrés Quintero R. > Ubiquando Ltda. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using a servlet code within Struts
Yes. You can return null inside the Action's execute method just like follows: OutputStream out = response.getOutputStream(); out.write(data.getBytes()); //This action sends the response itself, so return null. return null; Reddy Pingili > -Original Message- > From: Amleto Di Salle [SMTP:[EMAIL PROTECTED] > Sent: Wednesday, June 16, 2004 1:35 PM > To: 'Struts Users Mailing List' > Subject: R: Using a servlet code within Struts > > Hi, > you can return null inside the Action as ActionForward. > In this case Struts doesn't dispatch the request to view. > > BR > Amleto > > > -Messaggio originale- > Da: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED] > Inviato: mercoledì 16 giugno 2004 18.28 > A: [EMAIL PROTECTED] > Oggetto: Using a servlet code within Struts > > > Hello everyone > I want to make some servlet code to work in Struts. > i dont want to make the servlet to work. i want to > rewrite the code into Struts. > > The servlet uses out = response.getOutputStream() > and then out.write(); > > I know Struts uses the model 2, so that the view is > a jsp. > > Im thinking of using and action, where i use the response object, and i > would do it like i do in the servlet. However, i > dont know how to use the ActionForward, because i would > render the output, based in the servlet. i mean no JSP. > > How would u solve this problem? > > > > > -- > Ricardo Andrés Quintero R. > Ubiquando Ltda. > > > - > 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]
RE: Using a servlet code within Struts
Just return null in the Action code. At 10:33 AM 6/16/2004, Kommana, Sridhar wrote: Look at it here: http://www.jguru.com/faq/view.jsp?EID=531024 -Original Message- From: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:28 AM To: [EMAIL PROTECTED] Subject: Using a servlet code within Struts Hello everyone I want to make some servlet code to work in Struts. i dont want to make the servlet to work. i want to rewrite the code into Struts. The servlet uses out = response.getOutputStream() and then out.write(); I know Struts uses the model 2, so that the view is a jsp. Im thinking of using and action, where i use the response object, and i would do it like i do in the servlet. However, i dont know how to use the ActionForward, because i would render the output, based in the servlet. i mean no JSP. How would u solve this problem? -- Ricardo Andrés Quintero R. Ubiquando Ltda. - 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]
R: Using a servlet code within Struts
Hi, you can return null inside the Action as ActionForward. In this case Struts doesn't dispatch the request to view. BR Amleto -Messaggio originale- Da: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED] Inviato: mercoledì 16 giugno 2004 18.28 A: [EMAIL PROTECTED] Oggetto: Using a servlet code within Struts Hello everyone I want to make some servlet code to work in Struts. i dont want to make the servlet to work. i want to rewrite the code into Struts. The servlet uses out = response.getOutputStream() and then out.write(); I know Struts uses the model 2, so that the view is a jsp. Im thinking of using and action, where i use the response object, and i would do it like i do in the servlet. However, i dont know how to use the ActionForward, because i would render the output, based in the servlet. i mean no JSP. How would u solve this problem? -- Ricardo Andrés Quintero R. Ubiquando Ltda. - 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]
RE: Using a servlet code within Struts
Look at it here: http://www.jguru.com/faq/view.jsp?EID=531024 -Original Message- From: Ricardo Andres Quintero [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:28 AM To: [EMAIL PROTECTED] Subject: Using a servlet code within Struts Hello everyone I want to make some servlet code to work in Struts. i dont want to make the servlet to work. i want to rewrite the code into Struts. The servlet uses out = response.getOutputStream() and then out.write(); I know Struts uses the model 2, so that the view is a jsp. Im thinking of using and action, where i use the response object, and i would do it like i do in the servlet. However, i dont know how to use the ActionForward, because i would render the output, based in the servlet. i mean no JSP. How would u solve this problem? -- Ricardo Andrés Quintero R. Ubiquando Ltda. - 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]
Using a servlet code within Struts
Hello everyone I want to make some servlet code to work in Struts. i dont want to make the servlet to work. i want to rewrite the code into Struts. The servlet uses out = response.getOutputStream() and then out.write(); I know Struts uses the model 2, so that the view is a jsp. Im thinking of using and action, where i use the response object, and i would do it like i do in the servlet. However, i dont know how to use the ActionForward, because i would render the output, based in the servlet. i mean no JSP. How would u solve this problem? -- Ricardo Andrés Quintero R. Ubiquando Ltda. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]