cancel
Showing results for 
Search instead for 
Did you mean: 

(JSTSG)(Web)Problems-P25 related scenario with NetWeaver 7.3

Former Member
0 Kudos

HI,

I am facing problem described on following link

http://wiki.sdn.sap.com/wiki/display/JSTSG/%28JSTSG%29%28Web%29Problems-P25

When using an Expression Language (EL) expression in an JSTL tag, for example (<c:out value="${1 + 1}" />), you receive an exception JspParseException.

However when using a static value there is no problem.

I am using NetWeaver 7.3 still facing the JspParseException..

This problem occurs with following scenario ::

abc.jsp has included another jsp called xyz.jsp with the help of <%@ include ... > (include directive).

So if value set through <c:set> in abc.jsp & try to access with the help of <c:out> in xyz.jsp problem persits.

Can anyone help me out?

Is this limitation of SAP NetWeaver app server?

The same works with other app servers like weblogic,websphere,jboss.

Regards,

Sankalp

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I'm facing the same problem. One JSP defines all the taglibs and includes another JSP which uses these taglibs. In the end I'm getting the same error. It's easily reproducable. Create a base.jsp with this content:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<%@ include file="inc.jsp" %>

And an inc.jsp:


<c:set var="xyz" value="123"/>

<c:out value="${xyz}"/>

Now open base.jsp and it'll run into this error:


Attribute [value] of [] can accept only static values. at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.calculateAttributeValue(TagBeginGenerator.java:476) at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateSetters(TagBeginGenerator.java:394) at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:562) at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generate(TagBeginGenerator.java:678) at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:181) ... 96 more 

But when you add the taglib directly to inc.jsp:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<c:set var="xyz" value="123"/>

<c:out value="${xyz}"/>

And open inc.jsp instead of base.jsp, it'll work. Therefore an include somehow leads to resolving the core-jstl, and probably others too, to a different version or implementation.

Actually I'm replacing all the includes by <tiles:insert>'s which again require the include of all taglibs and java-imports in included files. Probably some other things won't work either. Is there no way to make the include behave as it behaved back in older netweaver versions? Servlet-Spec 2.3 is used here.

Edited by: Stefan Lotties on Mar 6, 2012 12:23 PM

Former Member
0 Kudos

FYI:

I decompiled some of netweavers JSP-parser classes and it's very obviously a bug. In ParserImpl.parse they create a new ParserImpl based on the current one. But they blindly set isELIgnored to false instead of adopting the original parser's isELIgnored.

That's why it works neither for disabling the EL using web.xml nor by disabling it using the page directive isELIgnored=true.

Very sad. But I'll gonna file a bug for this.

Edited by: Stefan Lotties on Mar 8, 2012 9:09 AM

Edited by: Stefan Lotties on Mar 8, 2012 9:10 AM