Re: html inside an action
I posted a tag (StoreTag) which will store the generated html from a jsp in a bean, then in your action you can get the RequestDispatchter and do an "include": Details in the following messages: http://www.mail-archive.com/[EMAIL PROTECTED]/msg94956.html http://www.mail-archive.com/[EMAIL PROTECTED]/msg94935.html Niall - Original Message - From: "ruben" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, March 25, 2004 3:59 PM Subject: html inside an action > hi! > how can i get the output generate in a .jsp inside an action like it was > a resource that i can process(a String or something else)??? > thanks a lot in advance. > > PD: I need to call jasper compiler or something similar? what can i do > that? thanks > > > - > 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: html inside an action
Hi, thanks everybody for the responses, they help us a lot to make a decision, i think that it could be better solution trying to do my requirements with tags , but i need that an import could load a resource dinamycally, something like these and SomeVariable has a String with the name of the resource, is this possible? i try to do but it doesn't work ... thanks a lot, Brendan Richards wrote: There's also jakarkta commons-httpclient http://jakarta.apache.org/commons/httpclient/ -Original Message- From: Qureshi, Affan [mailto:[EMAIL PROTECTED] Sent: 25 March 2004 17:04 To: Struts Users Mailing List Subject: RE: html inside an action HttpUnit is also a neat tool which might help. Have a JSP generate the HTML and access that using HttpUnit (or a simple URLConnection/Socket for that matter). And you can get the generated HTML in your Action. I hope I understand you this time. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: html inside an action hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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] - 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: html inside an action
I'd go n have a cup of tea.. On 25 Mar 2004, at 17:54, ruben wrote: hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: html inside an action
There's also jakarkta commons-httpclient http://jakarta.apache.org/commons/httpclient/ -Original Message- From: Qureshi, Affan [mailto:[EMAIL PROTECTED] Sent: 25 March 2004 17:04 To: Struts Users Mailing List Subject: RE: html inside an action HttpUnit is also a neat tool which might help. Have a JSP generate the HTML and access that using HttpUnit (or a simple URLConnection/Socket for that matter). And you can get the generated HTML in your Action. I hope I understand you this time. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: html inside an action hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: > What part of JSP do you want to generate? Is it Java code in the JSP > that you want to generate or static HTML/JavaScript? You might want to > look at Tag Libraries as well. > > > -Original Message- > From: ruben [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 10:00 AM > To: Struts Users Mailing List > Subject: html inside an action > > > hi! > how can i get the output generate in a .jsp inside an action like it > was a resource that i can process(a String or something else)??? > thanks a lot in advance. > > PD: I need to call jasper compiler or something similar? what can i do > that? thanks > > > - > 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] > > > > hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html inside an action
I'm not entirely sure what you're after - do you mean get a string with the contents populated by another jsp - independent from the current request being served? I created a test jsp in tomcat containing a tag, ran it and looked in tomcat's work folder at the servlet code generated for it. The key line of code seems to be JspRuntimeLibrary.include(request, response, "/myInclude.jsp", out, true); Here's the javadoc. Looks like it's specific to Tomcat though - I don't know if there's a cross-platform solution. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper/docs/api/org/apac he/jasper/runtime/JspRuntimeLibrary.html looks like the "out" is a JspWriter. I think you may be able to extend jspWriter to create a jsp writer that captures your string rather than sending to a response. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: 25 March 2004 16:00 To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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: html inside an action
HttpUnit is also a neat tool which might help. Have a JSP generate the HTML and access that using HttpUnit (or a simple URLConnection/Socket for that matter). And you can get the generated HTML in your Action. I hope I understand you this time. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: html inside an action hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: > What part of JSP do you want to generate? Is it Java code in the JSP > that you want to generate or static HTML/JavaScript? You might want to > look at Tag Libraries as well. > > > -Original Message- > From: ruben [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 10:00 AM > To: Struts Users Mailing List > Subject: html inside an action > > > hi! > how can i get the output generate in a .jsp inside an action like it > was a resource that i can process(a String or something else)??? > thanks a lot in advance. > > PD: I need to call jasper compiler or something similar? what can i do > that? thanks > > > - > 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] > > > > hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: html inside an action
You are much better off doing JSP tags for something like this. I don't understand why people are so afraid of doing custom tags? -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: html inside an action hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: > What part of JSP do you want to generate? Is it Java code in the JSP > that you want to generate or static HTML/JavaScript? You might want to > look at Tag Libraries as well. > > > -Original Message- > From: ruben [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 25, 2004 10:00 AM > To: Struts Users Mailing List > Subject: html inside an action > > > hi! > how can i get the output generate in a .jsp inside an action like it > was a resource that i can process(a String or something else)??? > thanks a lot in advance. > > PD: I need to call jasper compiler or something similar? what can i do > that? thanks > > > - > 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] > > > > hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: html inside an action
hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: html inside an action
hi These are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: html inside an action
So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: >What part of JSP do you want to generate? Is it Java code in the JSP that you want to >generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. > > >-Original Message- >From: ruben [mailto:[EMAIL PROTECTED] >Sent: Thursday, March 25, 2004 10:00 AM >To: Struts Users Mailing List >Subject: html inside an action > > >hi! >how can i get the output generate in a .jsp inside an action like it was >a resource that i can process(a String or something else)??? >thanks a lot in advance. > >PD: I need to call jasper compiler or something similar? what can i do >that? thanks > > >- >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] > > > hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html inside an action
Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html inside an action
What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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]