Using ExpressionEvaluatorManager in a Struts Action execute()
Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using ExpressionEvaluatorManager in a Struts Action execute()
Hey Denis, - first of all, this is really the list for non-struts taglibraries, for struts issues please refer to [EMAIL PROTECTED] - second, I'm not that sure what you mean, but can't you use the struts-el taglibraries to create the param at the time the link is created? I think the el-taglibs are in the struts 1.1 distribution. Grtz, Martin -Oorspronkelijk bericht- Van: f. [mailto:[EMAIL PROTECTED] Verzonden: woensdag 17 maart 2004 10:00 Aan: [EMAIL PROTECTED] Onderwerp: Using ExpressionEvaluatorManager in a Struts Action execute() Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - 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 ExpressionEvaluatorManager in a Struts Action execute()
Martin, First thanks for your reactivity. I sent message to struts-user list before I post here . The evaluation of the expression can not be done during jsp processing because 1- custom tags are processed defining a datatable 2- table is then sent to browser 3- click each cell in the same column will request an URI with the same EL expression (specific to a column) 4- elExpression is supposed to be evaluated by the controller I can not evaluate each EL Expression for each cell, since only one cell will be clicked. I hope my problem is more clear, now. Any Idea ? Martin van Dijken wrote: Hey Denis, - first of all, this is really the list for non-struts taglibraries, for struts issues please refer to [EMAIL PROTECTED] - second, I'm not that sure what you mean, but can't you use the struts-el taglibraries to create the param at the time the link is created? I think the el-taglibs are in the struts 1.1 distribution. Grtz, Martin -Oorspronkelijk bericht- Van: f. [mailto:[EMAIL PROTECTED] Verzonden: woensdag 17 maart 2004 10:00 Aan: [EMAIL PROTECTED] Onderwerp: Using ExpressionEvaluatorManager in a Struts Action execute() Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - 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 ExpressionEvaluatorManager in a Struts Action execute()
Clearer, I hope you're aware that the approach you're on ties your programming to the jakarta api for JSTL which might not be a good idea in the first place. I'm thinking there might be some better way to do what you need, but can't evaluate that fully until you describe what it is you're trying to accomplish. What you describe is a technical way to solve some problem, but there might be other solutions to the same problem... Martin -Oorspronkelijk bericht- Van: f. [mailto:[EMAIL PROTECTED] Verzonden: woensdag 17 maart 2004 10:53 Aan: Tag Libraries Users List Onderwerp: Re: Using ExpressionEvaluatorManager in a Struts Action execute() Martin, First thanks for your reactivity. I sent message to struts-user list before I post here . The evaluation of the expression can not be done during jsp processing because 1- custom tags are processed defining a datatable 2- table is then sent to browser 3- click each cell in the same column will request an URI with the same EL expression (specific to a column) 4- elExpression is supposed to be evaluated by the controller I can not evaluate each EL Expression for each cell, since only one cell will be clicked. I hope my problem is more clear, now. Any Idea ? Martin van Dijken wrote: Hey Denis, - first of all, this is really the list for non-struts taglibraries, for struts issues please refer to [EMAIL PROTECTED] - second, I'm not that sure what you mean, but can't you use the struts-el taglibraries to create the param at the time the link is created? I think the el-taglibs are in the struts 1.1 distribution. Grtz, Martin -Oorspronkelijk bericht- Van: f. [mailto:[EMAIL PROTECTED] Verzonden: woensdag 17 maart 2004 10:00 Aan: [EMAIL PROTECTED] Onderwerp: Using ExpressionEvaluatorManager in a Struts Action execute() Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - 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: Using ExpressionEvaluatorManager in a Struts Action execute()
What about using directly a org.apache.commons.el.ExpressionEvaluatorImpl? No PageContext is needed. You just have to provide a javax.servlet.jsp.el.VariableResolver and I think you should write it carefully to avoid generating a security hole as your EL comes from the request. Marc. f. wrote: Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using ExpressionEvaluatorManager in a Struts Action execute()
Hello Marc, That seems great but I think we won't use JSP 2.0 cos we need Jetty Stable release. Somebody told me about commons-jexl maybe this would be the best solution. Thanks for your help. Denis. Marc Guillemot wrote: What about using directly a org.apache.commons.el.ExpressionEvaluatorImpl? No PageContext is needed. You just have to provide a javax.servlet.jsp.el.VariableResolver and I think you should write it carefully to avoid generating a security hole as your EL comes from the request. Marc. f. wrote: Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - 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: Lucene Taglib
Iskandar Salim wrote: Yes, I'm planning to add it to the Jakarta Taglib Sandbox and have read through the documents on submitting a new taglib. However, I think the taglib is still too basic in it's functions and Lucene is a huge API. I am still learning Lucene and Java, for that matter. I would gladly submit a proposal if you guys think otherwise and let the gurus improve on it. Iskandar, The taglib doesn't have to be complex to be useful, in fact I would say simpler taglibs are more desirable. I had spec'd out the design for a lucene taglib a while ago, and yours does everything I was looking to do. The only change I would make is to make an EL-version of it. -- Serge Knystautas President Lokitech software . strategy . design http://www.lokitech.com p. 301.656.5501 e. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using ExpressionEvaluatorManager in a Struts Action execute()
Guys, Many thanks for your time. Finally it works the way I described initially ... I feel a bit confused. It seems there is no way to do that a more simple way without using JSP 2.0. One day we will move to 2.0 and I will change that. Denis. Hello Marc, That seems great but I think we won't use JSP 2.0 cos we need Jetty Stable release. Somebody told me about commons-jexl maybe this would be the best solution. Thanks for your help. Denis. Marc Guillemot wrote: What about using directly a org.apache.commons.el.ExpressionEvaluatorImpl? No PageContext is needed. You just have to provide a javax.servlet.jsp.el.VariableResolver and I think you should write it carefully to avoid generating a security hole as your EL comes from the request. Marc. f. wrote: Hi, The idea is an hyperlink on HTML Page calling a Struts Action and with an URI ending with like myAction.do?elexpression=sessionScope['mylist'][param.row] So I need the ELanguage power in my Action.execute( ) method. I tryed to get a PageContext( ) from JSPFactory.DefaultFactory( ) (using current request, response,etc ) but now my container (Jetty) send JSP source instead of JSP processing result. -- public class DetailHandlerAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pc = JspFactory.getDefaultFactory().getPageContext(this.getServlet(),request, response, null, true, 4096 , false ); evaluatedDetailRef = ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc); javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc); Any idea ? Thanks for your help. Denis. - 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: Internal Servlet Error using Taglibs-image on Tomcat 3.2.3 andj2sdk1.4.1_06
thank you guys for your time. I'll try to upgrade to Tomcat 4 or 5. -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 1:43 AM To: Tag Libraries Users List Subject: RE: Internal Servlet Error using Taglibs-image on Tomcat 3.2.3 andj2sdk1.4.1_06 On Wed, 17 Mar 2004 [EMAIL PROTECTED] wrote: I still have the distribution that I used to install Tomcat. I replaced the jar files with those of the dist and I got the same thing. I tried Tomcat 5 and the taglisb-image-exemples is working. Upgrading to a newer Tomcat version would be much more dificult than trying to work around the taglibs itself, because I have to upgrade my applications too that are already developped and deployed under tomcat 3.2.3. Tomcat 3.2.3 really is quite ancient. How about trying Tomcat 3.3.2, which is the latest version of that era of Tomcat, released recently? Unless you're doing something rather unusual, you shouldn't have to upgrade your apps just to use a newer version of Tomcat. -- Martin Cooper -Original Message- From: Roy Benjamin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 1:54 PM To: Tag Libraries Users List Subject: Re: Internal Servlet Error using Taglibs-image on Tomcat 3.2.3 andj2sdk1.4.1_06 Not sure if this is helpful, but I'd be very reluctant to adopt a 'replace all methods' approach. Event if it were to work, you probably have not actually found the problem. The first thing I would do is to grab another copy (download) of Tomcat and untar it into a temp directory. Then I'd check to be sure the various jar files are all exactly the same between your failing run-time and the fresh download. I've occasionally had trouble with corrupted jar files... Then I'd try the same with a later version of Tomcat, possibly this might help? Or try reinstalling Tomcat again. Roy On Tue, 2004-03-16 at 09:07, [EMAIL PROTECTED] wrote: Hi ! I'm reposting the emai and hoping that someone could finaly help me to resolve the problem. I installed the image-examples under webapps in Tomcat v3.2.3 using j2sdk1.4.1_06 and I when I run http://myserver/image-examples/index.jsp I get an Internal Servlet Error with a root cause: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getRequestURL()Ljava/lang/StringBuffer ; I think the problem is with the servlet.jar that comes with tomcat 3.2.3. I made a quick search in google and I found that someone suggested to replace all methods javax.servlet.http.HttpServletRequest.getRequestURL() with javax.servlet.http.HttpUtils.getRequestURL(request) http://mail.sourceid.org/pipermail/sso-users/2003-May/000119.html I don't know if this will work if I do this in taglibs-source code, but is there any work around already available without the need to upgrade my tomcat webserver or JDK to a newer version? thank you for your help. - 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]