You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Shrivastava <as...@gmail.com> on 2011/02/12 08:26:52 UTC

Problem using JSP expressin in Struts 2

Hi,
We are in the process to upgrade our application. Currently our aplication
is on
*Weblogic: 8.1sp5
Java: 1.4
Struts: 1.2 *
We are upgrading it to:
*Server: Weblogic 10.3
Java: 1.6.0_5
Current Struts: 2.0.14
*We are facing issue with jsp expression in struts tag.
All the expression which uses JSP variable as <%=name%> are not working and
getting error "Request time value is not supported".
As the application is old and there are lots of pages, this will take lot of
time and effort to convert JSP expression to , i just want to know if there
is any solution for this problem or we strictly need to use OGNL expression
and change all JSPs.
Is there any possibility that we can use JSP expression with struts 2.0.14,
if not then which is the highest version supported for JSP expression.
I tried with Struts 2.0.8 as mentioned in
http://struts.apache.org/2.0.14/docs/why-cant-i-use-jstl-style-el-expressions-in-struts-tags.htmllink
but it is also giving the same error.

Thanks & Regards
Ashish

Re: Problem using JSP expressin in Struts 2

Posted by Chris Pratt <th...@gmail.com>.
You can use JSP EL just fine (I'd still suggest getting rid of Scriplets,
they're just bad mojo), you just can't pass them to the Struts Tags as
attributes.  You can use your own JSP Tag Libraries (I do), and use EL
anywhere on the page with the exception of the <s:> tag attributes.  And
there are alternative ways of getting to anything you need using OGNL with
the Struts Tags.
  (*Chris*)

On Sat, Feb 12, 2011 at 3:08 AM, Ashish Shrivastava <as...@gmail.com>wrote:

> Thanks a lot Chris.
> I tried with the option and it is working fine :).
> We will think about the security risk and decide whether to update or not.
> But as you mentioned that JSP EL is not supported in struts this mean old
> JSP applications (which uses scriptlet or JSP EL) either can not be
> upgraded
> or it will need huge cost to migrate/re-build the appilcation.
> Thanks & Regards
> Ashish Shrivastava
> On Sat, Feb 12, 2011 at 2:16 PM, Chris Pratt <thechrispratt@gmail.com
> >wrote:
>
> > JSP Expressions are not allowed in the Struts 2 Tag Libs because of
> > security
> > concerns allowing hackers to use JSP EL to inject OGNL into the tags to
> do
> > bad things.  If you don't care about this problem, you can copy the
> struts
> > .tld file out of the struts.jar file and add
> > <rtexprvalue>true</rtexprvalue>
> > to all the attributes, and it will allow you to use EL, at your user's
> > risk.
> >  (*Chris*)
> >
> > On Fri, Feb 11, 2011 at 11:26 PM, Ashish Shrivastava
> > <as...@gmail.com>wrote:
> >
> > > Hi,
> > > We are in the process to upgrade our application. Currently our
> > aplication
> > > is on
> > > *Weblogic: 8.1sp5
> > > Java: 1.4
> > > Struts: 1.2 *
> > > We are upgrading it to:
> > > *Server: Weblogic 10.3
> > > Java: 1.6.0_5
> > > Current Struts: 2.0.14
> > > *We are facing issue with jsp expression in struts tag.
> > > All the expression which uses JSP variable as <%=name%> are not working
> > and
> > > getting error "Request time value is not supported".
> > > As the application is old and there are lots of pages, this will take
> lot
> > > of
> > > time and effort to convert JSP expression to , i just want to know if
> > there
> > > is any solution for this problem or we strictly need to use OGNL
> > expression
> > > and change all JSPs.
> > > Is there any possibility that we can use JSP expression with struts
> > 2.0.14,
> > > if not then which is the highest version supported for JSP expression.
> > > I tried with Struts 2.0.8 as mentioned in
> > >
> > >
> >
> http://struts.apache.org/2.0.14/docs/why-cant-i-use-jstl-style-el-expressions-in-struts-tags.htmllink
> > > but it is also giving the same error.
> > >
> > > Thanks & Regards
> > > Ashish
> > >
> >
>

