I have a web application and I want to transform a xml to html using my custom xsl in jsp.
When I test the xml and xsl using altovaXMLSPY, it works.
But in the jsp, there is something wrong.
The directory looks like this:
--root
my.jsp
--WEB-INF
taglibs-xsl.tld
--classes
my.xml
my.xsl
The jsp is look like this one:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page%>
<title>my jsp</title>
</head>
<body>
<p>
<xsl:apply nameXml="WEB-INF/classes/my.xml" xsl="WEB-INF/classes/my.xsl" />
</p>
</body>
</html>
And the error is:
javax.servlet.jsp.JspException: Missing bean ‘WEB-INF/classes/my.xml’
I’m not sure but I guess the xsl:apply does a request to get the XML,
requests can not access the WEB-INF directory,
maybe move your xml/xsl files outside of the WEB-INF dir to see if that helps?
also I think nameXml refers to a session variable, use xml=”/my.xml” instead