Re: Using ExpressionEvaluatorManager in Struts Action execute() method

2004-03-17 Thread nicolas De Loof
Not beeing in a real JSP (your servlet doesn't extend any JspServlet) 
may cause some troubles to your servlet container.
To evaluate EL expression, you should consider using Jelly and Jexl 
language from jakarta-commons. I did it with success.

Nico.

f. a écrit :

Hi,

I am currently developping custom tags library for my company.

We use ExpressionEvaluatorManager  in our custom tags. That works 
really fine.

But one of our action class will be called from cells in a table of 
data (Html DataTable).
The Web Developper should be able to specify what to put in the 
session under a given name when this
kind of link is clicked. And the way to do that is an expression in 
Expression Language (JSTL).

So my Struts Action code should be able to evaluate the (request 
Parameter) expression
in the Action execute() method to be able to put the right object in 
session before next forward.

I got the Page context with:
PageContext pc = 
javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(
  this.getServlet(),request, response, null, true, 4096 , 
false );

I evaluated the expression
  evaluatedDetailRef = 
ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc);

I released the Page Context
  
javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc);

And now my servlet container (Jetty) seems crazy and instead of 
processing JSP file and sending result to browser,
it sends JSP source directly to browser 

Does it make sense for you ? Is it crazy to use EL in Action execute( 
) method ??  (Was  an idea  of my Team leader  )
I am stuck. Thanks for your help.

Regards,
Thanks
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]


Using ExpressionEvaluatorManager in Struts Action execute() method

2004-03-16 Thread f.
Hi,

I am currently developping custom tags library for my company.

We use ExpressionEvaluatorManager  in our custom tags. That works really 
fine.

But one of our action class will be called from cells in a table of data 
(Html DataTable).
The Web Developper should be able to specify what to put in the session 
under a given name when this
kind of link is clicked. And the way to do that is an expression in 
Expression Language (JSTL).

So my Struts Action code should be able to evaluate the (request 
Parameter) expression
in the Action execute() method to be able to put the right object in 
session before next forward.

I got the Page context with:
PageContext pc = 
javax.servlet.jsp.JspFactory.getDefaultFactory().getPageContext(
  this.getServlet(),request, response, null, true, 4096 , 
false );

I evaluated the expression
  evaluatedDetailRef = 
ExpressionEvaluatorManager.evaluate(null, detailRef, Object.class, pc);

I released the Page Context
  
javax.servlet.jsp.JspFactory.getDefaultFactory().releasePageContext(pc);

And now my servlet container (Jetty) seems crazy and instead of 
processing JSP file and sending result to browser,
it sends JSP source directly to browser 

Does it make sense for you ? Is it crazy to use EL in Action execute( ) 
method ??  (Was  an idea  of my Team leader  )
I am stuck. Thanks for your help.

Regards,
Thanks
Denis.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]