Re: Problem using JSP expressin in Struts 2

Posted by Ashish Shrivastava <as...@gmail.com>.
Thanks a lot Chris.
I tried with the option and it is working fine :).
We will think about the security risk and decide whether to update or not.
But as you mentioned that JSP EL is not supported in struts this mean old
JSP applications (which uses scriptlet or JSP EL) either can not be upgraded
or it will need huge cost to migrate/re-build the appilcation.
Thanks & Regards
Ashish Shrivastava
On Sat, Feb 12, 2011 at 2:16 PM, Chris Pratt <th...@gmail.com>wrote:

> JSP Expressions are not allowed in the Struts 2 Tag Libs because of
> security
> concerns allowing hackers to use JSP EL to inject OGNL into the tags to do
> bad things.  If you don't care about this problem, you can copy the struts
> .tld file out of the struts.jar file and add
> <rtexprvalue>true</rtexprvalue>
> to all the attributes, and it will allow you to use EL, at your user's
> risk.
>  (*Chris*)
>
> On Fri, Feb 11, 2011 at 11:26 PM, Ashish Shrivastava
> <as...@gmail.com>wrote:
>
> > Hi,
> > We are in the process to upgrade our application. Currently our
> aplication
> > is on
> > *Weblogic: 8.1sp5
> > Java: 1.4
> > Struts: 1.2 *
> > We are upgrading it to:
> > *Server: Weblogic 10.3
> > Java: 1.6.0_5
> > Current Struts: 2.0.14
> > *We are facing issue with jsp expression in struts tag.
> > All the expression which uses JSP variable as <%=name%> are not working
> and
> > getting error "Request time value is not supported".
> > As the application is old and there are lots of pages, this will take lot
> > of
> > time and effort to convert JSP expression to , i just want to know if
> there
> > is any solution for this problem or we strictly need to use OGNL
> expression
> > and change all JSPs.
> > Is there any possibility that we can use JSP expression with struts
> 2.0.14,
> > if not then which is the highest version supported for JSP expression.
> > I tried with Struts 2.0.8 as mentioned in
> >
> >
> http://struts.apache.org/2.0.14/docs/why-cant-i-use-jstl-style-el-expressions-in-struts-tags.htmllink
> > but it is also giving the same error.
> >
> > Thanks & Regards
> > Ashish
> >
>

Re: Problem using JSP expressin in Struts 2

Posted by Chris Pratt <th...@gmail.com>.
JSP Expressions are not allowed in the Struts 2 Tag Libs because of security
concerns allowing hackers to use JSP EL to inject OGNL into the tags to do
bad things.  If you don't care about this problem, you can copy the struts
.tld file out of the struts.jar file and add <rtexprvalue>true</rtexprvalue>
to all the attributes, and it will allow you to use EL, at your user's risk.
  (*Chris*)

On Fri, Feb 11, 2011 at 11:26 PM, Ashish Shrivastava
<as...@gmail.com>wrote:

> Hi,
> We are in the process to upgrade our application. Currently our aplication
> is on
> *Weblogic: 8.1sp5
> Java: 1.4
> Struts: 1.2 *
> We are upgrading it to:
> *Server: Weblogic 10.3
> Java: 1.6.0_5
> Current Struts: 2.0.14
> *We are facing issue with jsp expression in struts tag.
> All the expression which uses JSP variable as <%=name%> are not working and
> getting error "Request time value is not supported".
> As the application is old and there are lots of pages, this will take lot
> of
> time and effort to convert JSP expression to , i just want to know if there
> is any solution for this problem or we strictly need to use OGNL expression
> and change all JSPs.
> Is there any possibility that we can use JSP expression with struts 2.0.14,
> if not then which is the highest version supported for JSP expression.
> I tried with Struts 2.0.8 as mentioned in
>
> http://struts.apache.org/2.0.14/docs/why-cant-i-use-jstl-style-el-expressions-in-struts-tags.htmllink
> but it is also giving the same error.
>
> Thanks & Regards
> Ashish
>