Topic
  • 4 replies
  • Latest Post - ‏2013-08-22T07:14:39Z by H9A3_Yuriy_Larin
H9A3_Yuriy_Larin
H9A3_Yuriy_Larin
5 Posts

Pinned topic JSPX is not translated with JSTL (fn) and Custom Tag

‏2013-07-31T14:31:41Z |

I have project I'm trying to adapt for WebSphere App Dev Server 8.5, but JSPX page fails during translation phase.

We use Spring MVC/Security, Apache Tiles, JSPX pages. It works fine on Tomcat, Jetty but not on WS 8.5 for windows.

 

I prepared archive with MINIMAL necessary code/config/files as maven build (attached to post).

When I try to access it fails with error:

com.ibm.ws.jsp.translator.JspTranslationException: JSPG0227E: Exception caught while translating /WEB-INF/views/dashboard.jspx: jsp.error.attribute.invalidPrefix fn at com.ibm.ws.jsp.translator.visitor.validator.FVVisitor.visit(FVVisitor.java:56) at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:132) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:203) at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:245) at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:59) at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:203) at com.ibm.ws.jsp.translator.visitor.validator.ELValidator.validateFunctions(ELValidator.java:526)

Accessing to standard JSTL library tag fails on page. The same error happens when code is commented and 'custom tag' is accessed inside:

\WebSphereTestEar\web\src\main\webapp\WEB-INF\views\dashboard.jspx

I can't understand if that is WebSphere web container bug or Is that issue related to some error in my project ?

Can someone try and confirm error ? Custom tag library/class is accessible and specified in web.xml

 

I'm using WS Dev 8.5 for windows x64, Windows 7 x64.

WS is installed with JDK 1.7 and switched to using it. Code is compiled with IBM JDK 1.7 as well.

Also it's possible to run project with Jetty from \web folder by commands:

>cd web

> mvn jetty:run

browse http://localhost:8081/

JSPX Page works fine in Jetty, Tomcat

So that is quite strange to get error in WebSphere. I searched google, WS and DevNetwork sites but couldn't find similar error and solution for that.

 

Yuriy.

Attachments

  • H9A3_Yuriy_Larin
    H9A3_Yuriy_Larin
    5 Posts

    Re: JSPX is not translated with JSTL (fn) and Custom Tag

    ‏2013-08-02T10:12:09Z  

    There are three components in attached project:

    \core\   with 3 classes to make Spring Security happy to run. The Security is turned off for all url/mappings.

    \web\  has two classes - DashboardController to get to dashboard.jspx page and Utils for custom tag used on it.

    \ear\   is simple. it has only WAR with dependent \core jar

     

    The main dashboard.jspx page is composed by Tiles (header + body + footer).

    /WEB-INF/layouts/layouts.xml  contains definition for view composition.

    /WEB-INF/layouts/default.jspx  contains main layout template

    /WEB-INF/views/dashboard.jspx contains following code.

     

    There are two cases for not working tags in dashboard.jspx

    <div
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" 
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:ntutils="http://nt/utils"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    .........

    ${fn:length(checkLenght)}

    ${ntutils:percent(bigDecimal)}

    ....</div>

    Both tags do fail with mentioned error. It's very strange. Seems like it's web container bug.

     

    web.xml contains:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    .........
        <jsp-config>
            <taglib>
                <taglib-uri>http://nt/utils</taglib-uri>
                <taglib-location>/WEB-INF/tld/utils.tld</taglib-location>
            </taglib>
        </jsp-config>

    .....</web-app>

    \WebSphereTestEar\web\src\main\webapp\WEB-INF\tld\utils.tld   exists and should be accessible for container.

     

    Any help is appreciate.

    Yuruy.

  • H9A3_Yuriy_Larin
    H9A3_Yuriy_Larin
    5 Posts

    Re: JSPX is not translated with JSTL (fn) and Custom Tag

    ‏2013-08-08T11:33:46Z  

    There are three components in attached project:

    \core\   with 3 classes to make Spring Security happy to run. The Security is turned off for all url/mappings.

    \web\  has two classes - DashboardController to get to dashboard.jspx page and Utils for custom tag used on it.

    \ear\   is simple. it has only WAR with dependent \core jar

     

    The main dashboard.jspx page is composed by Tiles (header + body + footer).

    /WEB-INF/layouts/layouts.xml  contains definition for view composition.

    /WEB-INF/layouts/default.jspx  contains main layout template

    /WEB-INF/views/dashboard.jspx contains following code.

     

    There are two cases for not working tags in dashboard.jspx

    <div
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" 
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:ntutils="http://nt/utils"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    .........

    ${fn:length(checkLenght)}

    ${ntutils:percent(bigDecimal)}

    ....</div>

    Both tags do fail with mentioned error. It's very strange. Seems like it's web container bug.

     

    web.xml contains:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    .........
        <jsp-config>
            <taglib>
                <taglib-uri>http://nt/utils</taglib-uri>
                <taglib-location>/WEB-INF/tld/utils.tld</taglib-location>
            </taglib>
        </jsp-config>

    .....</web-app>

    \WebSphereTestEar\web\src\main\webapp\WEB-INF\tld\utils.tld   exists and should be accessible for container.

     

    Any help is appreciate.

    Yuruy.

    Any help is still appreciate.

    Can someone try to run attached application? It doesn't work with database.

     

    Yuriy.

  • H9A3_Yuriy_Larin
    H9A3_Yuriy_Larin
    5 Posts

    Re: JSPX is not translated with JSTL (fn) and Custom Tag

    ‏2013-08-14T12:54:09Z  

    Web app fails with translation error.

    I've made source project much smaller. Only 10 files are present in attached ZIP.

    Attachments

  • H9A3_Yuriy_Larin
    H9A3_Yuriy_Larin
    5 Posts

    Re: JSPX is not translated with JSTL (fn) and Custom Tag

    ‏2013-08-22T07:14:39Z  

    Ok, nobody cares, but here is solution...

     

    JSPX mark up is clear for Tomcat/Jetty:

    <html   xmlns:fmt="http://java.sun.com/jsp/jstl/fmtxmlns:jsp="http://java.sun.com/JSP/Page"

               xmlns:c="http://java.sun.com/jsp/jstl/core"  xmlns:tiles="http://tiles.apache.org/tags-tiles"

               xmlns:spring="http://www.springframework.org/tagsxmlns:fn="http://java.sun.com/jsp/jstl/functions">.........

    but it's not clear for WS web container in some cases.

    So it needs different markup like:

    <jsp:root   xmlns:fmt="http://java.sun.com/jsp/jstl/fmtxmlns:jsp="http://java.sun.com/JSP/Page"

               xmlns:c="http://java.sun.com/jsp/jstl/core"  xmlns:tiles="http://tiles.apache.org/tags-tiles"

               xmlns:spring="http://www.springframework.org/tagsxmlns:fn="http://java.sun.com/jsp/jstl/functionsversion="2.0">.........</jsp:root>